1s pagest

Upload: ravi-singh

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 1s pagest

    1/55

    i

    PROJECT REPORT ON

    CONTENT BASED IMAGE RETRIEVAL

    BY

    1. TEJASVI SHARMA(0909131114)

    2. RISHI PATEL(0909131088)

    3. RAHUL KUMAR JAISWAL(0909131082)

    Under the Guidance of

    1. Mrs. Chhaya Grover 2. Mrs. Payal Kaushik

    DEPARTMENT OF ELECTRONICS & COMMUNICATION

    ENGINEERINGJSS ACADEMY OF TECHNICAL EDUCATION

    C-20/1 SECTOR-62, NOIDA

    April, 2013

  • 7/28/2019 1s pagest

    2/55

    ii

    Project Report On

    CONTENT BASED IMAGE RETRIEVAL

    by

    1. TEJASVI SHARMA (0909131114)

    2. RISHI PATEL ( 0909131088 )

    3. RAHUL KUMAR JAISWAL ( 0909131082 )

    Under the Guidance of

    1. Mrs.Chhaya Grover 2. Mrs. Payal Kaushik

    Submitted to the Department of Electronics & Communication Engineering

    in partial fulfillment of the requirementsfor the degree of

    Bachelor of Technology

    in

    Electronics & Communication Engineering

    JSS Academy of Technical Education, Noida

    Gautam Buddh Technical University, Lucknow

    April2013

    DECLARATION

  • 7/28/2019 1s pagest

    3/55

    iii

    We hereby declare that this submission is our own work and that, to the best of our

    knowledge and belief, it contains no material previously published or written by

    another person nor material which to a substantial extent has been accepted for the

    award of any other degree or diploma of the university or other institute of higher

    learning, except where due acknowledgment has been made in the text.

    Signature

    1. Tejasvi Sharma

    0909131114

    Signature

    2. Rishi Patel

    0909131088

    Signature

    3. Rahul Kumar Jaiswal

    0909131082

  • 7/28/2019 1s pagest

    4/55

    iv

    CERTIFICATE

    This is to certify that Project Report entitled Content Based Image Retrieval which

    is submitted by Tejasvi Sharma, Rishi Patel and Rahul Kumar Jaiswal for partial

    fulfillment of the requirement for the award of degree B. Tech. in department of

    Electronics and Communication Engineering of G. B. Technical University, Lucknow

    is a record of the candidate own work carried out by him under my/our supervision.

    The matter embodied in this thesis is original and has not been submitted for the

    award of any other degree.

    Signature Signature

    1. Mrs. Chhaya Grover 2. Mrs. Parul JaiswalAssociate Professor Associate Professor

    Date:

  • 7/28/2019 1s pagest

    5/55

    v

    ACKNOWLEDGEMENT

    The successful completion of this report would not have been possible without the help and

    guidance of many people. We avail this opportunity to convey our gratitude to these people.

    We would like to show our greatest appreciation to Prof. Dinesh Chandra, Head of

    Department, Electronics and Communication. We cant say thank you enough for his

    tremendous support and help. I feel motivated and encouraged every time. Without his

    encouragement and guidance this report would not have been materialized.

    We feel privileged to express our deep regards and gratitude to our mentors, Mrs.

    Chhaya Grover and Mrs. Parul Kaushikwithout whose active support; this project would

    not have been possible.

    We owe sincere regards towards the Department Evaluation Committee , ECE who

    motivate us to achieve the desired goal.

    Signature

    1.Tejasvi Sharma

    0909131114

    Signature

    2. Rishi Patel

    0909131088

    Signature

    3. Rahul Kumar Jaiswal

    0909131082

  • 7/28/2019 1s pagest

    6/55

    vi

    ABSTRACT

    Content-based image retrieval (CBIR), also known as query by image content (QBIC) and

    content-based visual information retrieval (CBVIR) is the application of computer vision to

    the image retrieval problem, that is, the problem of searching for digital images in large

    databases.

    "Content-based" means that the search will analyze the actual contents of the image. The term

    'content' in this context might refer colors, shapes, textures, or any other information that can

    be derived from the image itself. Without the ability to examine image content, searches must

    rely on metadata such as captions or keywords, which may be laborious or expensive to

    produce.

    In this project query by example is used which is a query technique that involves providing

    the CBIR system with an example image that it will then base its search upon.

    This project is mainly divided into four partsThree search algorithms namely based on

    colour, shape and texture last part is the application using graphical user interface. Algorithms

    enlisted in this project are also implemented using Matlab2012b software which is also

    showing favorable results.

  • 7/28/2019 1s pagest

    7/55

    vii

    TABLE OF CONTENTS

    Page No.

    DECLARATION........................................................................................... iii

    CERTIFICATE.............................................................................................. iv

    ACKNOWLEDGEMENT............................................................................. v

    ABSTRACT .................................................................................................. vi

    LIST OF FIGURES....................................................................................... x

    LIST OF TABLES......................................................................................... xi

    LIST OF ABBREVIATIONS. xii

    LIST OF SYMBOLS.................................................................................... xiii

    CHAPTER 1- Introduction

    1.1 Background of the problem.......................................................... 2

    1.2 Problem Statement.. 3

    CHAPTER 2- Power Supply

    2.1. Introduction............................................................................................. 4

    2.2 Bridge Wave Rctifier............................................................................. 4

    2.3 Voltage regulator................................................................................... 5

    CHAPTER 3- Color Based Search

    3.1 Architecture of CBIR Sysytem ........................ 7

    3.2 ColorBased Search Based On Mean And Standard Deviation. 8

    3.2.1 Algorithm 8

    3.2.2 Flowchart for image retrieval based on Mean and S.D... 9

    3.3 Image Retrieval Based on Query in Color Percentage Form 11

    3.3.2 Flow chart image retrieval based on color content. 12

    CHAPTER 4- SHAPE BASED IMAGE RETRIEVAL

    4.1 Introduction............................................................................................ 20

    4.2. Edge Detection

    4.2.1 Sobel Operation

    4.2.2 A Prompt Edge Detection Method

    4.3. Shape Representation

    4.3.1 Central Point Determination

    4.3.2 Polar Representation and Distance Sequences4.3.3 Mountain Climbing Sequence (MCS)

  • 7/28/2019 1s pagest

    8/55

    viii

    4.3.4. Shape Matching

    4.4 Hausdorff Distance Technique

    4.4.1 Introduction

    4.4.2. What is Hausdorff distance ?

    4.4.3. Application Examples

    CHAPTER 5-TEXTURE BASED IMAGE RETRIEVAL........... 27

    5.1 Introduction............................................................................................. 27

    5.2 Applications

    5.2.1. Inspection

    5.2.2 Medical Image Analysis5.2.3. Document Processing

    5.3. Texture Analysis

    5.3.1. Statistical Methods

    5.3.2 Features and offsets used

    CHAPTER 6- GRAPHICAL USER INTERFACE

    6.1 Introduction......................... 41

    6.2 History

    6.3 Image Search GUI

  • 7/28/2019 1s pagest

    9/55

    ix

    LIST OF FIGURES

    Page

    Figure 1.1:Search Example .... 04

    Figure 1.2: Search Example ... 05

    Figure 2.1: An Image...... 06

    Figure 2.2: Grayscale Image... 07

    Figure 2.3: Additive Model of RGB.... 08

    Figure 2.4: Additive Model of CMYK. 09

    Figure 2.5: Additive Model of Gamut.... 10

    Figure 2.6: Connectivity Examples. 11

    Figure 3.1: Architecture of CBIR.... 13

    Figure 3.2: Algorithm Example.......... 14

    Figure 3.3: Example Query.. 16

    Figure 3.4: Retrieved Images... 16

    Figure 3.5: Color % Example... 17

    Figure 4.1: Sobel Operator..... 20

    Figure 4.2 : Prompt Edge Detector... 20

    Figure 4.3 : Distance and angle of Contour. 22

    Figure 4.4: Polar Representation.. 22

    Figure 4.5 : Feature Selection.. 23

    Figure 4.6,7 : Limitation of min(D(A,B)).... 25

    Figure 4.8-14 : Hausdorff Distance Calculation Steps.... 26

    Figure 4.15 : Application Example.. 28

    Figure 4.16 : Edge Detection... 29

  • 7/28/2019 1s pagest

    10/55

    x

    Figure 5.1 : Texture Application.. 32

    Figure 5.2 : Texture Analysis.... 33

    Figure 5.3 : Stastical Methods. 38

    Figure 5.4 : Texture Analysis Example... 42

    Figure 5.5 : Texture Features From Power Spectru. 42

    Figure 5.6 : Offsets Used. 43

  • 7/28/2019 1s pagest

    11/55

    xi

    LIST OF TABLES

    Page

    Table 5.1: Autocorrelation Feature... 16

  • 7/28/2019 1s pagest

    12/55

    1

    CHAPTER 1

    INTRODUCTION

    The use of images for illustration in human communication has its roots millennia ago. Our

    stone age ancestors painted pictures on the walls of their caves and certainly the use of maps

    was known in pre-Roman times already. Similar as the increase in printed media through the

    invention of book-printing, nowadays we observe a rapid increase in digital media caused by

    an ever increasing growth of computing power, decreasing cost of storage and steady

    improvement of communication infrastructure technology.

    But all that information is only useful if one can access it efficiently. This does not only mean

    fast access from a storage management point of view but also means that one should be able

    to find the desired information without scanning all information manually.

    An important part of digital media is image data. In contrast to text, images just consist of

    pure pixel data with no inherent meaning. Commercial image catalogues therefore use manual

    annotation and rely on text retrieval techniques for searching particular images.

    Content-based image retrieval uses the visual contents of an image such as color, shape,

    texture, and spatial layout to represent and index the image. In typical content-based image

    retrieval systems , the visual contents of the images in the database are extracted and

    described by multi-dimensional feature vectors. The feature vectors of the images in the

    database form a feature database. To retrieve images, users provide the retrieval system with

    example images or sketched figures.

    The system then changes these examples into its internal representation of feature vectors.

    The similarities /distances between the feature vectors of the query example or sketch and

    those of the images in the database are then calculated and retrieval is performed with the aid

    of an indexing scheme. The indexing scheme provides an efficient way to search for the

    image database. Recent retrieval systems have incorporated users' relevance feedback to

    modify the retrieval process in order to generate perceptually and semantically more

    meaningful retrieval results. In this we introduce these fundamental techniques for content-

    based image retrieval. This project is based on the search performed on three ways, through

    Colour Shape and Texture. In this part of the report we are dealing only with the colour based

    search.

  • 7/28/2019 1s pagest

    13/55

    2

    1.1 Background Of The Problem

    Early work on image retrieval can be traced back to the late 1970s. In 1979, a conference on

    Database Techniques for Pictorial Applications [6] was held in Florence. Since then, the

    application potential of image

    database management techniques has attracted the attention of researchers . Early techniques

    were not generally based on visual features but on the textual annotation of images. In other

    words, images were first annotated with text and then searched using a text-based approach

    from traditional database management systems.

    Comprehensive surveys of early text-based image retrieval methods can be found in. Text-

    based image retrieval uses traditional database techniques to manage images. Through text

    descriptions, images can be organized by topical or semantic hierarchies to facilitate easy

    navigation and browsing based on standard Boolean queries. However, since automatically

    generating descriptive texts for a wide spectrum of images is not feasible, most text-based

    image retrieval systems require manual annotation of images. Obviously, annotating images

    manually is a cumbersome and expensive task for large image databases, and is often

    subjective, context-sensitive and incomplete. As a result, it is difficult for the traditional

    text-based methods to support a variety of task-dependent queries.

    In the early 1990s, as a result of advances in the Internet and new digital image sensor

    technologies, the volume of digital images produced by scientific, educational, medical,

    industrial, and other applications available to users increased dramatically.

    The difficulties faced by text-based retrieval became more and more severe. The efficient

    management of the rapidly expanding visual information became an urgent problem. This

    need formed the driving force behind the emergence of content-based image retrievaltechniques. In 1992, the National Science Foundation of the United States organized a

    workshop on visual information management systems to identify new directions in image

    database management systems. It was widely recognized that a more efficient and intuitive

    way to represent and index visual information would be based on properties that are inherent

    in the images themselves. Researchers from the communities of computer vision, database

    management, human-computer interface, and information retrieval were attracted to

    this field.

  • 7/28/2019 1s pagest

    14/55

    3

    Since then, research on content-based image retrieval has developed rapidly . Since 1997, the

    number of research publications on the techniques of visual information extraction,

    organization, indexing, user query and interaction, and database management has increased

    enormoulsy. Similarly, a large number of academic and commercial retrieval systems have

    been developed by universities, government organizations, companies, and hospitals.

    Comprehensive surveys of these techniques and systems can be found .

    Content-based image retrieval, uses the visual contents of an image such as color, shape,

    texture, and spatial layout to represent and index the image. In typical content-based image

    retrieval systems , the visual contents of the images in the database are extracted anddescribed by multi-dimensional feature vectors. The feature vectors of the images in the

    database form a feature database. To retrieve images, users provide the retrieval system with

    example images or sketched figures.

    The system then changes these examples into its internal representation of feature vectors.

    The similarities /distances between the feature vectors of the query example or sketch and

    those of the images in the database are then calculated and retrieval is performed with the aid

    of an indexing scheme. The indexing scheme provides an efficient way to search for the

    image database. Recent retrieval systems have incorporated users' relevance feedback to

    modify the retrieval process in order to generate perceptually and semantically more

    meaningful retrieval results

    1.2 Problem Statement

    Commercial image catalogues therefore use manual annotation and rely on text retrieval

    techniques for searching particular images. However, such an annotation has two main

    drawbacks:

    The annotation depends on the person who adds it. Naturally the result mayvary from person to person and furthermore may depend on the context. Within a

    general image database it may be sufficient to just add an annotation like butterfly

    whereas this obviously is not sufficient for a biologists database consisting of different

    types of butterflies only

    The second problem with manual annotation is that it is very time consuming.While it may be worthwhile for commercial image collections, it is prohibitive for

  • 7/28/2019 1s pagest

    15/55

    4

    indexing of images within the World Wide Web. One could not even keep up with the

    growth of available image data.

    The image search results, appearing on the first page for text query rose black, are shown in

    Figure 1

    Figure 1.1

    Another problem with manual annotation is that of each user may name the queryimage in their own language which would be hectic to deal with.

    This method also provides too much responsibility to the end user.It means that ittotally depends on human perception of how to name the image and how to form the

    query text. As perception varies from person to person the method becomes very

    ineffective.

  • 7/28/2019 1s pagest

    16/55

    5

    Figure 1.2

    Also there are some images which require greater description which cannot bedescribed by words. Such images may or may not be extracted by this method.

  • 7/28/2019 1s pagest

    17/55

    6

    CHAPTER 2

    IMAGE PROCESSING

    2.1 Introduction

    2.1.1 What is an image?

    An image is an array, or a matrix, of square pixels (picture elements) arranged in columns and

    rows

    .

    Figure 2.1: An imagean array or a matrix of pixels arranged in columns and rows.

    In a (8-bit) grayscale image each picture element has an assigned intensity that ranges from 0

    to 255. A grey scale image is what people normally call a black and white image, but the

    name emphasizes that such an image will also include many shades of grey.

    Figure 2.2 Each pixel has a value from 0 (black) to 255 (white).

  • 7/28/2019 1s pagest

    18/55

    7

    The possible range of the pixel values depend on the colour depth of the image, here 8 bit =

    256 tones or greyscales.

    A normal greyscale image has 8 bit colour depth = 256 greyscales. A true colour image has

    24 bit colour depth = 8 x 8 x 8 bits = 256 x 256 x 256 colours = ~16 million colours. Some

    greyscale images have more greyscales, for instance 16 bit = 65536 greyscales. In principle

    three greyscale images can be combined to form an image with 281,474,976,710,656

    greyscales. There are two general groups of images: vector graphics (or line art) and bitmaps

    (pixel-based or images). Some of the most common file formats are:

    GIFan 8-bit (256 colour), non-destructively compressed bitmap format. Mostly used for

    web. Has several sub-standards one of which is the animated GIF.JPEGa very efficient (i.e. much information per byte) destructively compressed 24 bit (16

    million colours) bitmap format. Widely used, especially for web and Internet (bandwidth-

    limited).

    TIFFthe standard 24 bit publication bitmap format. Compresses nondestructively with, for

    instance, Lempel-Ziv-Welch (LZW) compression.

    PS Postscript, a standard vector format. Has numerous sub-standards and can be difficult

    to transport across platforms and operating systems.

    PSDa dedicated Photoshop format that keeps all the information in an image including all

    the layers.

    2.2 Colours

    For science communication, the two main colour spaces are RGB and CMYK.

    2.2.1 RGB

    The RGB colour model relates very closely to the way we perceive colour with the r, g and b

    receptors in our retinas. RGB uses additive colour mixing and is the basic colour model used

    in television or any other medium that projects colour with light.

    It is the basic colour model used in computers and for web graphics, but it cannot be used for

    print production.The secondary colours of RGBcyan, magenta, and yelloware formed by

    mixing two of the primary colours (red, green or blue) and excluding the third colour. Red

    and green combine to make yellow, green and blue to make cyan, and blue and red form

    magenta. The combination of red, green, and blue in full intensity makes white.In Photoshop

    using the screen mode for the different layers in an image will make the intensities mix

    together according to the additive colour mixing model. This is analogous to stacking slide

    images on top of each other and shining light through them.

  • 7/28/2019 1s pagest

    19/55

    8

    Figure 2.3: The additive model of RGB.

    Red, green, and blue are the primary stimuli for human colour perception and are the primary

    additive colours.

    2.2.2 CMYK

    The 4-colour CMYK model used in printing lays down overlapping layers of varying

    percentages of transparent cyan (C), magenta (M) and yellow (Y) inks. In addition a

    layer of black (K) ink can be added. The CMYK model uses the subtractive colour

    model.

    Figure 2.4

  • 7/28/2019 1s pagest

    20/55

    9

    The colours created by the subtractive model of CMYK don't look exactly like the colours

    created in the additive model of RGB Most importantly, CMYK cannot reproduce the

    brightness of RGB colours. In addition, the CMYK gamut is much smaller than the RGB

    gamut.

    2.2.3 Gamut

    The range, or gamut, of human colour perception is quite large. The two colour spaces

    discussed here span only a fraction of the colours we can see. Furthermore the two spaces do

    not have the same gamut, meaning that converting from onecolour space to the other maycause problems for colours in the outer regions of the gamut.

    Figure 2.5

    2.3 Types Of Neighbourhoods

    Neighborhood operations play a key role in modern digital image processing. It is therefore

    important to understand how images can be sampled and how that relates to the various

    neighborhoods that can be used to process an image.

    Rectangular sampling In most cases, images are sampled by laying a rectangular grid over

    an image as illustrated. This results in the type of sampling shown in figure.

    Hexagonal sampling An alternative sampling scheme is shown in Figure c and is termed

    hexagonal sampling.

  • 7/28/2019 1s pagest

    21/55

    10

    Both sampling schemes have been studied extensively and both represent a possible periodic

    tiling of the continuous image space. We will restrict our attention, however, to only

    rectangular sampling as it remains, due to hardware and software considerations, the method

    of choice. Local operations produce an output pixel value b[m=mo ,n=no ] based upon the

    pixel values in the neighborhood of a[m=mo ,n=no ]. Some of the most common

    neighborhoods are the 4-connected neighborhood and the 8-connected neighborhood in the

    case of rectangular sampling and the 6-connected neighborhood in the case of hexagonal

    sampling illustrated in figure.

    Figure 2.6 (a), (b), (c)

  • 7/28/2019 1s pagest

    22/55

    11

    CHAPTER 3

    COLOR BASED SEARCH

    Content based Image retrieval is an efficient way to search through an image database by

    means of image features such as colour, texture, shape, pattern or any combinations of them.

    Colour is an important cue for image retrieval. The image retrieval based on colour features

    has proved effective for a large image database, however it is neglected that colour is not a

    stable parameter, as it depends not only on surface characteristics but also capturing

    conditions such as illumination, the device characteristics, angle of the device. To retrieve

    desired images, user has to provide a query image. The system then performs certain feature

    extraction procedures on it and represents it in the form of feature vectors. The similarities

    distances between the feature vectors of the query image and those of the images in the

    database are then calculated and retrieval is performed with the help of indexing schemes. The

    indexing scheme provides an efficient way to search for the image database. Advances in data

    storage and image acquisition technologies have enabled the creation of large image datasets.

    In order to deal with these data, it is necessary to develop appropriate information systems to

    efficiently manage these collections. Image searching is one of the most important services

    that need to be supported by such systems.

    The main reason for color based search is that it is independent of image size and orientation.

    Also it is one of the most straight-forward features utilized by humans for visual recognition

    and discrimination.

    Color is one of the most widely used visual features in content-based image retrieval. It is

    relatively robust and simple to represent. Various studies of color perception and color spaces

    have been proposed, in order to find color-based techniques that are more closely aligned with

    the ways that humans perceive color. The color histogram has been the most commonly used

    representation technique, statistically describing combined probabilistic properties of the

    various color channels (such as the Red, Green, and Blue channels), by capturing the number

    of pixels having particular properties.

  • 7/28/2019 1s pagest

    23/55

    12

    3.1 Architecture of CBIR Systems

    Figure shows a typical architecture of a content-based image retrieval system. Two

    main functionalities are supported: data insertion and query processing. The data insertion

    subsystem is responsible for extracting appropriate features from images and storing them

    into the image database (see dashed modules and arrows). This process is usually performed

    off-line.

    The query processing, in turn, is organized as follows: the interface allows a user to specify a

    query by means of a query pattern and to visualize the retrieved similar images. The query-

    processing module extracts a feature vector from a query pattern and applies a metric (such as

    the Euclidean distance) to evaluate the similarity between the query image and the database

    images. Next, it ranks the database images in a decreasing order of similarity to the query

    image and forwards the most similar images to the interface module. Note that database

    images are often indexed according to their feature vectors to speed up retrieval and similarity

    computation.

    Note that both the data insertion and the query processing functionalities use the feature

    vector extraction module.

    Figure 3.1

  • 7/28/2019 1s pagest

    24/55

    13

    3.2 Color Based Search Based On Mean And Standard Deviation

    The method of image searching and retrieval proposed here mainly focuses on the generation

    of the feature vector by calculating the average means. Steps of the algorithm are given

    below.

    3.2.1 Algorithm

    Step1: Three color planes namely Red , Green and Blue are separated.

    Step2: For each plane row mean and column mean of colours are calculated. Pictorially the

    average row and column mean is calculated as follows The average mean is calculated by

    adding up the mean of every row. E.g.: (3+8+13+18+23) = 13. Similarly with column it

    would be (11+12+13+14+15) = 13 shown as in fig given below.

    Figure 3.2

    Step3: The average of all row means and all columns means is calculated for each plane.

    Step4: The features of all 3 planes are combined to form a feature vector. Once the feature

    vectors are generated for all images in the database, they are stored in a feature database

    Step5: The Euclidian distances between the feature vector of query image and the feature

    database are calculated using Eq given below.

  • 7/28/2019 1s pagest

    25/55

    14

    The value of d is calculated by summation of the squares of difference of the features of

    database image and query image as mentioned in figure.

    3.2.2 Flowchart for image retrieval based on Mean and S.D.

    To discuss the performance of the algorithm we have considered the beach class as an

    example. The query image for the same is shown in the Fig This query image is used for both

    the databases. Query Image The algorithm is applied on the first database of 300 images to

    generate feature vector for each image in the database and the query image and hence

    calculate the Euclidian distance to find the better match. The algorithm has produced very

    good results as it can be seen in the fig below where the first 20 retrieved images found are

    shown.

    Start

    Select the query

    image

    Calculate mean and

    standard deviation of the

    query and database images

    Convert query and database

    images from RGB to Gray

    Retrieve the images into

    a separate directory

    Stop

    Compare the database

    and query images on the

    basis of mean and sd

  • 7/28/2019 1s pagest

    26/55

    15

    Figure 3.3 Query

    Figure 3.4 Retrieved Images

    Retrieval Efficiency

    The common evaluation measures used in CBIR systems are precision, defined as

    Precision =No of relevant images retrieved/Total number of images retrieved

    Recall =No.of relevant images retrieved/Total no.of relevant images in the database.

  • 7/28/2019 1s pagest

    27/55

    16

    3.3 Image Retrieval Based on Query in Color Percentage Form

    To make the algorithm clear we will first start with the example as shown below

    Figure 3.5

    3.3.1 Algorithm:

    Step 1: Get the input for the required colour content according to which the image from our

    database is to be sorted out.

    Step 2: Extract the RGB metrics of each images in the database

    Step 3: Compare the RGB content extracted above with the query colour content

    Step 4: Extract those images which nearly satisfy whose colour content nearly satisfy with the

    input colour content.

    Step 5: Retrieve the images into separate direct

  • 7/28/2019 1s pagest

    28/55

    17

    3.3.2 Flow chart image retrieval based on color content

    Start

    Set the required color

    content

    Compare the requiredcontent with that of database

    Extract RGB intensity

    matrics from the data base

    Retrieve the images into

    a separate directory

    Stop

  • 7/28/2019 1s pagest

    29/55

    18

    CHAPTER 4

    SHAPE BASED IMAGE RETRIEVAL

    4.1 Introduction

    Because of recent advances in computer technology and the revolution in the way information

    is processed, increasing interest has developed in automatic information retrieval from huge

    databases. In particular, content-based retrieval has received considerable attention and,

    consequently, improving the technology for content-based querying systems becomes more

    challenging. There are four important feature components for content-based image retrieval:

    color, texture, shape.

    One of the most challenging aspects to content based image retrieval is retrieval by shape. No

    mathematically rigorous definition of shape similarity accounts for the various semantic

    qualities that humans assign to shapes.1 Without textual tags or other semantic descriptors, we

    can only approximate shape similarity from the 2D image. There have been a variety of

    proposed methods for determining similarity between planar shapes, including moment-based

    matching algorithms hausdorff-distance based metrics,4,5 and schemes for matching turning

    angle around the perimeter of a shape.6 The goal of any of these algorithms is to approximate

    the perceptual judgments of the user. Algorithms which more closely approximate the

    perceptual judgments of the user are considered to be more successful.

    4.2. Edge Detection

    Edge detection is a necessary pre-processing step in most of computer vision and image

    understanding systems. The accuracy and reliability of edge detection is critical to the overall

    performance of these systems. Earlier researchers paid a lot of attention to edge detection, but

    up to now, edge detection is still highly challenging. In this section, we will briefly illustrate

    two common edge detection methods, and point out their drawbacks. In addition, we

    introduce a simple and efficient method for edge detection.

    4.2.1 Sobel Operation

    Another common edge detection method is the sobel method. The sobel operation uses four

    masks to detect edge points. The sobel operation computes the partial derivatives of a local

    pixel to form the gradient. For the gray-level function f(x,y), the gradient of f at pixel

  • 7/28/2019 1s pagest

    30/55

    19

    (x,y) is defined as a vector. The magnitude of f can be approximated as the

    following equation:

    Figure 4.1

    4.2.2 A Prompt Edge Detection Method

    In this subsection, an easy and effective edge detection method, the Prompt edge detection

    method, is introduced. The Prompt edge detector detects edge points by checking the

    differences in the gray value for each point from those of its neighbors. For a pixel (x,y) with

    gray value g(x,y), let g0(x,y), g1(x,y), , and g7(x,y) denote the gray values of its neighbors in

    8 directions .

    Figure 4.2

    Let hd (x, y) = g(x, y) - gd (x, y) be the difference in the gray value of pixel (x,y) from that of

    its neighbour in direction d. Let B d(x,y) be the number of differences that exceed a threshold

    T, where T = a + c, c is a constant, and a is the average difference between all pairs of

    adjacent pixels' gray values in the image. In this work, we take the value 2 for c and, instead

    of taking a single value for T, we take the local average differences for T by dividing the hole

    image into M M blocks and computing the average difference for each block. The pixel

    (x,y) is indicated as an edge point if the following inequalities hold :

    3 Bd (x, y) 6

    These inequalities can also avoid indicating noisy points as edge points.

    4.3. Shape Representation

    A good representation can manifest an objects characteristics. Furthermore, it would help

    achieve a high recognition rate for a content-based image retrieval system. Some researchers

    have shown that objects are very distinguishable based on their visible features. Among

    these features, shape is the most important for recognizing objects. In this section, we

  • 7/28/2019 1s pagest

    31/55

    20

    introduce a new shape representation method that is invariant to translation, rotation, and

    scaling, and also has high tolerance to complex, occluding, or even deformed images.

    4.3.1 Central Point Determination

    The first step in shape representation for an object is to locate the central point of the object.

    To permit invariance to translation, rotation and scaling, the geometric center of the object is

    selected as a reference point. We use the equation below to compute the centroid of an object.

    where n is the number of points of an object.

    4.3.2 Polar Representation and Distance Sequences

    A shape representation method is outlined in this section. We characterize the contour using a

    sequence of contour points described in polar from. Here, we take the pole at the centroid

    (xc,yc), then the contour graph can be represented by a polar equation d = f ( ) , and each

    contour point (x,y) has the polar description (d, ) , where x, y, d, and are related using

    Equations given below

    A sketch map is shown of Distance and angle of the contour points relative to centroid

    Figure 4.3

  • 7/28/2019 1s pagest

    32/55

    21

    With the polar description, we may represent contour points as a sequence (d0 , d1,, dn1) ,

    where di = f ( i) i =i 2 /n , where di is known to be the distance between the

    corresponding contour point and the centroid. Figure 3.4 illustrates the graph of the polar

    equation d = f( ) for a given contour.

    Figure 4.4

    An example of polar representation (a) A contour of an object.

    (b) Graph of polar representation for the contour in (a).

    We can obtain the distance sequence ( d0 , d1,, dn-1) by successively rotating a ray

    emanating from the pole counter clockwise through an fixed angle , where = 2 n for a

    positive integer n, and at each step of rotation. Recording the distance of intersection point of

    the current ray lies with the contour . This method of representing and describing the shape of

    an object is adequate for convex objects. However, for an object containing concavities, a ray

    may intersect the contour with more than one point. If we only record the distance of one

    point (say, smallest distance) at each step of rotation, the contour points of some protrusions

    may be missed. We can eliminate this problem by recording the distance of the farthest

    intersection point at each rotating the scanning ray step, or for a more detailed description,

    recording the distances, or furthermore associating the number of all the intersection points.

    To provide scale invariance, the maximum distance is computed and all distances are

    normalized to it. Thus, all values fall between 0 and 1 regardless of how much the objects are

    scaled.

    Figure 4.5

    Features selection of two different concave objects.

  • 7/28/2019 1s pagest

    33/55

    22

    4.3.3 Mountain Climbing Sequence (MCS)

    Since we used the pole at the centroid of the object, the representation of a distance sequence

    is translation invariant. To achieve rotation-invariance, Bernier rotated the polar coordinate

    system, such that the maximum distance was associated with the angle of zero. However there

    is no any guarantee for this method if there are more than one maximum distance. The

    representation will not be unique. In the example shown in figure, both objects have three

    maximal distances and each has three possible representations: ( 2 , 1, 1, 2 , 1, 2 ,1), ( 2 , 1, 2

    ,1, 2 , 1,1), and ( 2 ,1 2 , 1,1, 2 ,1). To reduce this problem, we propose another representation

    method that deals with all distances rather than only the individual maximal distances in thesequence. First, we evaluate the ordering-consistency functions ci's, as defined in Equation

    below, at the sequence D = (d0, d1, , dn-1) as described , and determine the index, s, of the

    function having the smallest value, as defined in Equation ci. The distances in the sequence D

    are then shifted forward for s positions to yield a new sequence Dm= (ds,ds+1, ,ds+n -1),

    where dk = dk mod n for each k. This new sequence Dm is called the mountain climbing

    sequence(MCS) for the object. Sequence (MCS) for the object. The MCS representations for

    Figures 3.5(a) and (b) are identical and both come out as (1, 1, 2 , 1, 2 , 1, 2 ), and as a result,

    they are considered having the same shape.

    3.3.4. Shape Matching

    The final step of content-based image retrieval is the matching stage. As discussed in the

    receding subsection, we use the MCS to represent the shape of objects. We proceed to the

    matching stage to measure the similarity between two objects by simply evaluating the

    Euclidean distance between each objects MCSs of them. The Euclidean distance between

    two sequences is given in Equation below

  • 7/28/2019 1s pagest

    34/55

    23

    where U and V are the query and dababase images, vi, ui are their ith features, respectively,

    and n is the dimension of the feature space. Any arbitrary two dimensional shape can then be

    compared to any other using the outline method.

    4.4 Hausdorff Distance Technique

    4.4.1 Introduction

    Although hausdorff distance technique is very robust nature application of which resulted in

    the appearance of time delay. So in order to get better result we have to reach a trade-off

    between time delay accuracy.

    That is for every point a of A, find its smallest distance to any point of B; finally keep thesmallest distance found among point a. There is a limitation for the above calculated distance

    given as below:

    Figure 4.6

    First, shortest distance doesnt consider the whole shape

  • 7/28/2019 1s pagest

    35/55

    24

    Figure 4.7

    Second, shortest distance doesnt account for the position of the object

    4.4.2. What is Hausdorff distance ?

    Named after Felix Hausdorff (1868-1942), Hausdorff distance is the maximum distance of a

    set to the nearest point in the other set . More formally, Hausdorff distance from set A to set B

    is a maxi-min function, defined as

    where a and b are points of sets A and B respectively, and d(a, b) is any metric between these

    points ; for simplicity, we'll take d(a, b) as the Euclidian distance between a and b. If for

    instance A and B are two sets of points, steps to to understand how hausdorff distance is

    calculated are shown below :

    Step 1:

    Figure 4.8

  • 7/28/2019 1s pagest

    36/55

    25

    Given two sets of points A and B ,finding h(A,B)

    Step 2:

    Figure 4.9

    Compute distance between ai and bjs.

    Step3:

    Figure 4.10

    Keeping the shortest distance.

    Step4:

    Figure 4.11

    Compute distance between a2 and bjs.

  • 7/28/2019 1s pagest

    37/55

    26

    Step5:

    .

    Figure 4.12

    And keep the shortest distance

    Step6:

    Figure 4.13

    Finally , find the largest of the two distances.

    Step 7:

    Figure 4.14

    This is h(A,B).

  • 7/28/2019 1s pagest

    38/55

    27

    4.4.3. Application Examples

    One of the main application of the Hausdorff distance is image matching, used for instance in

    image analysis, visual navigation of robots, computer-assisted surgery, etc. Basically, the

    Hausdorff metric will serve to check if a template image is present in a test image ; the lower

    the distance value, the best the match. That method gives interesting results, even in presence

    of noise or occlusion (when the target is partially hidden).

    Say the small image below is our template, and the large one is the test image :

    Figure 4.15

    We want to find if the small image is present, and where, in the large image. The first step is

    to extract the edges of both images, so to work with binary sets of points, lines or polygons :

  • 7/28/2019 1s pagest

    39/55

    28

    Figure 4.16

    Edge extraction is usually done with one of the many edge detectors known in image

    processing, such as Canny edge detector, Laplacian, Sobel, etc. minimum Hausdorff distance

    between two images found a best match .

  • 7/28/2019 1s pagest

    40/55

    29

    CHAPTER 5

    TEXTURE BASED IMAGE RETRIEVAL

    5.1 Introduction

    In many machine vision and image processing algorithms, simplifying assumptions are made

    about the uniformity of intensities in local image regions. However, images of real objects

    often do not exhibit regions of uniform intensities. For example, the image of a wooden

    surface is not uniform but contains variations of intensities which form certain repeated

    patterns called visual texture. The patterns can be the result of physical surface properties

    such as roughness or oriented strands which often have a tactile quality, or they could be the

    result of reflectance differences such as the color on a surface.

    We recognize texture when we see it but it is very difficult to define. This difficulty is

    demonstrated by the number of different texture definitions attempted by vision researchers.

    Some have compiled a catalogue of texture definitions in the computer vision literature and

    we give some examples here.

    We may regard texture as what constitutes a macroscopic region. Its structure is simply

    attributed to the repetitive patterns in which elements or primitives are arranged according to

    a placement rule.

    A region in an image has a constant texture if a set of local statistics or other local

    properties of the picture function are constant, slowly varying, or approximately periodic.

    An image texture is described by the number and types of its (tonal) primitives and the

    spatial organization or layout of its (tonal) primitives. A fundamental characteristic of texture:

    it cannot be analyzed without a frame of reference of tonal primitive being stated or implied.

    For any smooth gray-tone surface, there exists a scale such that when the surface is examined,

    it has no texture. Then as resolution increases, it takes on a fine texture and then a coarse

    texture.

    The notion of texture appears to depend upon three ingredients: (i) some local order is

    repeated over a region which is large in comparison to the orders size, (ii) the order consists

    in the arrangement of elementary parts, and (iii) the parts are roughly uniform entities having

    approximately the same dimensions everywhere within the textured region.

  • 7/28/2019 1s pagest

    41/55

    30

    This collection of definitions demonstrates that the definition of texture is formulated by

    different people depending upon the particular application and that there is no generally

    agreed upon definition. Some are perceptually motivated, and others are driven completely by

    the application in which the definition will be used.

    Image texture, defined as a function of the spatial variation in pixel intensities (gray values), is

    useful in a variety of applications and has been a subject of intense study by many

    researchers. One immediate application of image texture is the recognition of image regions

    using texture properties.

    5.2ApplicationsTexture analysis is an important and useful area of study in machine vision. Most natural

    surfaces exhibit texture and a successful vision system must be able to deal with the textured

    world surrounding it. This section will review the importance of texture perception from two

    viewpointsfrom the viewpoint of human vision or psychophysics and from the viewpoint

    of practical machine vision applications. Texture analysis methods have been utilized in a

    variety of application domains. In some of the mature domains (such as remote sensing)

    texture already has played a major role, while in other disciplines (such as surface inspection)new applications of texture are being found. We will briefly review the role of texture in

    automated inspection, medical image processing, document processing, and remote sensing.

    Images from two application domains are shown in Figure 1. The role that texture plays in

    these examples varies depending upon the application. For example, in the SAR images of

    Figures 4.1(b) and (c) texture is defined to be the local scene heterogeneity and this property

    is used for classification of land use categories such as water, agricultural areas, etc. In the

    ultrasound image of the heart in Figure 4.1(a), texture is defined as the amount of randomness

    which has a lower value in the vicinity of the border between the heart cavity and the inner

    wall than in the blood filled cavity. This fact can be used to perform segmentation and

    boundary detection using texture analysis methods.

  • 7/28/2019 1s pagest

    42/55

    31

    Figure 5.1

    5.2.1. Inspection

    There has been a limited number of applications of texture processing to automated inspection

    problems. These applications include defect detection in images of textiles and automated

    inspection of carpet wear and automobile paints. Texture pairs with identical second-order

    statistics. The bottom halves of the images consist of texture tokens that are different from the

    ones in the top half. (a) Humans cannot perceive the two regions without careful scrutiny. (b)

    The two different regions are immediately discriminable by humans. In the detection of

    defects in texture images, most applications have been in the domain of textile inspection.

    Dewaele used signal processing methods to detect point defects and line defects in texture

    images. They have sparse convolution masks in which the bank of filters are adaptively

    selected depending upon the image to be analyzed. Texture features are computed from the

    filtered images. A Mahalanobis distance classifier is used to classify the defective areas. Some

    have defined a simple window differencing operator to the texture features obtained from

    simple filtering operations. This allows one to detect the boundaries of defects in the texture.

    Chen and Jain used a structural approach to defect detection in textured images. They extract

    a skeletal structure from images, and by detecting anomalies in certain statistical features in

    these skeletons, defects in the texture are identified. Conners utilized texture analysismethods to detect defects in lumber wood automatically. The defect detection is performed by

  • 7/28/2019 1s pagest

    43/55

    32

    dividing the image into sub windows and classifying each sub window into one of the defect

    categories such as knot, decay, mineral streak, etc. The features they use to perform this

    classification is based on tonal features such as mean, variance, skewness, and kurtosis of gray

    levels along with texture features computed from gray level co-occurrence matrices in

    analyzing pictures of wood. The combination of using tonal features along with textural

    features improves the correct classification rates over using either type of feature alone. In the

    area of quality control of textured images, Siew proposed a method for the assessment of

    carpet wear. They used simple texture features that are computed from second-order gray

    level dependency statistics and from first-order gray level difference statistics. They showed

    that the numerical texture features obtained from these techniques can characterize the carpetwear successfully. Jain used the texture features computed from a bank of Gabor filters to

    automatically classify the quality of painted metallic surfaces. A pair of automotive paint

    finish images is shown where the image in (a) has uniform coating of paint, but the image in

    (b) has mottle or blotchy appearance.

    Figure 5.2 Examples of images from various application domains in which texture analysis is

    important.

    5.2 Medical Image Analysis

    Image analysis techniques have played an important role in several medical applications. In

    general, the applications involve the automatic extraction of features from the image which

    are then used for a variety of classification tasks, such as distinguishing normal tissue from

    abnormal tissue. Depending upon the particular classification task, the extracted features

    capture morphological properties, color properties, or certain textural properties of the image.

  • 7/28/2019 1s pagest

    44/55

    33

    The textural properties computed are closely related to the application domain to be used. For

    example, Sutton and Hall discuss the classification of pulmonary disease using texture

    features. Some diseases, such as interstitial fibrosis, affect the lungs in such a manner that the

    resulting changes in the X-ray images are texture changes as opposed to clearly delineated

    lesions. In such applications, texture analysis methods are ideally suited for these images.

    Sutton and Hall propose the use of three types of texture features to distinguish normal lungs

    from diseased lungs. These features are computed based on an isotropic contrast measure, a

    directional contrast measure, and a Fourier domain energy sampling. In their classification

    experiments, the best classification results were obtained using the directional contrast

    measure. Harms used image texture in combination with color features to diagnose leukemicmalignancy in samples of stained blood cells. They extracted texture micro-edges and

    textons between these micro-edges. The textons were regions with almost uniform color.

    They extracted a number of texture features from the textons including the total number of

    pixels in the textons which have a specific color, the mean texton radius and texton size for

    each color and various texton shape features. In combination with color, the texture features

    significantly improved the correct classification rate of blood cell types compared to using

    only color features. Landeweerd and Gelsema extracted various first-order statistics (such as

    mean gray level in a region) as well as second-order statistics (such as gray level co-

    occurrence matrices) to differentiate different types of white blood cells. Insana used textural

    features in ultrasound images to estimate tissue scattering parameters. They made significant

    use of the knowledge about the physics of the ultrasound imaging process and tissue

    characteristics to design the texture model. Chen used fractal texture features to classify

    ultrasound images of livers, and used the fractal texture features to do edge enhancement in

    chest X-rays.

    Lundervold used fractal texture features in combination with other features (such as response

    to edge detector operators) to analyze ultrasound images of the heart (see Figure 5.1). The

    ultrasound images in this study are time sequence images of the left ventricle of the heart.

    Figure 5.1 shows one frame in such a sequence. Texture is represented as an index at each

    pixel, being the local fractal dimension within an window estimated according to the fractal

    Brownian motion model proposed by Chen. The texture feature is used in addition to a

    number of other traditional features, including the response to a Kirsch edge operator, the

    gray level, and the result of temporal operations. The fractal dimension is expected to be

    higher on an average in blood than in tissue due to the noise and backscatter characteristics of

  • 7/28/2019 1s pagest

    45/55

    34

    the blood which is more disordered than that of solid tissue. In addition, the fractal dimension

    is low at non-random blood/tissue interfaces representing edge information.

    5.2.3. Document Processing

    One of the useful applications of machine vision and image analysis has been in the area of

    document image analysis and character recognition. Document processing has applications

    ranging from postal address recognition to analysis and interpretation of maps. In many postal

    document processing applications (such as the recognition of destination address and zip code

    information on envelopes), the first step is the ability to separate the regions in the image

    which contain useful information from the background. Most image analysis methodsproposed to date for document processing are based upon the characteristics of printed

    documents and try to take advantage of these properties. For example, generally newspaper

    print is organized in rectangular blocks and this fact is used. The processing of the ultrasound

    images of the heart using textural features.. Many methods work on images based on precise

    algorithms which one might consider as having morphological characteristics. For example,

    Wang and Srihari used projection profiles of the pixel values to identify large text blocks by

    detecting valleys in these profiles. Wahl used constrained run lengths and connected

    component analysis to detect blocks of text. Fletcher and Kasturi used the fact that most text

    blocks lie in a straight line, and utilized Hough transform techniques to detect collinear

    elements. Taxt view the identification of print in document images as a two-category

    classification problem, where the categories are print and background. They use various

    classification methods to compute the segmentation including contextual classification and

    relaxation algorithms. One can also use texture segmentation methods for preprocessing

    document images to identify regions of interest. An example of this can be seen in Figure.

    The texture segmentation algorithm described in was used to segment a newspaper image. In

    the resulting segmentation, one of the regions identified as having a uniform texture, which is

    different from its surrounding texture, is the bar code block. A similar method is used for

    locating text blocks in newspapers. A segmentation of the document image is obtained using

    three classes of textures: one class for the text regions, a second class for the uniform regions

    that form the background or images where intensities vary slowly, and a third class for the

    transition areas between the two types of regions.

  • 7/28/2019 1s pagest

    46/55

    35

    5.3. Texture Analysis

    Approaches to texture analysis are usually categorised into

    structural, statistical, model-based and transform methods.

    Structural approaches represent texture by well defined primitives (micro texture) and a

    hierarchy of spatial arrangements (macro texture) of those primitives. To describe the texture,one must define the primitives and the placement rules. The choice of a primitive (from a set

    of primitives) and the probability of the chosen primitive to be placed at a particular location

    can be a function of location or the primitives near the location. The advantage of the

    structural approach is that it provides a good symbolic description of the image; however, this

    feature is more useful for synthesis than analysis tasks. The abstract descriptions can be ill

    defined for natural textures because of the variability of both micro- and macrostructure and

    no clear distinction between them. A powerful tool for structural texture analysis is provided

    by mathematical morphology . It may prove to be useful for bone image analysis, e.g. for the

    detection of changes in bone microstructure.

    In contrast to structural methods, statistical approaches do not attempt to understand

    explicitly the hierarchical structure of the texture. Instead, they represent the texture indirectly

    by the non-deterministic properties that govern the distributions and relationships between the

    grey levels of an image. Methods based on second-order statistics (i.e. statistics given by pairs

    of pixels) have been shown to achieve higher discrimination rates than the power spectrum

    (transform-based) and structural methods. Human texture discrimination in terms of texture

    statistical properties is investigated Julesz. Accordingly, the textures in grey-level images are

    discriminated spontaneously only if they differ in second order moments. Equal second order

    moments, but different third-order moments require deliberate cognitive effort. This may be

    an indication that also for automatic processing, statistics up to the second order may be most

    important. The most popular second-order statistical features for texture analysis are derived

    from the so-called co-occurrence matrix. They were demonstrated to feature a potential for

    effective texture discrimination in biomedical-images. The approach based on

  • 7/28/2019 1s pagest

    47/55

    36

    multidimensional co-occurrence matrices was recently shown to outperform wavelet packets

    (a transform-based technique) when applied to texture classification.

    Model based texture analysis using fractal and stochastic models, attempt to interpret an

    image texture by use of, respectively, generative image model and stochastic model. The

    parameters of the model are estimated and then used for image analysis. In practice, the

    computational complexity arising in the estimation of stochastic model parameters is the

    primary problem. The fractal model has been shown to be useful for modelling some natural

    textures. It can be used also for texture analysis and- 3 - discrimination; however, it lacks

    orientation selectivity and is not suitable for describing local image structures.

    Transform methods of texture analysis, such as Fourier, Gabor represent an image in a spacewhose co-ordinate system has an interpretation that is closely related to the characteristics of a

    texture (such as frequency or size). Methods based on the Fourier transform perform poorly in

    practice, due to its lack of spatial localisation. Gabor filters provide means for better spatial

    localisation; however, their usefulness is limited in practice because there is usually no single

    filter resolution at which one can localise a spatial structure in natural textures. Compared

    with the Gabor transform, the wavelet transforms feature several advantages.

    Identifying the perceived qualities of texture in an image is an important first step towards

    building mathematical models for texture. The intensity variations in an image which

    characterize texture are generally due to some underlying physical variation in the scene (such

    as pebbles on a beach or waves in water). Modelling this physical variation is very difficult,

    so texture is usually characterized by the two-dimensional variations in the intensities present

    in the image. This explains the fact that no precise, general definition of texture exists in the

    computer vision literature. In spite of this, there are a number of intuitive properties of texture

    which are generally assumed to be true.

    5.3.1. Statistical Methods

    One of the defining qualities of texture is the spatial distribution of gray values. The use of

    statistical features is therefore one of the early methods proposed in the machine vision

    literature. In the following, we will use to denote an N X N

    image with G gray levels. A large number of texture features have been proposed. But, these

    features are not independent as pointed out by Tomita. The relationship between the various

    statistical texture measures and the input image is summarized in Fig.4.3. Picard has also

    related the gray level co-occurrence matrices to the Markov random field models.

  • 7/28/2019 1s pagest

    48/55

    37

    Figure 5.3

    Co-occurrence Matrices

    Spatial gray level co-occurrence estimates image properties related to second-order statistics.

    Haralick suggested the use of gray level co-occurrence matrices (GLCM) which have become

    one of the most well-known and widely used texture features. The G X G gray level co-

    occurrence matrix Pd for a displacement vector d= (dx,dy) is defined as follows. The entry (i,j)

    of Pd is the number of occurrences of the pair of gray levels i and j which are distance d apart.

    Formally given as,

    Pd( I, j) =|{((r, s),(t, v):I(r, s)=I, I(t,v)=j}|

    ` and |.| is the cardinality of a set.

    As an example, consider the following image containing 3 different gray values:

    1 1 0 0

    1 1 0 0

    0 0 2 2

    0 0 2 2

  • 7/28/2019 1s pagest

    49/55

    38

    The gray level co-occurrence matrix for this image for a displacement vector d= (1,0)

    is given as follows:

    4 0 2

    Pd= 2 2 0

    0 0 2

    Here the entry (0,0) of Pd is 4 because there are four pixel pairs (0,0) that are offset by

    amount. Examples of Pd for other displacement vectors is given below.

    Notice that the co-occurrence matrix so defined is not symmetric. But a symmetric

    cooccurrence matrix can be computed by the formula P = Pd+P-d . The co-occurrence matrix

    reveals certain properties about the spatial distribution of the gray levels in the texture image.

    For example, if most of the entries in the co-occurrence matrix are concentrated along the

    diagonals, then the texture is coarse with respect to the displacement vector d. Haralick has

    proposed a number of useful texture features that can be computed from the co-occurrence

    matrix. Table 1 lists some of these features.

    The co-occurrence matrix features suffer from a number of difficulties. There is no well

    established method of selecting the displacement vector and computing co-occurrence

    matrices for different values of is not feasible. For a given , a large number of features can be

    computed from the co-occurrence matrix. This means that some sort of feature

    selection method must be used to select the most relevant features. The co-occurrence

    matrix-based texture features have also been primarily used in texture classification tasks

    and not in segmentation tasksAutocorrelation Features

  • 7/28/2019 1s pagest

    50/55

    39

    An important property of many textures is the repetitive nature of the placement of texture

    elements in the image. The autocorrelation function of an image can be used to assess the

    amount of regularity as well as the fineness/coarseness of the texture present in the image.

    Formally, the autocorrelation function of an image is defined as follows:

    The image boundaries must be handled with special care but we omit the details here. This

    function is related to the size of the texture primitive (i.e., the fineness of the texture). If

    the texture is coarse, then the autocorrelation function will drop off slowly; otherwise, it

    will drop off very rapidly. For regular textures, the autocorrelation function will exhibit

    peaks and valleys.

    The autocorrelation function is also related to the power spectrum of the Fourier transform

    (see Figure). Consider the image function in the spatial domain I(x,y) and its Fourier

    Transform F(u,v) . The quantity |F(u,v)|2is defined as the power spectrum where|.| is

    the modulus of a complex number. The example in Figure 4.4 illustrates the effect of the

    directionality of a texture on the distribution of energy in the power spectrum. Early

    Table 5.1

  • 7/28/2019 1s pagest

    51/55

    40

    Figure 5.4

    Figure 5.5 Texture features computed from the power spectrum of the image

    approaches using such spectral features would divide the frequency domain into rings (for

    frequency content) and wedges (for orientation content) as shown in Figure 4.5. The

  • 7/28/2019 1s pagest

    52/55

    41

    frequency domain is thus divided into regions and the total energy in each of these regions is

    computed as texture features.

    5.3.2 Features and offsets used

    After you create the GLCMs, you can derive several statistics from them . These statistics

    provide information about the texture of an image. The following table lists the statistics.

    Offsets used are shown in the next figure 5.6

    Figure 5.6

  • 7/28/2019 1s pagest

    53/55

    42

    CHAPTER 6

    GRAPHICAL USER INTERFACE

    6.1 Introduction

    Agraphical user interface (GUI) is a human-computer interface (i.e., a way for humans tointeract with computers) that uses windows, icons and menus and which can be manipulated

    by a mouse and often to a limited extent by a keyboard as well.

    A window is a rectangular portion of the monitor screen that can display its contents (e.g.,

    a program, icons, a text file or an image) seemingly independently of the rest of the display

    screen. A major feature is the ability for multiple windows to be open simultaneously. Each

    window can display a different application, or each can display different files (e.g., text,image or spreadsheet files) that have been opened or created with a single application.

    An icon is a small picture or symbol in a GUI that represents a program , a file, a directory or

    a device (such as a hard disk or floppy). Icons are used both on the desktop and within

    application programs. Examples include small rectangles (to represent files), file folders (to

    represent directories), a trash can (to indicate a place to dispose of unwanted files and

    directories) and buttons on web browsers (for navigating to previous pages, for reloading the

    current page, etc.).

    Commands are issued in the GUI by using a mouse, trackball or touchpad to first move a

    pointer on the screen to, or on top of, the icon, menu item or window of interest in order

    toselectthat object. Then, for example, icons and windows can be moved

    by dragging(moving the mouse with the held down) and objects or programs can be opened

    by clicking on their icons.

    Advantages of GUIs

    A major advantage of GUIs is that they make computer operation more intuitive, and thus

    easier to learn and use. For example, it is much easier for a new user to move a file from one

    directory to another by dragging its icon with the mouse than by having to remember and type

    seemingly arcane commands to accomplish the same task.

    Adding to this intuitiveness of operation is the fact that GUIs generally provide users with

    immediate, visual feedback about the effect of each action. For example, when a user deletes

    an icon representing a file, the icon immediately disappears, confirming that the file has been

    deleted (or at least sent to the trash can). This contrasts with the situation for a CLI, in which

    the user types a delete command (inclusive of the name of the file to be deleted) but receives

    no automatic feedback indicating that the file has actually been removed.

    In addition, GUIs allow users to take full advantage of the powerful multitasking(the ability

    for multiple programs and/or multiple instances of single programs to run simultaneously)

    capabilities of modern operating systems by allowing such multiple programs and/orinstances to be displayed simultaneously. The result is a large increase in the flexibility of

    computer use and a consequent rise in user productivity.

  • 7/28/2019 1s pagest

    54/55

    43

    But the GUI has become much more than a mere convenience. It has also become the

    standard in human-computer interaction, and it has influenced the work of a generation of

    computer users. Moreover, it has led to the development of new types of applications and

    entire new industries. An example is desktop publishing, which has revolutionized (and partlywiped out) the traditional printing and typesetting industry.

    6.2 History

    The origin of the GUI can be traced back to Vannevar Bush, a scientist and futurist who

    worked at the Massachusetts Institute of Technology (MIT) during World War II. In his now

    classic 1945 magazine articleAs We May Think, Bush proposed an information

    administration tool, the Memex , that would allow data to be stored on microfilm and made

    easily accessible, linkable with hyperlinks and programmable.

    In 1963 Ivan Sutherland, a graduate student at MIT, developed a program for his Ph.D.

    dissertation called Sketchpad, which allowed the direct manipulation of graphic objects on a

    CRT screen using a light pen. His concept included the capability to zoom in and out on the

    display, the provision of memory for storing objects and the ability to draw precision lines

    and corners on the screen.

    Much additional progress occurred at Xerox Palo Alto Research Center (PARC), which Xerox

    Corporation established in 1970 in Palo Alto, California for the purpose of creating "the

    architecture of information" and "humanizing computers." This included developing the first

    usable GUI, which was incorporated into PARC'sAlto computer.

    Steve Jobs, the co-founder of Apple Computer, was heavily inspired by the innovations at

    nearby PARC, and he thus decided to incorporate a GUI into his company's computers. Apple

    considerably extended PARC's work, including developing overlapping windows,

    manipulable icons, a fixed menu bar, dropdown menus and a trash can. The Apple Macintosh,

    launched in 1984, was the first commercially successful use of a GUI. It was so successful, in

    fact, that the GUI was subsequently adopted by most other developers of operating systems

    and application software, and it is now used on (or at least available for) virtually all types of

    computers.

    Microsoft announced development of its first operating system that incorporated a GUI in

    November 1983, and the initial version, Windows 1.0, was released in November 1985.Windows 2.0, released in December 1987, represented a major improvement over the

    primitive Windows 1.0 with its addition of icons and overlapping windows, but it was not

    until 1995 with the launching of Windows 95 that Microsoft was able to offer a relatively

    high quality GUI.

    The Future

    One of the most interesting areas of exploration is GUIs that provide the user with the illusion

    of navigating through a three-dimensional space. Another area of research is increasing user

    control over GUI objects, such as being able to rotate and freely change the size and

    transparency of icons. Also being studied is the increased use of natural languages to interactwith computers as a supplement or complement to GUIs.

  • 7/28/2019 1s pagest

    55/55

    6.3 Image Search GUI

    The GUI of this project deals with the formation of a user friendly window that allows him to

    effectively search the database and extract the required images out of it. For this pupose it has

    several keys and buttons which are to be discussed next.

    ALGORITHM 1-GUI

    Step 1- The user has to give the complete URL of the query image.

    Step-2 The program then requires the range of averages and standard deviations that are

    tolerable for the user. This can be input through the edit text windows provided in GUI.

    Step-3 The user can then press the button search for starting the database search.

    Step-4 User has another option of whether to display the images or store them in a particular

    folder location.

    ALGORITHM 2-GUI

    Step 1- The user has to provide the percentage of different color intansities in the required

    image as query.

    Step-2 The program requires the percentages in the edit boxes created especially for this

    purposes.eg-Provide red intensity in R box.

    Step-3 The user can then press the button search for starting the database search.

    Step-4 User has another option of whether to display the images or store them in a particular

    folder location.