0% found this document useful (0 votes)
911 views70 pages

A Major Project Report Final Year

This document summarizes a major project report on Content Based Image Retrieval (CBIR). It was submitted by three students - Saurabh Sharma, Shubham Nath, and Ratnesh Pathak - in partial fulfillment of their Bachelor of Technology degree in Computer Science and Engineering. The report describes the development of a CBIR system under the guidance of their professor, Mr. Abhishek Jaiswal. It includes an introduction, requirements specification, system design, implementation details, testing processes, and conclusions.

Uploaded by

sandy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
911 views70 pages

A Major Project Report Final Year

This document summarizes a major project report on Content Based Image Retrieval (CBIR). It was submitted by three students - Saurabh Sharma, Shubham Nath, and Ratnesh Pathak - in partial fulfillment of their Bachelor of Technology degree in Computer Science and Engineering. The report describes the development of a CBIR system under the guidance of their professor, Mr. Abhishek Jaiswal. It includes an introduction, requirements specification, system design, implementation details, testing processes, and conclusions.

Uploaded by

sandy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 70

A Major Project Report

On

Content Based Image Retrieval

Submitted in Partial Fulfilment of the requirement for the award of the degree of

BACHELOR OF TECHNOLGY
(Computer Science and Engineering)
Submitted by

Saurabh Sharma
(660970101004)
Shubham Nath
(150970101031)
Ratnesh Pathak
(660970101003)
Under the Guidance of

Mr. Abhishek Jaiswal

(Assistant Professor )

in

Computer Science and Engineering


THDC INSTITUTE OF HYDROPOWER ENGINEERING & TECHNOLOGY
TEHRI ,UTTRAKHAND,INDIA
(Uttarakhand Technical University, Dehradun)
2015-2019
CERTIFICATE
I hereby certify that the work which is being presented in the thesis entitled “Content
Based Image Retrieval” in partial fulfillment of the requirement for the award of degree of
Bachelor of Technology and submitted in Computer Science and Engineering of THDC
Institute of Hydropower Engineering & Technology, Tehri,is an authentic record of my own
work carried out .Under the supervision of Mr. Abhishek Jaiswal ,Assistant Professor,
Department of Computer Science and Engineering, THDC Institute of Hydropower
Engineering & Technology, Tehri.

The matter presented in this report has not been submitted by me anywhere for the
award of any other degree of this or any other institute.

Saurabh Sharma (660970101004) ( )

Shubham Nath (150970101031) ( )

Ratnesh Pathak (660970101003) ( )

This is to certify that the above statement made by the candidate is correct to the best
of our knowledge.

Date:

Mr. Abhishek Jaiswal Mr. Vivek Kumar


Supervisor Co-guide

Mr. Vivek Kumar Mr Ashish Joshi

HOD Project In-charge


ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B.Tech Project undertaken
during B.tech Final Year. We owe special debt of gratitude to Asst. Prof. Mr. Abhishek
Jaiswal and Asst. Prof. Mr. Vivek Kumar of computer Science and Engineering , THDC
Institute of Hydropower Engineering & Technology for their constant support and guidance
throughout the course of our work. Their sincerity, thoroughness and perseverance have
been a constant source of inspiration for us. It is only their cognizant efforts that our
endeavors have seen light of the day. We also take the opportunity to acknowledge the
contribution of our mentor support and assistance during the development of the project. We
do not like to miss the opportunity to acknowledge the contribution of all. We also do not
like to miss the opportunity to acknowledge the contribution of all faculty members of the
department for their kind assistance and cooperation during the development of our project.
Last but not the least,We acknowledge our friends for their contribution in the completion of
the project.

1. Saurabh Sharma (660970101004)


2. Shubham Nath (150970101031)
3. Ratnesh Pathak (660970101003)
ABSTRACT
As the network and development of multimedia technologies are becoming more
popular, users are not satisfied with the traditional information retrieval techniques. so
nowadays the content based image retrieval are becoming a source of exact and fast
retrieval. Here it helps us to retrieve images that are more appropriate, along with multiple
features for better accuracy, similarity measurements and the representation of the visual
features are two important issues in Content-Based Image Retrieval (CBIR). In this system,
we compare between the combination of representations of the color feature with and without
using the color layout feature. To represent the color information, we use Average RGB,
Global Color Histogram (GCH) and Local Color Histogram (LCH) beside the color layout
feature. Based on some commonly used Euclidean and Non-Euclidean similarity measures,
we tested different categories of images and measured the retrieval accuracy when combining
such techniques. The experiments showed that the Average RGB, Global Color Histogram
and Local Color Histogram using the cosine distance gives good results while the best results
obtained when adding the color layout feature to this combination by using the Euclidean
distance. The result reflects the importance of using the spatial information beside the color
feature itself and the importance of choosing good similarity distance measurements. Here by
using these formulae we can retrieve an appropriate images from the database. By using this
we increase time efficiency , speediness , it demands minimum amount of memory and its not
sensitive with the images changes of the size and resolution.
TABLE OF CONTENTS
Page No.
1 Preamble 1

1.1 Introduction 1
1.2 Literature Survey 2
1.3 Problem Statement 3
1.3.1 Problem Explanation 3
1.3.2 Problem Solution 4
1.4 Features of The Project 4
1.5 Organization of The Report 5
1.6 Summary 6
2 System Requirements and Specification 7
2.1 Purpose of This Document 7
2.2 General Description 7
2.2. Users and Characteristics 7
1
2.2. Product Perspective 7
2
2.2. Overview of Functional Requirements 8
3
2.2. Overview of data Requirements 8
4
2.2. General Constraints, Assumption Dependencies, 8
5 Guidelines
2.2. User View of Product Use 8
6
2.2. Hardware and Software Requirements 9
7
2.3 Summary 9
3 System Design Description 10
3.1 Preliminary Design 10
3.1. Layout of Content Based Image Retrieval System 10
1
3.1. About Technology 11
2
3.1. Design Considerations 12
3
3.2 Architectural Strategies 13
3.2. The Modules of The CBIR System 13
1
3.2. Interfaces 14
i
2 v
3.2. Dataflow Diagram 15
3
3.3 Detailed System Design 16
3.3. Use Case View 16
1
3.3. Level 1 DFD 19
2
3.3. Class Diagram 20
3
3.3. Sequence Diagram 22
4
3.4 Summary 23
4 Implementation 24
4.1 Add New Module 24
4.2 Average RGB 31
4.3 Local Color Histogram 32
4.4 Global Color Histogram 34
4.5 Summary 38
5 Testing 39
5.1 Testing Process 39
5.2 Testing Objectives 39
5.3 Levels of Testing 39
5.3. Unit Testing 39
1
5.3. Integration Testing 41
2
5.3. System Testing 41
3
5.4 Summary 43
6 Conclusion and Future work 44
6.1 Conclusion 44
6.2 Future Enhancement 44
References 45
Appendix A Snapshots 47
LIST OF TABLES
Page No.
Table 3.1 Technology Used to Implement CBIR 12
Table 5.1 Test Cases For FILE Opening And ADD New Module 40
Table 5.2 Test Cases For Modules Color Histogram And Texture 41
Table 5.3 Test Cases for Content Based Image Retrieval System 42

