Skip to content

farhan0581/CBIR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Based Image Retreival System

Brief:

It is basically a simple image search engine, which retreives the similar images from the database on the basis of comparison between their features.Two different methods have been implemented for this purpose--

1.Color Histogram method which compares images on the basis of color similarity between them.Color histogram of 8X12X3 bins is used.As a result each image is represented as 288 floating point numbers,further each image has been divided into five segments for localization.So per image we are storing 5 X 288 numbers.These features are then stored in a CSV file for future matching

2.ORB feature detection algorithm which matches on the basis of distance between the keypoints. The ORB algo returns the keypoints and their descriptors for the image provided.These descriptors are stored in the Mysql database as BLOB's.For matching the descriptors for query image and database images are passed to the function one by one.The function returns the distance matrix.Here i have taken the sum of these distances and stored them in a dictionary(per image).Then the top results are displayed.

Technologies used:

  • Python 2.7
  • OpenCv 3.0 for Image processing
  • Numpy for mathematical calculations
  • Tkinter for GUI
  • Mysql Database
  • Other python libraries like Mysqldb,Pickle etc

Usage:

  • Install all the requirements as stated above.Project is in my_contrib folder.
  • change the paths and database table name,fields in the files index.py,search.py,save_data.py and search_img.py
  • Run the main.py script
  • Select the method from dropdown provided
  • Enter the path of CSV file for indexing in case of color histogram and folder path as required, it can be made dynamic as required,i have,however fixed the paths.
  • finally enter one of the image in the dataset as query image(full name)
  • click on search to find the similar images

Results:

For images which have been either cropped,rotated or blurred , but are similar on the basis of their content ,ORB gives good result.But for images which are similar in color content,Color Histogram is good.It depends upon the scenerio.

Bugs:

1. There is some problem with tkinter and opencv imshow, as after displaying the results the tkinter window has to be forced close every time

2. The accuracy of ORB needs to be improved

For further queries and improvement drop a mail on farhan0581@gmail.com

About

Content based image retreival

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages