sbir
DESCRIPTION
Sketch Based Image RetrievalTRANSCRIPT
-
B.Tech Project Report
SKETCH4MATCH-CONTENT BASED IMAGE
RETRIEVAL
Submitted in partial fulfilment for the award of the Degree of
Bachelor of Technology in Information Technology
Submitted by
Ms. GEETHU P T (Roll No. 14112413)
Ms. HAFSA HASSAN (Roll No. 14112414)
Ms. HONEY MERRIN SAM (Roll No. 14112415)
Ms. SHIBIJA K (Roll No. 14112419)
Under the guidance of
Mrs. Shahanaz N
Department of Information Technology
CO-OPERATIVE INSTITUTE OF TECHNOLOGY, VATAKARA
(Engineering College under CAPE, Estd by Govt. of Kerala)
APRIL 2014
-
CERTIFICATE
This is to certify that the project entitled SKETCH BASED IMAGE
RETRIEVAL is the bonafide record of the major project done by Ms.
GEETHU P T (Roll no.14112413), Ms. HAFSA HASSAN (Roll
no.14112414), Ms. HONEY MERRIN SAM (Roll no.14112415), Ms.
SHIBIJA K (Roll no.14112426) under my supervision and guidance, in
partial fulfilment for the award of Degree of Bachelor of Technology in
Information Technology from Cochin University of Science And
Technology for the year 2014.
Mrs. SHAHANAZ N
(Guide)
Asst. Professor
Department of Information Technology
Mrs. NITHYA A.K.
Professor and Head
Department of Information Technology
-
ACKNOWLEDGEMENT
First and foremost, we wish to place on records our ardent and earnest gratitude to our
beloved principal Dr. O A JOSEPH.
It is a matter of great pleasure for us to express our sincere gratitude and appreciation
to our beloved project guide Mrs. SHAHANAZ N, Assistant Professor, Dept. of
Information Technology. Her tutelage and guidance was the leading factor in
translating our efforts to fruition. Her prudent and perspective vision has shown light
on our trail to triumph.
We are extremely happy to mention a great word of gratitude to Mrs. NITHYA
A.K., Head of the Department of Dept. of Information Technology for providing us
with all facilities for the completion of this work.
Finally yet importantly, we would like to express our gratitude to our project
coordinator Mr. SIDHIK A for his valuable assistance provided during the course of
the project.
We would also extend our gratefulness to all the staff members in the Department.
We are also thankful to our friends and well wishers for sharing their knowledge and
suggestion.
GEETHU P T
HAFSA HASSAN
HONEY MERRIN SAM
SHIBIJA K
-
ABSTRACT
The content based image retrieval (CBIR) is one of the most popular, rising research
areas of the digital image processing. Most of the available image search tools, such
as Google images and Yahoo! Image search, are based on textual annotation of
images. In these tools, images are manually annotated with key words and then
retrieved using text-based search methods. The performances of these systems are not
satisfactory.
The goal of CBIR is to extract visual content of an image automatically, like color,
texture, or shape.
This project aims to introduce the problems and challenges concerned with the design
and the creation of CBIR systems, which is based on a free hand sketch (sketch based
image retrieval-SBIR). With the help of the existing method, describe a possible
solution how to design and implement a task specific descriptor, which can handle the
information gap between a sketch and a colored image, making an opportunity for the
efficient search hereby. The used descriptor constructed after such special sequence of
preprocessing steps that the transformed full colored image and the sketch can be
compared.
The SBIR technology can be used in several applications such as digital libraries,
crime prevention, and photo sharing sites.
-
i
CONTENTS
Chapter No TITLE Page No
List of Abbreviations v
List of Figures vi
1 INTRODUCTION 1
1.1 General 1
1.1.1 The Definition of Image 2
1.1.2 Image Processing 2
1.1.3 Image Retrieval and Information Retrieval 3
1.2 Content Based Image Retrieval 4
1.3 Content Based Image Retrieval Using Color 5
1.4 Existing System 7
1.4.1 Automatic Image Annotation and
Retrieval using Cross Media
Relevance Models 7
1.4.2 Concept Based Query Expansion 8
1.4.3 Query System Bridging the Semantic Gap
For Large Image Databases 8
1.4.4 Ontology Based Query Expansion Widget
For Information Retrieval 9
1.4.5 Detecting Image Purpose in World-Wide
Web Documents 9
1.4 Proposed System 9
-
ii
1.5 Objective 10
1.6 Applications 10
1.7 Literature Survey 11
1.8 Research Challenges 12
2 PROJECT DESCRIPTION 13
2.1 Introduction 13
2.2 Main Modules 13
2.2.1 Index 13
2.2.2 The K-means Algorithm 14
2.2.3 Searching 15
2.3 Performance Matrices 16
3 REQUIREMENT ENGINEERING 17
3.1 Hardware Requirements 17
3.2 Software Requirements 17
3.3 Functional Requirements 18
3.4 Non-Functional Requirements 18
4 ALGORITHMS DESCRIPTION 19
4.1 Color Layout 19
4.2 Color Spaces 19
4.2.1 RGB 19
4.2.2 HSB 20
4.3 Histograms 20
4.3.1 Cumulative Color Histogram 20
4.3.2 Color Set 20
4.3.3 Color Descriptor 21
4.3.4 Edge Histogram 21
-
iii
4.3.5 Dominant Color Descriptor 22
4.3.6 HSV Color Model 22
4.3.7 Color Co-occurrence Matrix 23
5 TESTING 24
5.1 Introduction 24
5.2 Implementation 24
5.3 Testing 25
5.3.1 System Testing 25
5.3.2 Module Testing 25
5.3.3 Integration Testing 26
5.3.4 Acceptance Testing 26
6 SYSTEM DESIGN 27
6.1 Activity Diagram 27
6.2 Use Case Diagram 29
6.3 Data Flow Diagram 30
6.4 Sequence Diagram 31
7 GLOBAL STRUCTURE AND SUBSYSTEM 33
7.1 Global Structure of a System 33
8 DEVELOPMENT TOOLS 35
8.1 General 35
8.2 Features of JAVA 35
8.2.1 The JAVA Framework 35
8.2.2 Objectives of JAVA 36
9 IMPLEMENTAION 38
9.1 General 38
9.2 Implementation of SBIR System 38
-
iv
9.2.1 Image Comparison 38
10 SNAPSHOTS 46
11 CONCLUSION 51
12 FUTURE ENHANCEMENT 52
13 REFERENCES 53
-
v
List of Abbreviations
CBIR - Content Based Image Retrieval
RF - Relevance Feedback
SBIR - Sketch Based Image Retrieval
QBIC - Query By Image Content
SVM - Support Vector Machine
JVM - Java Virtual Machine
GUI - Graphical User Interface
AWT - Abstract Window Toolkit
SWT - Standard Widget Toolkit
PWT - Pyramidal Wavelet Transform
HSV - Hue, Saturation, Value
GCH - Global Color histogram
LCH - Local Color Histogram
RGB - Red, Green, Blue
JPEG - Joint Photographic Expert Group
-
vi
List of Figures
Figure No TITLE Page No
2.1 Working of SBIR system 15
4.1 Five types of Edge Histogram 22
4.2 SBIR using HSV Color Model 23
6.1 Activity Diagram 28
6.2 Use Case Diagram of Admin 29
6.3 Use Case Diagram of User 30
6.4 Data Flow Diagram 31
6.5 Sequence Diagram 32
7.1 Same Image of Different Contrast 33
7.2 Global Structure of System 34
7.3 System for Database containing Simple Images 34
10.1 Login Frame 46
10.2 Admin Home 47
10.3 Add Image 47
10.4 View Image 48
10.5 Delete Image 48
10.6 User Home_1 49
10.7 User Home_2 49
10.8 Paint with Off-Screen Canvas 50
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
1
CHAPTER 1
INTRODUCTION
1.1 GENERAL
The Sketch Based Image Retrieval (SBIR) is one of the most popular, rising
research areas of the digital image processing. Most of the available image
search tools, such as Google Images and Yahoo! Image search, are based on
textual annotation of images. In these tools, images are manually annotated
with keywords and then retrieved using text-based search methods. The
performances of these systems are not satisfactory. The goal of SBIR is to
extract visual content of an image automatically, like color, texture, or shape.
This paper aims to introduce the problems and challenges concerned with the
design and the creation of SBIR systems, which is based on a free hand sketch.
With the help of the existing methods, describe a possible solution how to
design and implement a task specific descriptor, which can handle the
informational gap between a sketch and a colored image, making an
opportunity for the efficient search hereby. The used descriptor is constructed
after such special sequence of preprocessing steps that the transformed full
color image and the sketch can be compared. Experimental results on two
sample databases showed good results. Overall, the results show that the
sketch based system allows users an intuitive access to search-tools. The SBIR
technology can be used in several applications such as digital libraries, crime
prevention, and photo sharing sites. Such a system has great value in
apprehending suspects and identifying victims in forensics and law
enforcement. A possible application is matching a forensic sketch to a gallery
of mug shot images. The area of retrieve images
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
2
based on the visual content of the query picture intensified recently, which
demands on the quite wide methodology spectrum on the area of the image
processing. The CBIR systems have a big significance in the criminal
investigation. The identification of unsubstantial images, tattoos and graffitis
can be supported by these systems. Similar applications are implemented.
Another possible application area of sketch based information retrieval is the
searching of analog circuit graphs from a big database. A possible matching a
forensic sketch to gallery of mug shot images. The area of retrieve images
based on the visual content of the query picture intensified recently, which
demands on the quite wide methodology spectrum on the area of the image
processing.
1.1.1 DEFINITION OF IMAGE
Data represents a two-dimensional scene. A digital image is composed of
pixels arranged in a rectangular array with a certain height and width. Each
pixel may consist of one or more bits of information, representing the
brightness of the image at that point and possibly including color information
encoded as RGB triples. Picture a visual representation (of an object or scene
or person or abstraction) produced on a surface, "they showed us the pictures
of their wedding" a movie is a series of images projected so rapidly that the
eye integrates them.
Effective indexing and retrieving desired image in large image database in the
basis of features such as color, text and shape can be automatically extracted
from the images themselves.
1.1.2 IMAGE PROCESSING
The analysis of a picture using techniques can identify shades, colors and
relationships that cannot be perceived by the human eye. Image processing is
used to solve identification problems, such as in forensic medicine or in
creating weather maps from satellite pictures. It deals with images in
bitmapped graphics format that have been scanned in or captured with digital
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
3
cameras. Any image improvement, such as refining a picture in a paint
program that has been scanned or entered from a video source.
1.1.3 IMAGE RETRIEVAL AND INFORMATION RETRIEVAL
Since the 1970s Image Retrieval has become a very active research topic, with
two major research communities, database management and computer vision.
One is text-based and another is visual-based. Text-based image retrieval has
become very popular since 1970s, which involves annotating the image with
keywords, and use text-based database management systems (DBMS) to
retrieve the images. In text-based image retrieval system, keywords of
semantic information are attached to the images.
They can be typed manually or by extracting the captions of the images. It is
very efficient for simple and small image databases, since the whole database
can be described by just few hundreds of keywords. But in the 1990s, several
large leaps in development of processor, memory and storage made the size of
image databases grow dramatically. As the image database and image size
grow, there will be more images having different contents and the images
having rich contents cannot be described by only several Semantic keywords.
The demand of labor on annotating the images also rises dramatically.
Retrieval image provides effective and efficient tool querying large image
database. Information retrieval provides the textual representation of images.
It requires the text descriptions to the respective images.
Recent technology development in various fields has made large digital image
databases practical. Well organized database and efficient browsing, storing,
and retrieval algorithms are very important in such systems. Image retrieval
techniques were developed to aid these components.
Image Retrieval was originated from Information Retrieval, which has been
very active research topic since 1940s. We have huge amounts of information
to which accurate and speedy access is becoming ever more difficult. In
principle, Information Retrieval is simple. It can be illustrated by a scene of a
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
4
store of documents and a person (user of the store). He formulates a question
to which the answer is a set of documents satisfying his question. He can
obtain the set by reading all the documents in the store, retaining the relevant
documents and discarding all the others. In this scene, it is a perfect retrieval.
But in practice, we need to model the read process in both syntactic and
semantic to extract useful information. The target of Information Retrieval is
not only how to extract useful information, but also how to measure
relevance among documents. These challenges also exist in Image Retrieval.
Also the keywords are very dependent on the observers interest and they are
subjective. Captions are not always precisely describing the picture.
Indexing and searching a large image database via keywords are time-
consuming and inefficient. Content Based Image Retrieval (CBIR) researches
attempt to automate such complex process of retrieving images that are similar
to the reference image or descriptions given.
1.2 CONTENT BASED IMAGE RETRIEVAL
Content-based image retrieval also known as query by image content and
content-based visual information retrieval problem of searching for digital
images in large database. Content-based means that the search will analyze the
actual contents of image. The term content in this context might refer to
colors, shapes, textures or any other information that can be derived from the
image itself.
The earliest use of the term Content Based Image Retrieval in the literature
seems to be by Kato, was to describe his experiments in automatic retrieval of
images from a database by color and shape features. The term has since been
widely used to describe the process of retrieving desired images from a large
collection on the basis of features (such as color,Texture and shape) that can
be automatically extracted from the images themselves. The features used for
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
5
retrieval can be either primitive or semantic, but the extraction process must
be predominantly automatic.
The ideal approach of querying an image database is using content semantics,
which applies the human understanding about image. Unfortunately,
extracting the semantic information in an image efficiently and accurately is
still a question. Even with the most advanced implementation of computer
vision, it is still not easy to identify an image of horses on a road. So, using
low level features instead of semantics is still a more practical way. Until
semantic extraction can be done automatically and accurately, image retrieval
systems cannot be expected to find all correct images. They should select the
most similar images to let the user choose the desired images. The number of
images of retrieved set can be reduced by applying similarity measure that
measures the perceptual similarity.
A typical CBIR system consists of three major components and the variations
of them depend on features used.
i. Feature extraction Analyze raw image data to extract feature specific
information.
ii. Feature storage Provide efficient storage for the extracted
information, also help to improve searching speed.
iii. Similarity measure Measure the difference between images for
determining the relevance between images.
1.3 CONTENT BASED IMAGE RETRIEVAL USING COLOR
Retrieving image based on color similarity is achieved by computing a color
histogram for each image that identifies the proportion of pixels within an
image holding specific values. Current research is attempting to segment color
proportion by region and by spatial relationship among several color region.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
6
Among different types of low level features, color is the most straightforward
information which can be easily retrieved from digital images with simple and
compact description, while others require more pre-processing and
computational tasks such as pattern recognition or texture analysis.
While comparing image by color feature, three properties are usually
considered:
i. Area of matching Count the area or number of pixels having same or
similar colors. Larger matched area means more similar.
ii. Color distance Distance between colors, usually in a perceptually
uniform color space. Closer between matched colors means more
similar.
iii. Spatial distribution Usually used while combining color with other
features such as texture and shape.
In a typical color similarity measure, area of matching is usually counted as
the similarity color distance is used to control the matching between colors
and to adjust the similarity. In conventional color image retrieval system, the
most straight forward approach is using color histogram. Histograms of each
color, for example, images of 256 colors, will be generated. Similarities
between such images are then performed and measured by Histogram
Intersection Method (HIM). This is the basic approach and can give simple
and efficient representation of color distribution. Histogram approach is not
limited by taking the number of pixels of each color in the image or using
HIM similarity measure. Indexes of histograms can represent many types of
features such as colors in different color space, coefficients in transformed
domain or spatial-related information. There are also many variations in
comparing histograms. But histograms have a limitation that the feature space
is fixed, compactness of the description is limited, because histograms will not
skip non-existed colors. One argument that we can use a lower resolution
histogram to improve the compactness but it is a trade off between
compactness and accuracy.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
7
1.4 EXISTING SYSTEM
In earlier days, image retrieving from large image database can be done by
following ways. We will discuss briefly about the image retrieving of various
steps
Automatic Image Annotation and Retrieval using Cross Media
Relevance Models
Concept Based Query Expansion
Query System Bridging The Semantic Gap For Large Image Databases
Ontology-Based Query Expansion Widget for information Retrieval
Detecting image purpose in World-Wide Web documents
Existing system uses a keyword to search an image. Suppose we have to
search for an image of an apple, keyword should be apple and images
related to apple will be displayed accordingly. These images are stored in a
database and are displayed according to the keywords.
1.4.1 Automatic Image Annotation and Retrieval using Cross Media
Relevance Models
Libraries have traditionally used manual image annotation for indexing and
then later retrieving their image collections. However, manual image
annotation is an expensive and labor intensive procedure and hence there has
been great interest in coming up with automatic ways to retrieve images based
on content. Here, we propose an automatic approach to annotating and
retrieving images based on a training set of images.
We assume that regions in an image can be described using a small vocabulary
of blobs. Blobs are generated from image features using clustering. Given a
training set of images with annotations, we show that probabilistic models
allow us to predict the probability of generating a word given the blobs in an
image. This may be used to automatically annotate and retrieve images given a
word as a query. We show that relevance models. Allow us to derive these
probabilities in a natural way. Experiments show that the annotation
performance of this cross-media relevance model is almost six times as good
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
8
(in terms of mean precision) than a model based on word-blob co-occurrence
model and twice as good as a state of the art model derived from machine
translation. Our approach shows the usefulness of using formal information
retrieval models for the task of image annotation and retrieval.
1.4.2 Concept Based Query Expansion
Query expansion methods have been studied for a long time - with debatable
success in many instances. In this project we present a probabilistic query
expansion model based on a similarity thesaurus which was constructed
automatically. A similarity thesaurus reflects domain knowledge about the
particular collection from which it is constructed. We address the two
important issues with query expansion: the selection and the weighting of
additional search terms. In contrast to earlier methods, our queries are
expanded by adding those terms that are most similar to the concept of the
query, rather than selecting terms that are similar to the query terms.
Our experiments show that this kind of query expansion results in a notable
improvement in the retrieval effectiveness when measured using both recall-
precision and usefulness.
1.4.3 Query System Bridging The Semantic Gap For Large Image
Databases
We propose a novel system called HISA for organizing very large image
databases. HISA implements the first known data structure to capture both the
ontological knowledge and visual features for effective and efficient retrieval
of images by either keywords, image examples, or both. HISA employs
automatic image annotation technique, ontology analysis and statistical
analysis of domain knowledge to precompiled the data structure [7]. Using
these techniques, HISA is able to bridge the gap between the image semantics
and the visual features, therefore providing more user-friendly and high
performance queries. We demonstrate the novel data structure employed by
HISA, the query algorithms, and the pre-computation process.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
9
1.4.4 Ontology-Based Query Expansion Widget for information
Retrieval
In this project we present an ontology-based query expansion widget which
utilizes the ontology published in the ONKI Ontology Service. The widget can
be integrated into a web page, e.g. a search system of a museum catalogue,
enhancing the page by providing query expansion functionality. We have
tested the system with general, domain specific and spatiotemporal ontology.
1.4.5 Detecting image purpose in World-Wide Web documents
The number of World-Wide Web (WWW) documents available to users of the
Internet is growing at an incredible rate. Therefore, it is becoming increasingly
important to develop systems that aid users in searching, altering, and
retrieving information from the Internet. Currently, only a few prototype
systems catalog and index images in Web documents. To greatly improve the
cataloging and indexing of images on the Web, we have developed a prototype
rule-based system that detects the content images in Web documents. Content
images are images that are associated with the main content of Web
documents, as opposed to a multitude of other images that exist in Web
documents for different purposes, such as decorative, advertisement and logo
images. We present a system that uses decision tree learning for automated
rule induction for the content image detection system. The system uses visual
features, text-related features and the document context of images in concert
for fast and effective content image detection in Web documents.
1.4 PROPOSED SYSTEM
Relevance feedback is an interactive process that starts with normal SBIR. The
user input a query, and then the system extracts the image feature and measure
the distance with images in the database. An initial retrieval list is then
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
10
generated. User can choose the relevant image to further refine the query, and
this process can be iterated many times until the user find the desired images.
In many cases if we want to search efficiently some data have to be recalled.
The human is able to recall visual information more easily using for example
the shape of an object, or arrangement of colors and objects. Since human are
visual type, we look for images using other images, and follow this approach
also at the categorizing. In this case we search using some features of images,
and these features are the keywords. Our purpose is to develop a content based
image retrieval system, which can retrieve using sketches in frequently used
databases.
1.5 OBJECTIVE
The goal of SBIR is to extract visual content of an image automatically, like
color, texture, or shape. This project aims to introduce the problems and
challenges concerned with the design and the creation of SBIR systems, which
is based on a free Database oriented Image retrieval System. With the help of
the existing methods, describe a possible solution how to design and
implement a task specific descriptor, which can handle the informational gap
between a source and images in a Database, making an opportunity for the
efficient search hereby.
1.6 APPLICATIONS
Image Database Search System.
Online Search Engines.
Hospital Database Retrieval Systems.
Police Information Database Search Systems.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
11
1.7 LITERATURE SURVEY
SBIR systems are based on a free hand sketch. With the help of the existing
methods, describe possible solution how to design and implement a task
spastic descriptor, which can handle the informational gap between a sketch
and a colored image, making an opportunity for the efficient search hereby.
The used descriptor is constructed after such special sequence of
preprocessing steps that the transformed full color image and the sketch can be
compared. Experimental results on two sample databases showed good results.
Overall, the results show that the sketch based system allows users an intuitive
access to search-tools.
Our purpose is to develop a content based image retrieval system, which can
retrieve using sketches in frequently used databases. The user has a drawing
area where he can draw those sketches, which are the base of the retrieval
method. Using a sketch based system can be very important and efficient in
many areas of the life. In some cases we can recall our minds with the help of
gores or drawing.
In these systems the user draws color sketches and blobs on the drawing area.
The images were divided into grids, and the color and texture features were
determined in these grids. The applications of grids were also used in other
algorithms, for example in the edge histogram descriptor (EHD) method. The
disadvantage of these methods is that they are not invariant opposite rotation,
scaling and translation. Lately the development of difficult and robust
descriptors was emphasized. Another research approach is the application of
fuzzy logic or neural networks. In these cases the purpose of the investment is
the determination of suitable weights of image features
The SBIR technology can be used in several applications such as digital
libraries, crime prevention, and photo sharing sites. Such a system has great
value in apprehending suspects and indentifying victims in forensics and law
enforcement. A possible application is matching a forensic sketch to a gallery
of mug shot images. The area of retrieve images based on the visual content of
the query picture intensive recently, which demands on the quite wide
methodology spectrum on the area of the image processing.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
12
1.8 RESEARCH CHALLENGES
The implementation of SBIR systems raises several research challenges. Some
of these are:
Investigating new user interfaces for annotating, browsing, and
searching based on image content.
New tools for marking/annotating images (and their regions)
Matching query and stored images in a way that reflects human
similarity judgments
Providing compact storage for large image databases
Efficiently accessing stored images by content
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
13
CHAPTER 2
PROJECT DESCRIPTION
2.1 INTRODUCTION
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 techniques to the image retrieval problem, that is, the problem of
searching for digital images in large database. Content based image retrieval is
opposed to concept based approaches.
"Content-based" means that the search will analyze the actual contents of the image
rather than the metadata such as keywords, tags, and/or descriptions associated with
the image. The term 'content' in this context might refer to colors, shapes, textures, or
any other information that can be derived from the image itself. CBIR is desirable
because most web based image search engines rely purely on metadata and this
produces a lot of garbage in the results. Also having humans manually enter keywords
for images in a large database can be inefficient, expensive and may not capture every
keyword that describes the image. Thus a system that can filter images based on their
content would provide better indexing and return more accurate results.
2.2 MAIN MODULES
2.2.1 Indexing
Indexing the whole set of images using K-means Clustering algorithm. Indexing is
done using an implementation of the Document Builder Interface. A simple approach
is to use the Document Builder Factory, which creates Document Builder instances
for all available features as well as popular combinations of features In a content
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
14
based image retrieval system, target images are sorted by feature similarities with
respect to the query (CBIR).In this indexing, we propose to use K-means clustering
for the classification of feature set obtained from the histogram. Histogram provides a
set of features for proposed for Content Based Image Retrieval (CBIR). Hence
histogram method further refines the histogram by splitting the pixels in a given
bucket into several classes. Here we compute the similarity for 8 bins and similarity
for 16 bins. Standard histograms, because of their efficiency and insensitivity to small
changes, are widely used for content based image retrieval. But the main disadvantage
of histograms is that many images of different appearances can have similar
histograms because histograms provide coarse characterization of an image.
The k-means algorithm takes the input parameter, k, and partitions a set of n objects
into k clusters so that the resulting intra cluster similarity is high but the inter cluster
similarity is low. Cluster similarity is measured in regard to the mean value of the
objects in a cluster, which can be viewed as the clusters center of gravity. How does
the k-means algorithm work?
The k-means algorithm proceeds as follows. First, it randomly selects k of the objects,
each of which initially represents a cluster mean or center. For each of the remaining
objects, an object is assigned to the cluster to which it is the most similar, based on
the distance between the object and the cluster mean. It then computes the new mean
for each cluster.
2.2.2 The k-means algorithm
Algorithm: k-means. The k-means algorithm for partitioning based on the mean
value of the objects in the cluster.
Input: The number of clusters k and a database containing n objects.
Output: A set of k clusters that minimizes the squared-error criterion.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
15
Method:
(1) Arbitrarily choose k objects as the initial cluster centers:
(2) Repeat
(3) (Re) assign each object to the cluster to which the object is the most similar, based
on the mean value of the objects in the cluster;
(4) Update the cluster means, i.e., calculate the mean value of the objects for each
cluster;
(5) Until no change.
2.2.3 Searching
This module performs intensive searching of images from the database. User gives his
query image and based on various algorithms a set of images are generated. The query
is taken up and according to the algorithm given a set of related images is generated.
This module searches for the images in the database according to the specified
algorithm. To generate more relevant images, the number of search images can be
decreased. Now if the user is not satisfied by the images generated, he/she can
perform the search test again and again, until it generates the desired image.
Fig 2.1 Working of the SBIR System
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
16
2.3 PERFORMANCE MATRICES
SBIR is essentially an information retrieval problem. Two of the most popular
evaluation measures are the,
PRECISION
The precision measures the proportion of the total images retrieved
which are relevant to the query. High precision means that less irrelevant images are returned or more relevant images are retrieved.
Precision = Number of relevant images retrieved
Total retrieved
RECALL
The recall measure is defined as the fraction of the all relevant images.
High recall indicates that few relevant images are missed
Recall = Total number of relevant images
Number of relevant images retrieved
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
17
CHAPTER 3
REQUIREMENT ENGINEERING
The current technology and upgraded system devices offer a significant improvement
over the previous situation in labs where much effort was devoted to setting up the
software necessary for course activities. The hardware and softwares involved in the
project are briefly summarized below.
3.1 HARDWARE REQUIREMENTS
The hardware requirements may serve as the basis for a contract for the
implementation of the system and should therefore be a complete and consistent
specification of the whole system. They are used by software engineers as the starting
point for the system design. It should what the system do and not how it should be
implemented.
PROCESSOR: PENTIUM IV 2.6 GHz, Intel Core 2 Duo.
RAM: 512 MB DD RAM
MONITOR: 15 COLOR
HARD DISK: 40 GB
INTERNET: HIGH SPEED MODEM
KEYBOARD: STANDARD 102 KEYS
3.2 SOFTWARE REQUIREMENTS
The software requirements document is the specification of the system. It should
include both a definition and a specification of requirements. It is a set of what the
system should do rather than how it should do it. The software requirements provide a
basis for creating the software requirements specification. It is useful in estimating
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
18
cost, planning team activities, performing tasks and tracking the teams and tracking
the teams progress throughout the development activity.
OPERATING SYSTEM: Windows 7
LANGUAGE: JAVA / J2EE
FRAMEWORK: Java
DATABASE: mysql
TOOL USED: NetBeans IDE 7.0.1
3.3 FUNCTIONAL REQUIREMENTS
User can give his own choices. SBIR system allows users to select number of images
that has to be searched. The number of images can be altered by the user till he/she
doesnt get the correct image.
3.4 NON-FUNCTIONAL REQUIREMENTS
Secure access of confidential data (users details). SSL can be used. Also availability
has to be proper. Better component design to get better performance at peak time. And
flexible service based architecture will be highly desirable for future extension.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
19
CHAPTER 4
ALGORITHMS DESCRIPITION
The main algorithms used to refrain the searching methodology are described below.
4.1 COLOR LAYOUT
Color is one of the most widely used features in image retrieval. It is robust to
background complication and invariant of image size and Orientation. As stated, three
major properties of color image similarity are usually considered
Area of Matching
Color Distance
Spatial Distribution
Area of matching is most commonly used because its idea is very clear and it can be
represented accurately by histograms. In most histogram representations, histogram
entries lay on the selected color space
4.2 COLOR SPACES
There are many color spaces designed for different systems and standards, but most of
them can be converted by a simple transformation. The color specifications will
display images on basis of their texture, background and many other criterias.
4.2.1 RGB (Red-Green-Blue)
Digital images are normally represented in RGB color space; it is the most commonly
use color space in computers. It is a device dependent color space, which used in CRT
monitors.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
20
4.2.2 HSB (Hue Saturation Brightness)
It was used to model the properties of human perception. However it is inconvenient
to calculate color distance due to its discontinuity of hue at 360.
4.3 HISTOGRAMS
In color based image retrieval, histogram is the most commonly used representation
for color features. Statistically, it utilizes a property that images having similar
contents should have a similar color distribution.
However, histograms are not limited by describing the area of each color. The entries
of the histogram can also represent other features. For instant, texture features can be
represented by histograms formed by coefficients in transformed domain and the
value of each histogram entry represents the intensity of each coefficient.
4.3.1 Cumulative Color Histogram
As an alternative consideration that most color histograms are very sparse and
sensitive to noise and global color shifting, proposed using the cumulative color
histogram. It solved shortcomings of simple histogram with histogram intersection
since cumulative histogram does not have shifting problem.
4.3.2 Color Sets
To facilitate fast searching over large-scale image collections and improving the
compactness of the histogram, Smith and Chang proposed color sets as an
approximation to the color histograms. They first transformed the RGB color space
into a perceptually uniform space, such as CIE, and then quantized the transformed
color space into M bins. A color set is defined as a selection of colors from the
quantized color space.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
21
4.3.3 Color Descriptor
Color is the most distinguishing visual features in image and video retrieval. It is
robust to changes in the background colors and is independent of image size and
orientation. Many forms of color distributions and representations are adopted in
JPEG, including some color-spatial descriptors such as Color Layout, Color Structure,
and some color quantization based descriptors such as Scalable Color and Dominant
Color.
4.3.4 Edge Histograms
The EHD represents the spatial distribution of edges in an image. The extraction
process of the EHD consists of the following stages:
The image array is divided into 4x4 sub images.
Each sub image is further partitioned into non-overlapping square image
blocks whose size depends on the resolution of the input image.
The edges in each image-block are categorized into one of the following six
types: vertical, horizontal, 45 diagonal, 135 diagonal, non-directional edge
and no-edge.
Now a 5-bin edge histogram of each sub image can be obtained.
Each bin value is normalized by the total number of image-blocks in the sub
image.
The normalized bin values are nonlinearly quantized. There are five types of
edge histogram:
Vertical edge
Horizontal edge
45 degree edge
135 degree edge
Non-directional edge
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
22
Fig 4.1 Five Types of Edge Histogram
Fig a shows vertical edge of histogram, fig b shows the horizontal edge of histogram,
fig c shows the degree edge of the histogram, fig d shows the 135 degree edge of
histogram and fig e shows the non-directional edge of histogram.
4.3.5 Dominant Color Descriptor (DCD)
DCD is a compact color descriptor, designed for small storage and high speed
retrieval. Image feature is formed by a small number of representative colors. These
colors are normally obtained by using clustering and color quantization. The
descriptor consists of the representative colors, their percentages in a region, spatial
coherency of the color, and color variance.
4.3.6 HSV Color Model
HSV color model stands for Hue Saturation Value colour model. This model
describes colors in terms of their shades and brightness (Luminance). This model
offers a more intuitive representation of relationship between colours.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
23
4.3.7 Color Co-occurrence Matrix (CCM)
A co-occurrence matrix is a matrix that is defined over an image to be the distribution
of co-occurring values at a given offset. Value of an image is originally the grey scale
value of a specified pixel. The co-occurrence matrix is mainly used to measure the
texture of the image and hence it is used for texture analysis. The CCM for each pixel
of an image is found using the Hue Saturation Value (HSV) of the pixel and then
compared with CCM of the images in the database and the images are retrieved
Fig 4.2 SBIR using HSV Color Model
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
24
CHAPTER 5
TESTING
5.1 INTRODUCTION
Implementation is one of the most important tasks in project is the phase in which one
has to be cautions because all the efforts undertaken during the project will be very
interactive. Implementation is the most crucial stage in achieving successful system
and giving the users confidence that the new system is workable and effective. Each
program is tested individually at the time of development using the sample data and
has verified that these programs link together in the way specified in the program
specification. The computer system and its environment are tested to the satisfaction
of the user.
5.2 IMPLEMENTATION
The implementation phase is less creative than system design. It is primarily
concerned with user training, and file conversion. The system may be requiring
extensive user training. The initial parameters of the system should be modifies as a
result of a programming. A simple operating procedure is provided so that the user
can understand the different functions clearly and quickly. The different reports can
be obtained either on the inkjet or dot matrix printer, which is available at the disposal
of the user.
The proposed system is very easy to implement. In general implementation is used to
mean the process of converting a new or revised system design into an operational
one.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
25
5.3 TESTING
Testing is the process where the test data is prepared and is used for testing the
modules individually and later the validation given for the fields.
Then the system testing takes place which makes sure that all components of the
system property functions as a unit.
The test data should be chosen such that it passed through all possible condition.
Actually testing is the state of implementation which aimed at ensuring that the
system works accurately and efficiently before the actual operation commence. The
following is the description of the testing strategies, which were carried out during the
testing period.
5.3.1 System Testing
Testing has become an integral part of any system or project especially in the field of
information technology. The importance of testing is a method of justifying, if one is
ready to move further, be it to be check if one is capable to with stand the rigors of a
particular situation cannot be underplayed and that is why testing before development
is so critical.
When the software is developed before it is given to user to user the software must be
tested whether it is solving the purpose for which it is developed. This testing
involves various types through which one can ensure the software is reliable.
The program was tested logically and pattern of execution of the program for a set of
data are repeated. Thus the code was exhaustively checked for all possible correct
data and the outcomes were also checked.
5.3.2 Module Testing
To locate errors, each module is tested individually. This enables us to detect error
and correct it without affecting any other modules. Whenever the program is not
satisfying the required function, it must be corrected to get the required result.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
26
Thus all the modules are individually tested from bottom up starting with the smallest
and lowest modules and proceeding to the next level. Each module in the system is
tested separately. For example the job classification module is tested separately. This
module is tested with different job and its approximate execution time and the result
of the test is compared with the results that are prepared manually. The comparison
shows that the results proposed system works efficiently than the existing system.
Each module in the system is tested separately. In this system the resource
classification and job scheduling modules are tested separately and their
corresponding results are obtained which reduces the process waiting time.
5.3.3 Integration Testing
After the module testing, the integration testing is applied. When linking the modules
there may be chance for errors to occur, these errors are corrected by using this
testing.
In this system all modules are connected and tested. The testing results are very
correct. Thus the mapping of jobs with resources is done correctly by the system.
5.3.4 Acceptance Testing
When that user fined no major problems with its accuracy, the system passers through
a final acceptance test. This test confirms that the system needs the original goals,
objectives and requirements established during analysis without actual execution
which elimination wastage of time and money acceptance tests on the shoulders of
users and management, it is finally acceptable and ready for the operation.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
27
CHAPTER 6
SYSTEM DESIGN
Design Engineering deals with the various UML [Unified Modeling language]
diagrams for the implementation of project. Design is a meaningful engineering
representation of a thing that is to be built. Software design is a process through which
the requirements are translated into representation of the software. Design is the place
where quality is rendered in software engineering. Design is the means to accurately
translate customer requirements into finished product.
6.1 ACTIVITY DIAGRAM
Activity diagram are a loosely defined diagram to show workflows of stepwise
activities and actions, with support for choice, iteration and concurrency. UML,
activity diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. UML activity diagrams could potentially
model the internal logic of a complex operation. In many ways UML activity
diagrams are the object-oriented equivalent of flow charts and data flow diagrams
(DFDs) from structural development. The workflow and the flow of operations can be
clearly seen in the Fig 5.1. It represents the various operations undergoing during the
generation of Image.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
28
Fig 6.1 Activity Diagram
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
29
6.2 USE CASE DIAGRAM
A Use case diagram is a list of steps, typically defining interactions between a role
(known in UML as an "actor") and a system, to achieve a goal. The actor can be a
human or an external system. A diagram is a type of behavioral diagram created from
a Use-case analysis. The purpose of use case is to present overview of the
functionality provided by the system in terms of actors, their goals and any
dependencies between those use cases.
Fig 6.2 Use Case Diagram of Admin
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
30
Fig 6.3 Use Case Diagram of User
6.3 DATA FLOW DIAGRAM
A data flow diagram (DFD) is a graphical representation of the "flow" of data
through an information system modeling its process aspects. Often they are a
preliminary step used to create an overview of the system which can later be
elaborated. DFDs can also be used for the visualization of data processing (structured
design)
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
31
Fig 6.4 Data Flow Diagram
6.4 SEQUENCE DIAGRAM
A sequence diagram shows object interactions arranged in time sequence. It depicts
the objects and classes involved in the scenario and the sequence of messages
exchanged between the objects needed to carry out the functionality of the scenario.
The sequence diagram shows a numerous steps which are involved in a procedure. It
also shows the exact functioning of each module and steps related to it. Sequence
diagram describes the whole functionality of the work that is carried out. Sequence
diagram shows interactions among the various modules of the work that has to be
carried out.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
32
Fig 6.5 Sequence Diagram
The sequence diagram shows a numerous steps which are involved in a procedure. It
also shows the exact functioning of each module and steps related to it. Sequence
diagram describes the whole functionality of the work that is carried out. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
33
CHAPTER 7
GLOBAL STRUCTURE AND SUBSYSTEM
7.1 GLOBAL STRUCTURE OF A SYSTEM
The system was designed for databases containing relatively simple images, but even
in such cases large differences can occur among images in file size or resolution. In
addition, some images may be noisier, the extent and direction of illumination may
vary (fig 6.1) and so the feature vectors cannot be effectively compared. In order to
avoid it, a multistep pre-processing mechanism precedes the generation of descriptors.
In order to avoid it, a multistep pre-processing mechanism precedes the generation of
descriptors.
Fig 7.1 Same Image of different contrast
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
34
Fig 7.2 Global Structure of a System
Fig 7.3 System for Database containing simple images
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
35
CHAPTER 8
DEVELOPMENT TOOLS
8.1. GENERAL
This chapter is about the software language and the tools used in the development of
the project. The platform used here is JAVA. The Primary languages are JAVA and
J2EE. In this project JAVA is chosen for implementation.
8.2. FEATURES OF JAVA
8.2.1. THE JAVA FRAMEWORK
Java is a programming language originally developed by James Gosling at
Microsystems and released in 1995 as a core component of Sun Microsystems' Java
platform. The language derives much of its syntax from C and C++ but has a simpler
object model and fewer low-level facilities. Java applications are typically compiled
to byte code that can run on any Java Virtual Machine (JVM) regardless of computer
architecture. Java is general-purpose, concurrent, class-based, and object-oriented,
and is specifically designed to have as few implementation dependencies as possible.
It is intended to let application developers "write once, run anywhere".
Java is considered by many as one of the most influential programming languages of
the 20th century, and is widely used from application software to web applications the
java framework is a new platform independent that simplifies application
development internet. Java technology's versatility, efficiency, platform portability,
and security make it the ideal technology for network computing. From laptops to
datacenters, game consoles to scientific supercomputers, cell phones to the Internet,
Java is everywhere.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
36
8.2.2. OBJECTIVES OF JAVA
Why Software Developers Choose Java?
Java has been tested, refined, extended, and proven by a dedicated community. And
numbering more than 6.5 million developers, it's the largest and most active on the
planet. With its versatility, efficiency, and portability, Java has become invaluable to
developers by enabling them to:
Write software on one platform and run it on virtually any other platform
Create programs to run within a Web browser and Web services
Develop server-side applications for online forums, stores, polls, HTML forms
processing, and more
Combine applications or services using the Java language to create highly
customized applications or services
Write powerful and efficient applications for mobile phones, remote
processors, low-cost consumer products, and practically any other device with
a digital heartbeat
Some Ways Software Developers Learn Java
Today, many colleges and universities offer courses in programming for the Java
platform. In addition, developers can also enhance their Java programming skills by
reading Sun's java.sun.com Web site, subscribing to Java technology-focused
newsletters, using the Java Tutorial and the New to Java Programming Center, and
signing up for Web, virtual, or instructor-led courses.
Object Oriented: To be an Object Oriented language, any language must follow at
least the four characteristics.
Inheritance: It is the process of creating the new classes and using the
behavior of the existing classes by extending them just to reuse the existing
code and adding addition a features as needed.
Encapsulation: It is the mechanism of combining the informationand
providing the abstraction.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
37
Polymorphism: As the name suggest one name multiple form, Polymorphism
is the way of providing the different functionality by the functions having the
same name based on the signatures of the methods.
Dynamic binding: Sometimes we don't have the knowledge of objects about
their specific types while writing our code. It is the way of providing the
maximum functionality to a program about the specific type at runtime.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
38
CHAPTER 9
IMPLEMENTATION
9.1. GENERAL
This chapter describes the implementation of searched based application. It deals with
the source code for main viewpoint of various services offered by a SBIR System.
9.2 IMPLEMENTAION OF SBIR SYSTEM
9.2.1 IMAGE COMPARISON
package cbir1;
import java.sql.*;
import java.util.StringTokenizer;
import javax.swing.ImageIcon;
import java.math.*;
import java.util.Vector;
public class compare {
DBConnection obj=new DBConnection();
ImageIcon ii;
Connection con;
Statement st;
int red[], green[], blue[], hue[], saturate[], value[];
double gfd[] = new double[80];
int count, flag = 0, val = 0;
String colorpath[];
double colorvalue[];
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
39
String shapepath[];
double shapevalue[];
String textpath[];
double textvalue[];
Vector cpath = new Vector();
Vector cvalue = new Vector();
Vector spath = new Vector();
Vector svalue = new Vector();
Vector tpath = new Vector();
Vector tvalue = new Vector();
double dr1[];
Vector v=new Vector();
public compare(ImageIcon ii) {
this.ii = ii;
}
public void colorcompare(ImageIcon ii) throws Exception {
int rsq, gsq, bsq, hsq, ssq, vsq;
red = new int[256];
green = new int[256];
blue = new int[256];
hue = new int[361];
saturate = new int[101];
value = new int[256];
color c = new color(ii);
c.histogram();
ResultSet rss = obj.countColor();
if (rss.next()) {
count = rss.getInt(1);
}
rss.close();
colorpath = new String[count];
colorvalue = new double[count];
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
40
int j = 0;
ResultSet rs1 = obj.selectColor();
while (rs1.next()) {
int r = 0, g = 0, b = 0, hu = 0, satu = 0, vl = 0;
colorpath[j] = rs1.getString(1);
int i = 0;
StringTokenizer sf = new StringTokenizer(rs1.getString(2), ",");
while (sf.hasMoreTokens()) {
red[i] = Integer.parseInt(sf.nextToken());
i++;
}
i = 0;
StringTokenizer sf1 = new StringTokenizer(rs1.getString(3), ",");
while (sf1.hasMoreTokens()) {
green[i] = Integer.parseInt(sf1.nextToken());
i++;
}
i = 0;
StringTokenizer sf2 = new StringTokenizer(rs1.getString(4), ",");
while (sf2.hasMoreTokens()) {
blue[i] = Integer.parseInt(sf2.nextToken());
i++;
}
i = 0;
StringTokenizer sf3 = new StringTokenizer(rs1.getString(5), ",");
while (sf3.hasMoreTokens()) {
hue[i] = Integer.parseInt(sf3.nextToken());
i++;
}
i = 0;
StringTokenizer sf4 = new StringTokenizer(rs1.getString(6), ",");
while (sf4.hasMoreTokens()) {
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
41
saturate[i] = Integer.parseInt(sf4.nextToken());
i++;
}
i = 0;
StringTokenizer sf5 = new StringTokenizer(rs1.getString(7), ",");
while (sf5.hasMoreTokens()) {
value[i] = Integer.parseInt(sf5.nextToken());
i++;
}
for (int k = 0; k < 256; k++) {
r += Math.pow((red[k] - c.red[k]), 2);
g += Math.pow(green[k] - c.green[k], 2);
b += Math.pow((blue[k] - c.blue[k]), 2);
vl += Math.pow(value[k] - c.value[k], 2);
}
for (int k = 0; k < 361; k++) {
hu += Math.pow((hue[k] - c.hue[k]), k);
}
for (int k = 0; k < 101; k++) {
satu += Math.pow((saturate[k] - c.saturate[k]), 2);
}
rsq = (int) Math.sqrt(r);
gsq = (int) Math.sqrt(g);
bsq = (int) Math.sqrt(b);
hsq = (int) Math.sqrt(hu);
ssq = (int) Math.sqrt(satu);
vsq = (int) Math.sqrt(vl);
colorvalue[j] = 100 - ((rsq + gsq + bsq + hsq + ssq + vsq) * 100 / 140000);
System.out.println(colorpath[j] + " " + colorvalue[j]);
if (colorvalue[j] > 40) {
cpath.addElement(colorpath[j]);
cvalue.addElement(colorvalue[j]);
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
42
}
j++;
}
for (int l = 0; l < cvalue.size(); l++) {
for (int u = l + 1; u < cvalue.size(); u++) {
if ((Double.parseDouble(cvalue.elementAt(l).toString())) <
(Double.parseDouble(cvalue.elementAt(u).toString()))) {
Object tval = cvalue.elementAt(l);
cvalue.setElementAt(cvalue.elementAt(u), l);
cvalue.setElementAt(tval, u);
Object tname = cpath.elementAt(l);
cpath.setElementAt(cpath.elementAt(u), l);
cpath.setElementAt(tname, u);
}
}
}
}
public void texturecompare(ImageIcon ii) throws Exception {
int ctsq, dsq, hsq, epsq, ensq, cnsq;
int j = 0;
dr1 = new double[count];
texture t = new texture(ii);
t.greyscale();
ResultSet rss = obj.countTexture();
if (rss.next()) {
count = rss.getInt(1);
}
rss.close();
textpath = new String[count];
textvalue = new double[count];
double textureValue = 0;
ResultSet rs1 = obj.selectTexture();
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
43
while (rs1.next()) {
double ct = 0, dr = 0, hy = 0, hu = 0, ep = 0, en = 0, cn = 0;
textpath[j] = rs1.getString(1);
ct = Math.abs((Double.parseDouble(rs1.getString(2)) - t.contrast));
dr = Math.abs((Double.parseDouble(rs1.getString(3)) - t.dissimilar));
hy = Math.abs((Double.parseDouble( rs1.getString(4)) - t.homo));
ep = Math.abs((t.entropy - Double.parseDouble(rs1.getString(5))));
en = Math.abs((t.energy - Double.parseDouble(rs1.getString(6))));
cn = Math.abs((t.correlation - Double.parseDouble(rs1.getString(7))));
textvalue[j] += 100 - (ct / 250000);
textvalue[j] += 100 - (dr / 6000);
textvalue[j] += 100 - (hy);
textvalue[j] += 100 - (ep *10);
textvalue[j] += 100 - (en*10);
textvalue[j] += 100-(cn *10000 /5);
textvalue[j] /= 6;
System.out.println("text value[" + j + "]" + textvalue[j]);
if(textvalue[j]>50)
{
tpath.addElement(textpath[j]);
tvalue.addElement(textvalue[j]);
}
j++;
}
for (int l = 0; l < tvalue.size(); l++) {
for (int u = l + 1; u < tvalue.size(); u++) {
if ((Double.parseDouble(tvalue.elementAt(l).toString())) <
(Double.parseDouble(tvalue.elementAt(u).toString()))) {
Object t1value = tvalue.elementAt(l);
tvalue.setElementAt(tvalue.elementAt(u), l);
tvalue.setElementAt(t1value, u);
Object tname = tpath.elementAt(l);
tpath.setElementAt(tpath.elementAt(u), l);
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
44
tpath.setElementAt(tname, u);
}
}
}
}
public void shapecompare(ImageIcon ii) throws Exception {
int gfdsq;
shape p = new shape(ii);
p.gfd();
ResultSet rss = obj.countShape();
if (rss.next()) {
count = rss.getInt(1);
}
rss.close();
shapepath = new String[count];
shapevalue = new double[count];
int j = 0;
ResultSet rs2 = obj.selectShape();
while (rs2.next()) {
int gf = 0;
shapepath[j] = rs2.getString(1);
int i = 0;
StringTokenizer sf = new StringTokenizer(rs2.getString(2), ",");
while (sf.hasMoreTokens()) {
gfd[i] = Double.parseDouble(sf.nextToken());
i++;
}
for (int k = 0; k < 80; k++) {
gf += Math.pow(gfd[k] - p.fd[k], 2);
}
gfdsq = (int) Math.sqrt(gf);
shapevalue[j] = 100 - (gfdsq / 178);
System.out.println("Shape value["+j+"]"+shapevalue[j]);
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
45
if (shapevalue[j] > 50) {
spath.addElement(shapepath[j]);
svalue.addElement(shapevalue[j]);
}
j++;
}
for (int l = 0; l < svalue.size(); l++) {
for (int u = l + 1; u < svalue.size(); u++) {
if ((Double.parseDouble(svalue.elementAt(l).toString())) <
(Double.parseDouble(svalue.elementAt(u).toString()))) {
Object shvalue = svalue.elementAt(l);
svalue.setElementAt(svalue.elementAt(u), l);
svalue.setElementAt(shvalue, u);
Object shname = spath.elementAt(l);
spath.setElementAt(spath.elementAt(u), l);
spath.setElementAt(shname, u);
}
}
}
for (int l = 0; l < svalue.size(); l++) {
System.out.println(spath.elementAt(l) + " ....... " + svalue.elementAt(l));
}
rs2.close();
}
}
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
46
CHAPTER 10
SNAPSHOTS
Snapshot is nothing but every moment of the application while running. It gives the
clear and elaborated application. It will be useful for the new user to understand for
the future steps
10.1 VARIOUS SNAPSHOTS
Fig 10.1 LOGIN FRAME
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
47
Fig 10.2 ADMIN HOME
Fig 10.3 ADD IMAGE
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
48
Fig 10.4 VIEW IMAGE
Figs 10.5 DELETE IMAGE
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
49
Fig 10.6 USER HOME_1
Fig 10.7 USER HOME_2
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
50
Fig 10.8 PAINT WITH OFF-SCREEN CANVAS
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
51
CHAPTER 11
CONCLUSION
This Project has enabled us to visualize a system that proves to be more accurate in
Searching and Extracting Images from databases. Unlike the conventional search
methods this technique has enabled us to achieve accuracy in data mining techniques
and a feedback system that enables users to get a panoramic view of how and why the
specific results were achieved thus making this system more reliable with transparent
operations. This project's implementation in the real time Content based image
retrieval systems is also of great significance since a fast accurate technique for
systems like Hospital records searches, law enforcement agencies databases and
government agencies record will not only improve the standards of service but also
make it easier for operators to continue their work.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
52
CHAPTER 12
FUTURE ENHANCEMENTS
SBIR allow the populace to choose their representatives and express their preferences for
how they will be governed. Naturally, the integrity of this process is fundamental to the
integrity of Selectivity itself. The SBIR system must be sufficiently robust to withstand a
variety of fraudulent behaviors and must be sufficiently transparent and comprehensible
that candidates can accept the results.
The concept put forth in the project would remove the security threats from the present
SBIR system. A secured environment would allow users to find the exact image that they
are searching for.
For future work, we will extend the security parameters. New and improved pseudo
random algorithms will be applied for the safety of the platform. Also the randomness of
the generation of the secret key would be made more complex. One method to do that is
to increase the number of the rounds of the algorithm.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
53
CHAPTER 13
REFERENCES
[1] D. Comaniciu, and P. Meer, Robust analysis of feature spaces: color image
segmentation, IEEE Conference on Computer Vision and Pattern Recognition, pp. 750
755, June 1997.
[2] N. Dalal, and B. Triggs, Histograms of oriented gradients for human detection,
IEEE Conference on Computer Vision and Pattern Recognition, pp. 886893, July 2005.
[3] T. Deselaers, D. Keysers, and H. Ney, Features for image retrieval: an experimental
comparison, Information Retrieval, vol. 11, pp. 77107, December 2007.
[4] M. Eitz, K. Hildebrand, T. Boubekeur, and M. Alexa, An evaluation of descriptors
for large-scale image retrieval from sketched feature lines, Computers and Graphics,
vol. 34, pp. 482498, October 2010.
[5] R. Fabbri, L.D.F. Costa, J.C. Torelli, and O.M. Bruno, 2D Euclidean distance
transform algorithms: a comparative survey, ACM Computing Surveys, vol. 44, pp. 1
44, February 2008.
[6] M. Flickner, H. Sawhney, W. Niblack, J. Ashley, Q. Hiang, B. Dom, M. Gorkani, J.
Hafner, D. Lee, D. Petkovic, D. Steele, and P. Yanker, Query by image and video
content: the QBIC system, IEEE Computer, vol. 28, pp. 2332, 2002.
[7] Gy. Gyorok,Embedded hybrid controller with programmable analog circuit, IEEE
14th International Conference on Intelligent Systems pp. 59.159.4, May 2010.
[8] R. Hu, M. Barnard, and J. Collomosse, Gradient _eld descriptor for sketch based
image retrieval and localization, International Conference on Image Processing, pp. 1
4, 2010.
[9] A.K. Jain, J.E. Lee, and R. Jin, Sketch to photo matching: a feature-based approach,
Proc. SPIE, Biometric Technology for Human Identi_cation VII, vol. 7667, pp. 766702
766702,2010.
-
B.Tech Information Technology, CUSAT SKETCH BASED IMAGE RETRIEVAL
54
[10] A.K. Jain, J.E. Lee, R. Jin, and N. Gregg, Graff_ti-ID: matching retrieval of graffti
images, ACM MM, MiFor09, pp. 16, 2009.
[11] J.B. Kruskal, Nonmetric multidimensional scaling: a numerical method,
Psychometrika, vol. 29, pp. 115129, 1964.
[12] Y. Liu, and F. Dellaert, A classi_cation based similarity metric for 3D image
retrieval, IEEE Conference on Computer Vision and Pattern Recognition, pp. 800805,
June 1998.
[13] D.G. Lowe, Distinctive image features from scale-invariant keypoints,
International Journal of Computer Vision, vol. 60, pp. 91110, 2004.
[14] D.G. Lowe, Object Recognition from Local Scale-Invariant Features, IEEE
International Conference on Computer Vision, vol. 2, p. 1150, 1999.
[15] J.R. Smith, and S.F. Chang, VisualSEEK: a fully automated contentbased image
query system, ACM Multimedia 96, pp. 9798, 1996.
[16] J. Tick, and J. Fodor, Some classes of binary operations in approximate reasoning,
Studies in Informatics and Control, vol. 15, pp. 259270, 2006.
sbir_1sbir_2_CONTENTSsbir_3_body