v
i
LIST OF FIGURES
Page No.
Fig 3.1 Flow of Work 16
Fig 3.2 Use Case Diagram of CBIR 18
Fig 3.3 Data Flow Model of CBIR 20
Fig 3.4 Class Diagram for CBIR 21
Fig 3.5 Sequence Diagram of ADD NEW Module 22
Fig 3.6 Sequence Diagram of Color Histogram 23
Fig A1 Execution of The Java File 47
Fig A2 Front Page of The Application 48
Fig A3 Login Page 49
Fig A4 Administrator Main Screen With Menu Options. 50

Fig A5 Administrator Adding New User 51

Fig A6 Administrator Deleting The User 52

Fig A7 Main Screen To Add An Image Or A Folder Options 53


Fig A8 Main Screen To Open A Query Image 54

Fig A9 Displays The Query Image From The Folder 55

Fig A10 Menu Options For Color Histogram 56

Fig A11 Average RGB 57


Fig A12 Global Color Histogram 58
Fig A13 Local Color Histogram 59
CHAPTER
1
PREAMBLE
This section is going to introduce “A Robust Content Based Image Retrieval
System Using GCH, LCH and Average RGB”, which is being developed. It includes the
Introduction, literature survey, motivation to the project, problem statement, and
organization of the report. This section specifies the overall view of the system with which
the brief idea of the system is understood.

1.1 Introduction

In the last few years, the rapid growth of the Internet has enormously increased the
number of image collections available. The accumulation of these image collections
(including art works, satellite and medical imagery) is attracting more and more users in
various professional fields[2]—for example geography, medicine, architecture,
advertising, design, fashion and publishing.
Meanwhile, the study of image retrieval, which is concerned with effectively and
efficiently accessing desired images from large and varied image collections, has become
more interesting and more challenging[1].
Image retrieval is concerned with techniques for storing and retrieving images both
efficiently and effectively[2]. Early image retrieval methods locate the desired images by
matching keywords that are assigned to each image manually. However, as a result of the
large number of images in collections, manual processing has become impractical.
As well, because we are unlikely to foresee all the query keywords that will be
used in a retrieval process, it is impractical to assign keywords to every image, so the
effectiveness of classic image retrieval is very limited.
Robust Content-based image retrieval (referred to as RCBIR in this thesis), which
is based on automatically extracted primitive features such as color, shape, texture, and
even the spatial relationships among objects, has been employed since the 1990’s[4]. In
the last ten years, a great deal of research work on image retrieval has concentrated on
CBIR technology.
Some commercial products based on CBIR technology have come to the
marketplace, well-known examples including QBIC[1].Image databases and collections
can be enormous in size, containing hundreds, thousands or even millions of images. The
conventional method of image retrieval is searching for a keyword that would match the
descriptive keyword assigned to the image by a human categorizer. Currently under
development, even though several systems exist, is the retrieval of images based on their
content, called Content Based Image Retrieval, CBIR[5]. While computationally
expensive, the results are far more accurate than conventional image indexing. Hence,
there exists a tradeoff between accuracy.
The need for Content- Based image retrieval is to retrieve images that are more
appropriate [1], along with multiple features for better retrieval accuracy. Usually in search
process using any search engine, which is through text retrieval, which won’t be so
accurate. So, we go for Content- Based image retrieval. Content- Based Image Retrieval
also known as query by image content (QBIC) and content-based visual information
retrieval (CBVIR) [2].
“Content-based” means that the search makes use of the contents of image
themselves, rather than relying on human-inputted metadata such as captions or keywords
[3]. The similarity measurements and the representation of the visual features are two
important issues in Content-Based Image Retrieval (CBIR) [8].
Given a query image, with single / multiple object present in it; mission of this
work is to retrieve similar kind of images from the database based on the features extracted
from the query image [1]. In this we use features like
 RGB Color
 GCH (Global Color Histogram)
 LCH (Local Color Histogram).

Further to Image retrieval we can able to compare the several pairs of Images and
find out whether it is exactly matching or not.

1.2 Literature Survey


Content Based Image Retrieval (CBIR) is any technology that in principle helps to
organize digital image archives by their visual content [9]. By this definition, anything
ranging from an image, Similarity function to a robust image annotation engine falls under
the purview of CBIR The most common form of CBIR is an image search based on
visual .The increasing amount of digitally produced images requires new methods to
archive and access this data. Conventional databases allow.
Conventional databases allow for textual searches on Meta data only [4]. Content
Based Image Retrieval (CBIR) is a technique which uses visual contents, normally called
as features, to search images from large scale image databases according to users’ requests
in the form of a query image.
Apart from the usual features like color and texture, a new feature extraction
algorithm called edge histogram is introduced [10]. Edges convey essential information to
a picture and therefore can be applied to image retrieval. The edge histogram descriptor
captures the spatial distribution of edges [5].
This model expects the input as Query by Example (QBE) and any combination of
features can be selected for retrieval [12]. The focus is to build a universal CBIR system
using low level features. These are mean, median, and standard deviation of Red, Green,
and Blue channels [13] of color histograms.
Color feature is the most intuitive and obvious feature of the image, and generally
adopt histograms to describe it. Color histograms method has the advantages of
speediness, low demand of memory space and not sensitive with the images changes of the
size and rotation, it wins extensive attention consequently [11].
Information for proceeding in the project are collected from different books such
as Greg Pass, Ramin Zabih, “Histogram refinement for content based image retrieval”
WACV '96 [6], Yong Rui,Thomas S. Huang and Sharad Mehrotra “Relevance Feedback
Techniques in Interactive content based image retreival .”,1996 [7] and also from some
IEEE papers and other online links.

1.3 Problem Statement


The problem involves entering an image as a query into a software application
that is designed to employ CBIR techniques in extracting visual properties, and matching
them. This is done to retrieve images in the database that are visually similar to the query
image.It’s a resolution and format dependent.
1.3.1 Problem Explanation
Image databases and collections can be enormous in size, containing hundreds,
thousands or even millions of images. The conventional method of image retrieval is
searching for a keyword that would match the descriptive keyword assigned to the image
by a human categorizer. Currently under development, even though several systems exist,
is the retrieval of images based on their content, called Content Based Image Retrieval,
CBIR.
While computationally expensive, the results are far more accurate than
conventional image indexing. Hence, there exists a tradeoff between accuracy and
computational cost. This tradeoff decreases as more efficient algorithms are utilized and
increased computational power becomes inexpensive.
Here we can use only jpeg format images as a query image due to which it
becomes format dependent and other formats are considered error. We cannot use higher
resolution images as input image because of this restrictions it get difficult to use different
images as query image.
The limitations of CBIR are
 Query process is difficult as a user has to specify query image by selecting from
exiting systems.
 Impartial for very large databases.
 Image retrieval based on the shape is very difficult to automate.
 The 100 percent of accuracy can not be attained.

1.3.2 Problem Solution

The solution initially proposed was to extract the primitive features of a query
image and compare them to those of database images. The image features under
consideration were color and texture. Thus, using matching and comparison algorithms,
the color, the shape and texture features of one image are compared and matched to the
corresponding features of another image.
This comparison is performed using color, and texture distance metrics. In the end,
these metrics are performed one after another, so as to retrieve database images that are
similar to the query.
The similarity between features was to be calculated using algorithms used by well
known CBIR systems such as QBIC. For each specific feature there was a specific
algorithm for extraction and matching.
1.4 Features of the Project
The main feature of this thesis work is to retrieve images that are similar to query
image from a large database. We use content- based search, for high accuracy multiple
features like color, texture and shape is incorporated. Color feature extraction is done
through “Global Color Histogram (GCH)” and “Local Color Histogram”, and Average
RGB Color Value.
CBIR’s advantages

 Retrieve images that are more appropriate.


 Uses multiple features for better retrieval accuracy.
 Makes use of the contents of image themselves, rather than relying on human-inputted
