Finding Similarity Between Images



Click here for a larger image.

Environment: MFC

Content-Based Image Retrieval (CBIR) is a way to index or find a similarity between images in a multimedia database. There are methods such as Fourier Transform, Hough Transform, Wavelet Transform, Gabor Transform, and Hadamard transform coefficients to be used as the engine in the CBIR system. Retrieval by image content has received great attention in the last decades. Several techniques have been proposed to solve the problem of finding or indexing images based on their contents. Each method used have strong and weak points.

In this article, I try to give a sight view about CBIR because this kind of topic is the most frequently asked question in Digital Image Processing. Here I used the CxImage library from Davide Pizzolato. The latest version of CxImage library contains a function to transform an image into its frequency domain; that is, the FFT2() function. The technique I used here is not really efficient, but at least will be a guide for you to learn more advanced CBIR. If you want more efficient method try to follow this link:
http://debut.cis.nctu.edu.tw/pages/slides/jeffrey/present2.pdf.

There are four steps to performing image retrieval based on their similarity:

  1. Load Query Image (the image we want to search for or find images similar to this).
  2. Generate Signature of Key Image using Fourier Transform.
  3. For every image in the database, load and generate the signature.
  4. Calculate Euclidean Distance for Key Image Signature and Database Image Signature.
  5. Put the value in an auto-sorted listbox to make similarity investigation easier because the smallest value stays in the top of the list and steps down for similar images.

The image similarity depends on Euclidean Distance. The smaller the distance, the more similiar the image. In measuring similarity, there are few famous math formulas such as Dice similarity coefficients, Jackard, Otsuka, Simpson, Manhattan, Robinson, and more.

The libraries used are:

That's all there is to it!

Danang Suharno
Ngadinegaran MJ 3/156
Yogyakarta 55143
Indonesia
http://www.geocities.com/kinclong2

Downloads

Download source - 41 Kb


Comments

  • to support space " " in file path

    Posted by jauming on 09/03/2007 05:43am

    void CNggolekiGinambaranDlg::OnSelchangeListFounded() 
    {
    	CString strTemp1;
    	CString strTemp2;
    	CStringArray strArr;
    	CTokenEx t;
    
    	m_ListFound.GetText(m_ListFound.GetCurSel(),  strTemp1);
    
    	//:20070903: support space " " in file path
    	t.Split(strTemp1, " - ", strArr);	
    	m_imgFound.Load(strArr[1], CXIMAGE_FORMAT_JPG);
    
    	RefreshDisplay();
    	
    }

    Reply
  • comparing two RGB values of two BMP files

    Posted by biresh on 09/20/2006 01:12am

    I want to know, how i can compare the RGB values of two BMP file to solve the problem of jigsaw puzzle and to find out is there any similarity between the images are exist or not.

    Reply
  • Cannot open include file: 'ximage.h'

    Posted by h.tarik on 04/08/2004 04:47am

    when i build this program, the error above occured.please help me to run it.thanks in advance.

    • for the help

      Posted by kiwamu on 12/26/2006 01:52am

      go: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=382886&SiteID=1 for the help

      Reply
    Reply
  • Cannot open include file: 'ximage.h'

    Posted by h.tarik on 04/07/2004 02:26pm

    when i build this program, the error above occured.please help me to run it.thanks in advance.

    Reply
  • fatal error LNK1104: cannot open file "j2000.lib"

    Posted by Legacy on 02/17/2004 12:00am

    Originally posted by: hatim

    When I compile this program,the error above occurs.
    How can I resolve this problem?
    Thank for your help

    Reply
  • comment

    Posted by Legacy on 01/09/2004 12:00am

    Originally posted by: S.Karthikeyan

    when i have download the source code(41kb), and open it in visual C++, but can not find the ximge.h which may be contained in the cxImage lib, how can add lib into the your source code? 
    

    Reply
  • jpeglib.h !! ?

    Posted by Legacy on 12/11/2003 12:00am

    Originally posted by: djouak

    when i compile a code , i have a problem with this file, the code can't find "jpeglib.h" ?!!!
    can you help me ?


    thank's

    Reply
  • Hla iki cah Jogja toh tibake, hebat salut Dab!

    Posted by Legacy on 10/22/2003 12:00am

    Originally posted by: Firdaus Effendy

    Lha iyo, wong aku pas goleki artikel Bitmap Comparison, kok nemu artikel panjenengan kie. Suwun lho mas. Pisan maneh, sampeyan hebat.

    Reply
  • same function written in c#?

    Posted by Legacy on 09/11/2003 12:00am

    Originally posted by: Oliver

    hi,

    i'm coding in c# and looking for libraries or tools in c#, because i have difficulties to link the CXImage library to my projects. The VisualStudio IDE doesn't accept the above mentioned libraries.

    thanks Oliver

    Reply
  • Very nice program...

    Posted by Legacy on 05/29/2003 12:00am

    Originally posted by: Bo Kohut

    I am working to translate it from the native language to english. I also optimized the compile for P3 on my machine... what a cpu hog this program is but it is very good for what it says it does!

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Flash technology is becoming more prominent in the storage industry. Offering superior speed and reliability when compared to traditional hard disk drives – flash storage is a flexible and increasingly cost-effective technology that can be used to optimize enterprise storage environments. This ebook explores the many uses and benefits of flash storage technology in the enterprise. Check it out to discover and learn all you need to: Optimize storage performance Leverage server flash as storage cache …

  • Event Date: April 15, 2014 The ability to effectively set sales goals, assign quotas and territories, bring new people on board and quickly make adjustments to the sales force is often crucial to success--and to the field experience! But for sales operations leaders, managing the administrative processes, systems, data and various departments to get it all right can often be difficult, inefficient and manually intensive. Register for this webinar and learn how you can: Align sales goals, quotas and …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds