farhan0581 / CBIR

Content based image retreival
1 stars 4 forks source link

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:

Usage:

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