metadata such as captions or keywords.
 Retrieve similar kind of images from the database based on the features extracted
from the query image.
 Use features like RGB Color, GCH (Global Color Histogram) and LCH (Local Color
Histogram).
 Compare the several pairs of Images and find out whether it is exactly matching or
not.

CBIR’s disadvantages

 Sometimes it gives approximate output not the accurate.


 Has to be enchanced further in future.

1.5 Organization of The Report


The rest of the document is organized as follows:
 Chapter 2 includes the software requirement specification, which specifies the
functional and non-functional requirements of the system.

 Chapter 3 includes the design of the project where the system architecture, hardware
and software interfaces, a detailed description of different features along with the
UML diagrams are specified.
 Chapter 4 includes the implementation details where the pseudo code of the important
classes is specified.

 Chapter 5 includes the testing, which specifies how the different modules of the
project are tested for its correct working.

 The document ends with the conclusion and future work along with the few
appendixes, which includes the snapshots of the results, and some of the important
definitions.

1.6 Summary

In this chapter we came to know briefly about what is the project all about. In
addition we also learnt the need of the project. The specific requirements of the project are
carried out in next chapter.
CHAPTER 2

SYSTEM REQUIREMENTS AND SPECIFICATION

In this chapter System Requirements and Specification establishes the requirements


for Content Based Image Retrieval. System requirements specify the users along with
requirements like functional and data.

2.1 Purpose of this Document

The purpose behind the System Requirements and Specification document is to


describe the resources and management of those resources used in the design of the
Content Based Image Retrieval system. This System Requirements and Specification will
further provide details regarding the functional and performance related requirements of
the algorithm.

2.2 General Description

Under this topic we get the description of the users who uses the system along with
their characteristics and it specifies the product. It also describes briefly the functional and
data requirements of the project.

2.2.1 Users and their Characteristics


The users of this product are military agents crime detectors and architectural and
engineering designer in software systems, interior designers, medical diagonisors etc.

 User will give the query image .This image should be a real world image.
 User also has to mention the features on which the related images should be retrieved
like global color histogram, local color histogram and average RGB etc.
 Later the user will get the related images for the query image as the output.

2.2.2 Product Perspective

Our product is developed to get the related images for the query image from the
database. It is helpful in web designing who wants to search the whole database images for
the specific type of images for designing purpose. The product meets the 90% of the
accuracy level.

 Crime prevention
 The military
 Architectural and engineering design
 Fashion and interior design
 Journalism and advertising
 Medical department

2.2.3 Overview of Functional Requirements

Purpose: To retrieve the related images from database based on similarity features.
Inputs: Query images from the real world entity.
Outputs: List of related images is displayed along with the total time required.

2.2.4 Overview of Data Requirements

The product requires the database to store the images to be compared with query
image. Images in the database and the query images features have to be extracted which is
required in similarity measurements. The features extracted will be based on Average
RGB, Local color histogram and Global color histogram. So the images of different world
entities are stored in database.
2.2.5 General Constraints, Assumptions Dependencies, Guidelines

Our product is entirely based on image processing and requires JPEG format of the
image to process with. Users must have an enough memory to hold feature extracted so that
all the similarities result can be stored temporally. The system should also specify that the
object is an image file but not a text file.

2.2.6 User View of Product Use

User can use this product for the following:

 Web designing purpose.


 Security systems
 Criminal detection

 Image processing

2.2.7 Hardware and Software Requirements

The hardware and software requirements of the system which are required for the
implementation of the project in a system.

Software Requirements:

Platform : JAVA 1.6, MYSQL Client.


Operating System : Microsoft Windows 2000 or XP
Documentation : MS-word.

Hardware Requirements:

Processor : 2.4 GHz Pentium IV Processor


RAM : 512 MB
Hard Drive : 80GB
Disk Space : 1 GB

2.3 Summary
In this chapter we came to know briefly about what is the purpose of the document,
general description, users and their characteristics, product perspective, functional and data
requirements, user view of the product use, hardware and software requirements of the
system.The system design description is carried out in the next chapter.

Chapter 3

SYSTEM DESIGN DESCRIPTION

In this chapter we specify the design description of Content Based Image Retrieval
System. The design description consists of preliminary design and detail design.
Preliminary design specifies the high level design and detail design specifies the low level
design.
Image databases and collections can be enormous in size, containing hundreds,
thousands or even millions of images. The conventional method of image retrieval is
searching for a keyword that would match the descriptive keyword assigned to the image
by a human categorizer. Currently under development, even though several systems exist,
is the retrieval of images based on their content, called Robust Content Based Image
Retrieval using multiple features extraction, RCBIR. While computationally expensive, the
results are far more accurate than conventional image indexing.
Hence, there exists a tradeoff between accuracy and computational cost. This
tradeoff decreases as more efficient algorithms are utilized and increased computational
power becomes inexpensive.

3.1 Preliminary Design


The purpose of the design is to plan the solution of a problem specified by the
system requirements. The design of the system is perhaps the most critical factor affecting
the quality of the software and has a major impact on the later phases, particularly testing
and maintenance.
System design aims to identify the modules that should be in the system, the
specifications of these modules and to interact with each other to produce the desired
results. At the end of the system design all the major data structures, file formats, output
formats as well as major modules in the system and their specifications are decided.

3.1.1 Layout of Content Based Image Retrieval System

 The administrator has to insert the images one at a time or folder wise into the
database before starting with the query image.
 The user interface gives the query image whose related image from database has to be
extracted. The images should be from real world entity.
 Features of the query image is extracted and stored temporally for comparison.
 In the same way the features of images in the database is extracted.
 User specifies the feature on which the related database image has to be extracted as
output. Features considered are color histogram like local and global color histogram,
average RGB.
 After the comparison if the image of database is related to the query image then that
image will be added in the list of output images.

3.1.2 About Technology

The technology used in implementing CBIR is divided into three layers. It is as


shown in the table below. The basic functionalities are developed in Java class member
functions. Here the Java Swing procedures and functions residing in the front-end call Java
class member functions.
As with securing a network, securing a database by looking at the various layers
that are involved is an effective approach. Security of databases can be defined as
preventing unauthorized or accidental disclosure, alteration, or destruction of data .
In addition, the confidentiality of data that exists in the database must be considered, as
should the availability of that data. The following section will discuss a secure database
design; while not all-inclusive, it should provide a good, basic starting point.
Access to information contained in the tables must be properly regulated. This can
be done with control over direct access to the tables, and also through views. Views and
privileges assigned to the views can be created to limit users to only see specified portions
of data contained within a table .
Through the use of the selects, projections and joins, existing relations between
tables in a relational database, as well as a single table, can be created. Control over the
read, insert, update and delete commands must also be assigned appropriately within those
views.
Role-based authentication should be considered when adding access to any
database. Typical roles for access include administrator, user, programmer and operator.
For the first three roles, it is fairly obvious what access should be granted; it is the operator
role that can be a sticking point. Operators are expected to play an essential part in the
production operation of a system, yet they are often restricted in what type of access they
are granted.
Segregation of duties should be considered in the operator role, instead of just
granting one operator control over an entire process. Operators’ roles do need to be
carefully defined and kept within the realm of production support as much as possible.
Furthermore, all roles should have logging enabled to keep track of what occurs .
It is important to remember that changes made to the database, whether structural
or to the data itself, must be tracked and regulated by interested parties. Whether formal or
informal, the process must be defined and followed by all roles defined in the database
structure.
Technologies used to implement Content Based Image Retrieval is explained in the
Table 3.1.
Java Swing is used as the front-end. It is been used for implementing the front
page the project from where we will run the project. This front page which is built by Java
Swing is integrated with functions built in other languages like Mysql.

Table 3.1 Technology used to implement CBIR

CBIR Java Basics

Technology Java Swing


Java Swing is used to build the complete functionality of the Content Based Image
Retrieval. The functionality of Mysql database and its member functions which is being
called when we run the program from front-end built using Java Swing i.e. the member
functions of Java classes internally call the database for images.

3.1.3 Design Considerations

This section describes many of the issues, which need to be addressed or resolved
before attempting to devise a complete design solution.

Related Hardware and Software:

Hardware Requirements: The hardware requirements for running the project are as
follows:

 512 MB RAM
 Webcam (optional)

Software Requirements: The software requirements for running the project are as
follows:

 Operating system:
Windows XP
 Languages used:
Java
 Mysql yog database

Operating System:

The operating system used is any Windows operating system. The user can access
the application through software’s (Java) in Windows operating system. Windows is the
most popular and user-friendly operating system. It sufficiently caters to the needs of the
application on the client side. It’s good enough to support all sorts of activities required by
user. Because user may not be technical graduates it’s easier for them to use the
application in the windows operating system.

3.2 Architectural Strategies

Here we will discuss about the architecture of Content Based Image Retrieval
which includes the following topics:

 The modules of the recognition system.


 Interfaces.
 Context level Data flow diagram.

3.2.1 The Modules of the CBIR System

The Content Based Image Retrieval divided into following modules for design and
development.
Module 1: Add new module
Module 2: Color Histogram module

 Add New Module

In this module Administrator add the images to the database. The images to database
are added individually or the folder of images can be added simultaneously.
The dialog box of image insertion successful will be displayed. Later the user can
select the query image from any of the folder which is a real world entity. If administrator
go ahead with future process before adding the query image a dialog box indicating that
query image is to be inserted.

 Color Histogram Module

Here in this module features are extracted based on


 Average RGB
 Local Color Histogram
 Global Color Histogram

Average RGB
The red, green and blue color intensity of query image is calculated and compared
with the RGB values of database images and related images are displayed as output.

Local Color Histogram


The image will segmented into and color histogram of each block will be obtained.
We calculate the distance, using their histograms, between a region in one image and a
region at same location in the other image in database.

Global Color Histogram


Global color histogram of each block will be obtained. We calculate the distance,
using their histograms, between a region in one image and a region at same location in the
other image in database.Same as the local color histogram but considers all the regions of
the image.

3.2.2 Interfaces

The chapter describes the interfaces used. It discusses the graphical, hardware and
software interfaces used.

Hardware Interface

The following hardware interfaces will be used


The system requires JPEG format of images only. The system cannot recognize the
other formats.

Software Interface

The following software interfaces will be used


The system requires all the software i.e. java of 1.5 jdk version in front end and
mysql at the backend for the database.

3.2.3 Data Flow Diagram


A data flow diagram (DFD) is a graphical representation of the "flow" of data through
an information system. A data flow diagram can also be used for the visualization of data
processing (structured design). It is common practice for a designer to draw a context-level
DFD first which shows the interaction between the system and outside entities.
DFD’s show the flow of data from external entities into the system, how the data
moves from one process to another, as well as its logical storage. This context-level DFD
is then "exploded" to show more detail of the system being modeled. There are only four
symbols
1. Squares representing external entities, which are sources or destinations of data.
2. Rounded rectangles representing processes, which take data as input, do something to
it and output it.
3. Arrows representing the data flows, which can either, be electronic data or
physical items.
4. Cylinder representing data base.

Context Diagram and level 0 DFD

Context diagram of Content Based Image Retrieval system contains following


information

 It contains processes like feature extraction and similarity measurements.


 It contains external entities like user inserted query image & matched results.
 We have database to store set of images
Extract Features Si
mil
(Primitives)
arit
y Matched
Query Image Results
Me
asu
re

Image Database
Features Database

Figure 3.1 Flow of work

3.3 Detailed System Design

Detail design specifies who uses the Content Based Image Retrieval system outside
the system i.e. within the environment, how the process within the system communicates
along with how the objects with in the process collaborate using both static as well as
dynamic UML diagrams in this ever-changing world of Object Oriented application
development, it has been getting harder and harder to develop and manage high quality
applications in reasonable amount of time.
As a result of this challenge and the need for a universal object modeling language
every one could use, the Unified Modeling Language (UML) is the Information industries
version of blue print. It is a method for describing the systems architecture in detail. Using
this blue print, it becomes much easier to build or maintains system, and to ensure that the
system will hold up to the requirement changes. This part also specifies the other levels of
data flow diagram.

3.3.1 Use Case View

A use case diagram presents a collection of use cases and actors and is typically
used to specify or characterize the functionality and behavior of a whole application
system interacting with one or more external actors. The users and any system that may
interact with the system are the actors. Since actors represent system users, they help
delimit the system and give a clearer picture of what it is supposed to do. Use cases are
developed on the basis of the actors needs. This insures that the system will turn out to be
what the user expected.
Use case diagrams contain icons representing actors, association relationships,
generalize relationships, packages, and use cases. A use case diagram shows the set of
external actors and the system use cases that the actors participate in. A use case
specification enables to display and modify the properties and relationships of a use case.
The information in the specification is presented textually; some of this information can
also be displayed inside the icon representing a use case. Use-case diagram is used to
depict the requirements and the users of the CBIR.
The Use-case diagram as shown in below Figure 3.4 identifies the use cases and
actors in CBIR. The use cases are

 Query by Image: Here the user gives the query image of JPEG format instead of
query by text etc.
 Database Images: This use case contain a large list of images with which the query
image is compared to extract related images..
 Feature Extraction of query image: Here the features of the query image are extracted
and stored in the temporal storage.
 Feature Extraction of database images: Here the features of the database images are
extracted and stored in the temporal storage
 Similarity Measurements: This use case carries the task of comparing the query image
features with the database images individually and the matched result is obtained.
 Output Images: Here we display the images related to query image in serial form.
Content Based Image Retrieval

Database
User Query By Image Images

« include»

Feature Feature
extraction Extraction

Similarity
Web Designers Military Measurements

Output
Images

Figure 3.2 Use Case Diagram of CBIR

The actors are

 User: user is the one present in the environment and uses the process involved in
the system.
 Military: These are a type of users who can use the system to detect intruders and
any attacks.
 Web Designers: these are another type of users who can use the system for web
designing purpose.
 Query by Image: It is the image selected by the user to make a search.
 Feature extraction: It extracts the features of both query and database images.
 Database Image: These are images stored in the database by the user.
 Similarity Measurements: It compares the features of both query and database
images.
 Output Images: The images which are similar to the query image are displayed to
the user.
3.3.2 Level 1 DFD

In this diagram we will have the detail explanation of the context diagram of the
system explained in preliminary design at the start of this chapter.

Level 1 DFD:

Query Image
It is a process and are the user provided images. The images should be of the
format JPEG. CBIR uses the RGB color space to store information.

Feature Extraction
It is an external entity which helps to store the features of both query and database
images.

Query Image Features


It is a process which extracts the features of the query images based on the
method selected.
Image Collection: It is a process which adds the images in bulk to the database.

Feature Database: It uses Mysql for database storing.

Similarity Matching: It is an entity which compares the features of the query image and
database images.

Retrieved Images: It is a process which displays the related images according to the query
image to the user.
Figure 3.3 Data Flow Model of CBIR

3.3.3 Class diagram

Class diagrams are the backbone of almost every object-oriented method including
UML. They describe the static structure of a system. Classes represent an abstraction of
entities with common characteristics. Associations represent the relationships between
classes.
Figure 3.5 is the class diagram of CBIR. The basic structure of the class diagram
arises from the classes and relationship of the system is discovered at various points in the
design process. The classes that are identified in this phase are

1.Addnew: The images to database are added individually or the folder of images can
be added simultaneously. The dialog box of image insertion successful will to be displayed.
Later the user can select the query image from any of the folder which is a real world entity.
CBIR
CBIR( )
Average RGB
BMP Loader
1 Feature Extraction
AvgRGB()
BMPLoader( ) 1 *
FeatureExtraction( )
image
1
Filter 1
Loacl Color Histogram
Add New Feature Tester
image Filter( ) *
LocalColorHistogram( )
AddNew( ) FeatureTester( )
Color Moment
image Discover Image
*
ColorMoment( ) GlobalColorHistogram
DiscoverImage( )
GlobalColorHistogram()

*
Color Conversion

ColorConversion( )
onversConversion()

Figure 3.4 Class diagram for CBIR

1. BMP loader: The image will be divided into pixels and distributed according
RGB.

2. Filter: It checks the extension of the selected query image and the images
added into the database.

4. Discover image: Checks whether the given image is in image format or text
format.

5. Feature extraction: Extracts features of given query image and images in the database.

6. Feature Tester: Tests the features of the extracted from the images.

7. AVG RGB: Calculates the Avg RGB values of the query image as well as the images
in the database.

8. Local/Global Color Histogram: The image will be divided into segments and histogram
is compared with database images.
3.3.4 Sequence Diagram

Class and object diagrams are static model views. Interaction diagrams are
dynamic. They describe how objects collaborate. A sequence diagram is an interaction
diagram that details how operations are carried out what messages are sent and when.
Sequence diagrams are organized according to time. The time progresses as you go down
the page. The objects involved in the operation are listed from left to right according to
when they take part in the message sequence.

The sequence diagram of Content Based Image Retrieval as shown below in Figure
3.6. The sequence of steps in the figure is as follows:

 Initially the user adds the images to the database and the even the query image is
given by the user. The query image should be a real world entity and is of JPEG
format.

 The search for the related images of the query image in the database is done using
methods like AVG RGB, LOCAL and GLOBAL COLOR HISTOGRAM.

 The user selects anyone of the above methods to obtain related images from the
database.

 Later the features of the query image is obtained based on the method selected by the
user and stored temporarily. In the same way the features of the database images are
extracted and stored.

The comparison between the features of the query image and the database images is
carried out.

Administrator Image Folder Group images of


Use database

Adds image to database


Inserting images to db

Images are inserted successfully


Figure 3.5 Sequence diagram of ADD NEW Module.

User Image Array Group images Similarity


Folder Buffer From db Checking
start
Query image

Avg RGB,LCH
GCH,Texture
Query features extracted

Group images
featuresextracted

Comparing features of
Query and db images
Output
(Related images and total time taken)

Figure 3.6 Sequence Diagram of Color Histogram

3.4 Summary

In this chapter we came to know briefly about the preliminary design, layout of
CBIR, technology used, design considerations, architectural strategies, modules of CBIR,
interfaces, data flow diagram, detailed system design, use case view, level 1 DFD, class
diagram, sequence diagram.
CHAPTER 4

IMPLEMENTATION

Implementation is the process of converting a new system design into an


operational one. It is the key stage in achieving a successful new system. It must therefore
be carefully planned and controlled. The implementation of a system is done after the
development effort is completed. The system is fully implemented in java, and querying an
image is implemented in Java and front page is built in java.

Steps for implementation:

1. Installation of hardware and software utilities.

2. Testing the developed system with sampled data.

3. Detection and correction of errors.

4. Data updating.

This chapter presents the implementation details for all modules that are:

Module 1: Add new module


Module 2: Color Histogram module

4.1 Add New Module

In this module administrator add the images to the database. The images to database
are added individually or the folder of images can be added simultaneously. The dialog box
of image insertion successful will be displayed. Later the user can select the query image
from any of the folder which is a real world entity. If user go ahead with future process
before adding the query image a dialog box indicating that query image is to be inserted.
The classes that are used to implement this module i.e. ADD NEW and OPEN images
from those classes specified in the design phase is as follows:

Add New

class AddNew
{
AddNew(JFrame frame, JLabel label);

Void actionPerformed(ActionEvent ae);

Image getImage(String path);

Void cons(GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx, int wy);

boolean isImage(String path);


}
Add new class prototype of module 1

The prototype of this class is specified in Add New the header file is as shown above.

AddNew(JFrame,JLabel)

Input: The frame and label of the front end screen.

Output: It creates the frame and adds the label to the created frame.

Description: This prototype creates the frame in which all the interactive process is
carried out of the user and even the label is also created. The frame size can be mentioned
by the user. It is an constructor which has the same name as the class.

void actionPerformed(ActionEvent ae)


Input: The action to be performed .

Output: The action specified by the function will be performed.

Description: The action to be performed my the buttons will be carried out by a click on
the botton. It is an in built function.This is inherited by the AddNew class.

Image getImage(String path)

Input: The path of the image.

Output: The image is obtained from the particular path provided.

Description: The images required to be added to the database can be obtained.Even the
query image is obtained and displayed on the front end screen. This is also a in built
function.

void cons(GridBagConstraints gbc, int gx, int gy, int gw, int gh, int wx, int wy)

Input: The gridBagConstraint, x and y value, width and height, weight of x and y.

Output: It obtains the gridbag constraint.

Description: The grid bag layout is added. It returns nothing to the main function hence
the return type is void. This is too a in built function in one of the java package.

boolean isImage(String path)

Input: The path of the image.

Output: True or false value.

Description: It checks whether the path mentioned to obtain the image is true or false. It
has a Boolean type of return value i.e true or false.

Class filter

Class filter
{
Filter(String[] ext)

public boolean accept(File name)

public String getDescription();

}
Class fliterclass prototype of module 1

Filter (String[] ext)

This function is used check for the image file which has .ext extension.

boolean accept(File name)

Input : The filename of the file to be loaded is specified.

Output: File is loaded with read features.

Description: this function is used to accept the file name which ends with .ext extension. It
has a Boolean type of return value i.e. true or false.

String getDescription();

This function upon true value returns a image file.


Class BMP loader

public class BMPLoader

public static int constructInt(byte[] in, int offset)

public static int constructInt3(byte[] in, int offset)

public static double constructDouble(byte[] in, int offset)

public static Image read(FileInputStream fs)

protected static Image readMap32(FileInputStream fs, BitmapHeader bh)

public static Image load(String sdir, String sfile)

public static Image load(String sdir)

BMPLoader(String a)
BMPLoader()

BMP Loader prototype module 1

static int constructInt(byte[] in, int offset)

Input:It takes an array of byte and an offset value.

Output:It returns the value of ret to the constructor.

Description: Constructs objects from the database query process. Returns the number of
database records read. Build an int from a byte array - convert little to big endian.

static int constructInt3(byte[] in, int offset)

Input: It takes an array an of byte and an offset value.

Output: It returns the value of ret to the constructor.

Description: Constructs objects from the database query process.Build an int from a byte
array - convert little to big endian and set high order bytes to 0xfff.

static double constructDouble(byte[] in, int offset)

Input:It takes an array an of byte and an offset value.

Output:It returns the value of ret to the constructor.

Description: It constructs an objects for the database query process.Build an double from
a byte array - convert little to big endian.

static Image read(FileInputStream fs)

Input:It reads an input stream file fs.

Output:It catchs an IOexception if image check is null.

Description:It reads Map24 internal routine to read the bytes in a 24 bit bitmap and
returns an image object, and it will be sure to check for (Image)null.
static Image readMap32(FileInputStream fs,BitmapHeader bh)

Input:It reads an input stream file fs and byte data that contains the file information.

Output:The Image that contains the bitmap.

Description:It readMap32 reads a 32 bit bitmap file.

static Image load(String sdir, String sfile)

Input:It takes an string directory value sdir and a string file value as sfile.

Output:Its returns the values of both sdir and sfile.

Description: The image load makes it easy to load images in either of two formats: GIF
and JPEG.

static Image load(String sdir)

Input:It takes an string directory value sdir.

Output:It returns an null if image loading catchs an IOException.

Description: If the load images is neither of two formats: GIF and JPEG than it throws an
IOException.

Class Viewer2

Class Viewer2
{
void paint(Graphics g)

Image getImage(String path)

Class Viewer prototype of Module 1

void paint(Graphics g)

This function is used to draw image size in the frame.


Image getImage(String path)

Input : The function takes path as a string.

Output: The Path of the image will be obtained.

Description: This function is used get path of the image with the extension .jpg or.fig

Class UserDAO

Connection getConnection()

This function gets connection with the local host.

void closeConnection()

This function closes the connection connected to the local host.

boolean insert(String name, String description, String path)

The function takes name, description and the path of the image and stores into the data
base

public class UserDAO

{
Connection getConnection()

void closeConnection()

boolean insert(String name, String description, String path)

boolean preInsert(String path)

int retrive()

UserDAO prototype of Module 1

boolean preInsert(String path)


This function is used to insert the image as query image as specified in the path.

int retrive()

This function is used to retrieve a set of images from the databases which is similar to

the query image.

Exceptions in Java

 Throw able Class

The Throw able class provides a String variable that can be set by the subclasses to
provide a detail message that provides more information of the exception occurred. All
classes of throwables define a one-parameter constructor that takes a string as the detail
message.
The class Throw able provides get Message () function to retrieve an exception. It has
a printStackTrace () method to print the stack trace to the standard error stream. Lastly It also
has a toString () method to print a short description of the exception. For more information on
what is printed when the following messages are invoked, please refer the java docs.
Syntax

String getMessage()

void printStackTrace()

String toString()

 Class Exception
The class Exception represents exceptions that a program faces due to abnormal or
special conditions during execution. Exceptions can be of 2 types: Checked (Compile time
Exceptions)/ Unchecked (Run time Exceptions).

 Class RuntimeException
Runtime exceptions represent programming errors that manifest at runtime. For
example ArrayIndexOutOfBounds, NullPointerException and so on are all subclasses of the
java.lang.RuntimeException class, which is a subclass of the Exception class. These are
basically business logic programming errors.

 Class Error
Errors are irrecoverable condtions that can never be caught. Example: Memory leak,
LinkageError etc. Errors are direct subclass of Throwable class.

4.2 Average RGB

The red, green and blue color intensity of query image is calculated and compared
with the RGB values of database images and related images are displayed as output.

AverageRGB

public class AverageRGB extends FeatureExtractionModule


{

public AverageRGB();

public Vector getFeatureVector(DiscovirImage discovirimage);

public double compareFeatureVector(Vector vector, Vector vector1);

}
AverageRGB prototype of Module 2

AverageRGB()

Input:No input is given.

Output:Adds the description of the image features.

Description: The name, length, category version and the description of the feature of the
image will be added.

Vector getFeatureVector(DiscovirImage discovirimage)

Input:The discovered image i.e the image of the JPEG format.

Output:The vector of the features extracted from the image.

Description: The RGB pixels of the image are considered and the total value of the red,
blue and green is extracted. These obtained values are returned as the vector to the calling
function.

double compareFeatureVector(Vector vector,Vector vector1)

Input: The vector value features of the query image and the vector of the database images.
Output: The value obtained after the calculation.

Description: The vectors of the query image and the each and every image of the database
image are compared. If the relevant value is obtained then the database images is added to be
output list of images.

4.3 Local Color Histogram

The image will segmented into and color histogram of each block will be obtained.
We calculate the distance, using their histograms, between a region in one image and a
region at same location in the other image in database.

LOCAL COLOR HISTOGRAM

public class LocalColorHistogram

public LocalColorHistogram()

public Vector getFeatureVector(DiscovirImage image)

public Vector getFeatureVector(DiscovirImage image, int d)

private int decideLocal(double j, double w, double h, int d)

public double getThreshold()

Local Color Histogram prototype of Module 2

Local ColorHistogram()

Input:No input is given.

Output:Adds the description of the image features.

Description: The name, length, category , version and the description of the feature of the
image will be added.

Vector getFeatureVector(DiscovirImage image)

Input:The discovered image i.e the image of the JPEG format.


Output:The vector of the features extracted from the image.

Description: The image is segment into blocks and then obtains a color histogram for each
block. When comparing two images, we calculate the distance. The distance between the
two images will be determined by the sum of all these distances. These obtained values are
returned as the vector to the calling function.

Vector getFeatureVector(DiscovirImage image, int d)

Input: The discovered image i.e. the image of the JPEG format and distance is taken.

Output: The vector of the features extracted from the image.

Description: The image is segment into blocks and then obtains a color histogram for each
block. When comparing two images, we calculate the distance. The distance between the
two images will be determined by the sum of all these distances. These obtained values are
returned as the vector to the calling function.

int decideLocal(double j, double w, double h, int d)

Input: It takes width, height and distance of a given image and double variable.

Output: It returns the area of the image.

Description: using width, height and distance it calculates the distance between the query
image and the database images and displays the best matched images as output.

4.4 Global Color Histogram:

Same as the local color histogram but considers all the regions of the image.The
classes that are used to implement this module i.e. Color Histogram from those classes
specified in the design phase is as follows:

GLOBALCOLORHISTOGRAM:

GlobalColorHistogram()

Input: No input is given.

Output: Adds the description of the image features.


Description: The name, length, category, version and the description of the feature of
the image will be added.

Vector getFeatureVector(DiscovirImage image)

Input: The discovered image i.e. the image of the JPEG format.

Output: The vector of the features extracted from the image.

Description: The color histogram depicts color distribution using a set of bins. Using
the GCH, an image will be encoded with its color histogram, and the distanc between two
images will be determined by the distance between their color histograms.This obtained
values are returned as the vector to the calling function.

public class GlobalColorHistogram extends FeatureExtractionModule

public GlobalColorHistogram()

public Vector getFeatureVector(DiscovirImage image)

}
Global Color Histogram prototype of Module 2

FEATURE TESTER

public class FeatureTester

static void processFile1(File fileHandle)

void processFile(File fileHandle)

void compute()

Feature Tester prototype of Module 2

Static void processFile1 (File fileHandle)


This function process for an image file using a DiscovirImage() function to check
whether the file is a image or a text file.

Void processFile(File fileHandle)

This function process for the images in the database as per the features of the query
image and will display the total time consumed to read the images from the data base.

Void compute()
This function is used to compute feature vectors of the query image and the
database images.

FEATURE EXTRACTION

public abstract class FeatureExtractionModule


{
public FeatureExtractionModule()

public double getThreshold()

public String getFeatureName()

public abstract Vector getFeatureVector(DiscovirImage discovirimage);

public Vector getFeatureVector(BufferedImage image)

public double compareFeatureVector(Vector a, Vector b)

public double compareFeatureString(String a, String b)

public String vector2String(Vector vec)

public Vector string2Vector(String str)

Feature Extraction prototype of Module 2

String getFeatureName()

It gives the name of the feature extraction method used for that particular
search.

abstract Vector getFeatureVector(DiscovirImage discovirimage)

Input: The discovered image i.e. the image of the JPEG format.

Output: The vector of the features extracted from the image.

Description: The feature extraction is done using methods as avg rgb,local and global
color histogram etc and distance values are calculated. This obtained values are returned as
the vector to the calling function.

double compareFeatureVector(Vector a, Vector b)

Input: The vector value features of the query image and the vector of the database images.
Output: The dimensions of the both images are given.

Description: The vectors of the query image and the each and every image of the database
image are compared. If the relevant value is obtained then the database images is added to
be output list of images.

double compareFeatureString(String a, String b)

Input: The string value features of the query image and the string value of the database
images.
Output: The value obtained after the calculation.

Description: The string value of the query image and the each and every image of the
database image are compared. If the relevant value is obtained then the database images
is added to be output list of images.

String vector2String(Vector vec)

Input: The vector value of the vectors.

Output: The converted string value is obtained.

Description: All the values that are stored in vector are converted into a string value.

Vector string2Vector(String str)


Input: It takes the string value.

Output: The converted vector value is obtained.

Description: After the process got over all the string values are converted back into vector
values.

Creation of User profiles and access rights

There are two types of users in Robust Content Based Image Retrieval.

1. Admin Login
2. User Login
Admin User

Admin is the super user and he has all the rights over the database.

Admin has the rights to create new user or members to access the RCBIR system.

Admin can create and change the user profiles.

Admin can add new images or change the details of the images in the database.

Admin has the full rights to update/modify the details in the database.

User profile

User can access the images in the database by passing an input image as parameter.
User can have a look at the images in the database but doesnot have any rights to
modify or create new image in the database.

4.5 Summary

In this chapter we came to know briefly about the implementation of Add New
Module, Average RGB, Local Color Histogram, Global Color Histogram.
Chapter 5

TESTING
This chapter gives the outline of all the testing methods that are carried out a get a bug
free system. Quality can be achieved by testing the product using different techniques at
different phases of the project development.

5.1 Testing process

Testing is an integral part of software development. Testing process, in a way


certifies, whether the product, that is developed, compiles with the standards, that it was
designed to. Testing process involves building of test cases, against which, the product has to
be tested. In some cases, test cases are done based on the system requirements specified for
the product/software, which is to be developed.

5.2 Testing objectives

The main objectives of testing process are as follows:

1. Testing is a process of executing a program with the intent of finding an error.

2. A good test case is one that has high probability of finding an as yet undiscovered
error.

3. A successful test is one that uncovers an as yet undiscovered error.

5.3 Levels of testing

Different levels of testing are used in the testing process; each level of testing aims to
test different aspects of the system. The basic levels are unit testing, integration testing,
system testing and acceptance testing
5.3.1 Unit Testing

Unit testing focuses verification effort on the smallest unit of software design the
module. The software built, is a collection of individual modules. Each module performs a
unique function. In this kind of testing, exact flow of control for each module was verified.
With detailed design Considerations used as a guide, important control paths are tested to
uncover errors within the boundary of the module.

The Unit Test can be conducted in parallel for multiple modules. Table 5.1 shows the
test conducted on the basic module of the system ie insertion of the new image. Table 5.2
shows the test conducted on the color histogram and texture modules.

 Module to open and insert images:

Table 5.1 Test Cases for FILE opening and ADD NEW Module

Steps Action Expected Results

Step 1 Execution of CBIR.java The project is opened in


as show in snapshot1 of java swing as shown in
Appendix A. Snapshot 2 in Appendix
A.

Step 2 Click on Enter button in The Snapshot3 of


snapshot2 of Appendix A. Appendix A should be
displayed.

Step 3 Click on NEW menu Choose an Image or a


shown in Snapshot4 of Folder to add images to
Appendix A. the database (MySQL
yog). If the images are
successfully inserted
DialogBox1 of Appendix
A will be displayed.

Step 4 Click on FILE menu of The snapshot6 of


Snapshot5 of Appendix A. Appendix

Click on the folder A should be displayed.


containing images to
select query image from
Step 5 The Snapshot7 of
the system
Appendix A should be
displayed.

 Modules processing Color Histogram:

Table 5.2 Test Cases for modules color histogram.

Test Case Description Check the properties of all objects in


running module 2 and 3.

Steps Action Expected Results

Step 1 Click on Color Snapshot8 of Appendix


Histogram menu shown A is displayed.
in Snapshot3 of
Appendix A.

Step 2 Click on any one of the The Snapshot9 of


options of Color Appendix A should be
Histogram menu i.e. displayed. Here the
AverageRGB, Local resultant images are
and Gobal Histogram displayed as per options
which are shown in selected.
Snapshot8 of Appendix
A.

5.3.2 Integration testing

The second level of testing is called integration testing. In this, many class-tested
modules are combined into subsystems, which are then tested. The goal here is to see if all
the modules can be integrated properly. We have integrated all the classes and have checked
for compatibility. Errors obtained are identified and debugged.

5.3.3 System Testing

Here the entire software system is tested. The reference document for this process is
the requirements document, and the goal is to see if the software meets its requirements.

Debugging is not always easy. Some bugs can take a long time to and. Debugging
concurrent code can be particularly difficult and time consuming. It helps to understand the
language and its libraries. A common source of errors in Java is to use libraries without
properly understanding what methods do and how they work. For example, one might forget
to call a method to initialize an object.
It is a good idea to add toString methods to your own classes. Then when debugging
you can simply print out an object of that class and see some of its data. You will see this in
the example below. It is also a good idea to add a main method to your class, which does
some testing of that class. Then the class can be executed directly and you can test your
classes separately.
Each module and component was thoroughly tested to remove bugs through a System
testing strategy. Test cases were generated for all possible input sequences and the output was
verified for its correctness. Test cases for system testing are mentioned below.

Table 5.3 Test Cases for Content Based Image Retrieval System

Test Case Description Check the properties of all objects in


running system.

Steps Action Expected Results

Step 1 Click on Color The retrieved images are


Histogram menu of displayed as shown in
Snapshot8 of Appendix Snapshot9.
A.

Step 2 Click on Texture menu The Snapshot11 of


of Snapshot10 of Appendix A is
Appendix A. displayed where
retrieved images are
displayed.

Validation Checks

1. Login Page:

Validation is done when

 Username is empty.

 Password is empty.

 Authentication of username and password.

2. Admin Login:

Validation is done when creating new user.

 UserID is empty.

 Password is empty.

Validation is done when admin uploads new image to the database.

 Name of the image to be uploaded is empty.

 Description of image to be uploaded is empty

Validation is done when admin uploads new image folder to the database.

 Name of the image to be uploaded is empty.

 Description of image to be uploaded is empty

3. User Login:

Validation is done when user opens a files from the local drive as an input
image.

 Name of the image to be uploaded is empty.

 Description of image to be uploaded is empty


5.4 Summary

In this chapter we came to know briefly about the testing process, testing objectives,
levels of testing which includes unit testing, integration testing and system testing.

CHAPTER 6

CONCLUSION AND FUTURE ENHANCEMENT

6.1 Conclusion

The need for Content- Based image retrieval is to retrieve images that are more
appropriate, along with multiple features for better retrieval accuracy.“Content-based”
means that the search makes use of the contents of image themselves, rather than relying
on human-inputted metadata such as captions or keywords. The similarity measurements
and the representation of the visual features are two important tasks in Content-Based
Image Retrieval (CBIR).Given a query image, with single object present in it; mission of
this work is to retrieve similar kind of images from the database based on the features
extracted from the query image. We use content- based search, for high accuracy multiple
features like color, texture and shape is incorporated. In this project, we implemented a
CBIR system based on multiple features representations which include: Color Feature
through GCH & LCH. Color feature extraction is done through “Global Color Histogram
(GCH)” and “Local Color Histogram”.

6.2 Future Enhancement

The further enhancements of the project are as follows:

 To reach 100% of accuracy


 We are currently extending the system to deal with range of aspects such as
the display of name and description of query and resultant images on the
output screen.

References
[1] John Eakins and Margaret Graham, “Content-based Image Retrieval”, JISC
Technology ApplicationsProgramme. University of Northumbria at Newcastle.
January 1999

[2] Rui Y. & Huang T. S., Chang S. F. “Image retrieval: current techniques,
directions, and open issues”. Joumal of Visual Communication and Image
Representation, 10,39-62,.

[3] Karin Kailing, Hans-Peter Kriegel and i Stefan Schonauer, “ Content-Based


Image Retrieval Using Multiple Representations”. Proc. 8th Int. Con€. On
Knowledge-Based Intelligent Information and Engineering Systems
(KES’2004), Wellington,New Zealand, 2004, pp. 982-988. I

[5] Ahmed M.Ghanem, Emad M. Rasmy, and Yasser M, Kadah, “Content-Based


Image Retrieval Strategies for Medical Image Libraries,” Proc. SPIE Med.
Imag., San Diego, Feb.2001

[6] Henning Muller, Wolfgang Muller, David McG. Squire and Thierry Pun,
Performance Evaluation in Content-Based Image Retrieval: Overview and
Proposals. Computing Science Center, University of Geneva, Switzerland, 2000.

[7] http://www.unn.ac.uWiidr/report.htrnl.

[8] http://wang.ist.psu/~jwang/test.html.

[9] Shengjiu Wang, “A Robust CBIR Approach Using Local Color Histograms,”
Department of Computer Science, University of Alberta, Edmonton, Alberta,
Canada, Tech. Rep. TR 01-13, October 2001, Found at:
[10] Raghu Krishnapuram, Swarup Medasani, Sung-Hwan Jung, , Young-Sik Choi,
and Rajesh Balasubramaniam “Content-Based Image Retrieval Based on a
Fuzzy Approach” OCTOBER 2004.

[11] S. Kulkarni, B. Verma1, P. Sharma and H. Selvaraj “Content Based Image


Retrieval using a Neuro-Fuzzy Technique” 2005.

[12] Wang Xiaoling, Xie Kanglin, “Application of the Fuzzy Logic in Content-based
Image Retrieval1” April 2005.

[13] Rouhollah Rahmani, Sally A. Goldman, Hui Zhang, John Krettek, and Jason E.
Fritts “Localized Content Based Image Retrieval” MIR’05,

[14] Ying Liua, Dengsheng Zhanga, Guojun Lua,Wei-Ying Mab “A survey of


content-based image retrieval with high-level semantics” 2006

[15] Giorgio Giacinto “A Nearest-Neighbor Approach to Relevance Feedback in


Content Based Image Retrieval”
Appendix A

Snapshots

Figure A1 shows snapshot of the execution of the Java file specifying to open the
project. Once the command prompt is displayed we execute using javac command, which
will internally call the java complier to compile and execute the file
BackgroundImagePanel.java file to open the first output page of the project.
Figure A1 Execution of The Java File

Figure A2 shows snapshot of the front page of the system from where the
application should run. Here display of front page along with Enter button is shown. On
this page when Enter button is clicked it proceeds to the next output page of the project i.e
Snapshot 3
Figure A2 Front Page of The Application

Figure A3 shows snapshot of the login page of the system from where the
application should run. Here display of login page along with user ID Textfield, user
password Textfield and Login button is shown. On this page when authentic user ID and
user password is given and then Login button is clicked it proceeds to the next output page
of the project i.e Snapshot 4.
Figure A3 Login Page .
Figure A4 shows snapshot of Administrator main screen with menu options. The
menu options such as User, File, Color Histogram and New can be selected to perform a
particular function.

Figure A4 Administrator Main Screen With Menu Options


Figure A5 shows snapshot of module 1 of the system. The snapshot4 shows the
User ID Textfield, User role Combobox, password Textfield, confirm password Textfield,
submit and reset button. Here a User can be added to the Database using the Submit button
which is shown in the snapshot below.

Figure A5 Administrator Adding New User


Figure A6 shows snapshot of deleting the User from the system. The snapshot4
shows the User ID Textfield, User role Combobox, delete and reset button. Here a User
can be deleted by Administrator from the Database using the Delete button which is shown
in the snapshot below.

Figure A6 Administrator Deleting The User


Figure A7 shows snapshot of adding images to database. The snapshot 7 shows the
New menu and the options available with it which are AddNewImage and AddNewFolder.
Here a single image can be added to the Database using the AddNewImage option which
is shown in the snapshot below. The entire folder of images can also be added to the
Database using AddNewFolder option which is shown in the snapshot below.

Figure A7 Main Screen To Add An Image Or A Folder Options


Figure A8 shows snapshot of module 1 of the system. The snapshot 8 shows the
File menu along with the Open option with it where the query image is opened for the
project.
Figure A8 Main Screen To Open A Query Image
Figure A9 shows snapshot where the query image from the folder selected is displayed.

Figure A9 Displays The Query Image From The Folder


Figure A10 shows snapshot of module 2 of the system. The snapshot 10 shows the
Color Histogram menu and the options available with it which are Average RGB, Local
Color Histogram, Global Color Histogram.

Figure A10 Menu Options For Color Histogram


Figure A11 shows snapshot of output of module 2 of the system. The snapshot 11
shows the output of Color Histogram menu and the options available with it which is
Average RGB. The red, green and blue color intensity of query image is calculated and
compared with the RGB values of database images and related images are displayed as
output. It also displays the Total time used.

Figure A11 Average RGB


Figure A12 shows snapshot of output of module 3 of the system. The snapshot 12
shows the output of Color Histogram menu and the options available with it which is
GlobalColorHistogram. The image will segmented into and color histogram of each block
will be obtained. We calculate the distance, using their histograms, between a region in
one image and a region at same location in the other image in database. It also displays the
Total time used.

Figure A12 Global Color Histogram


Figure A13 shows snapshot of output of module 4 of the system. The snapshot13
shows the output of ColorHistogram menu and the options available with it which are
LocalColorHistogram. Global color histogram of each block will be obtained. We
calculate the distance, using their histograms, between a region in one image and a region
at same location in the other image in database. Same as the local color histogram but
considers all the regions of the image. It also displays the Total time used.

Figure A13 Local Color Histogram

You might also like