Click here to Skip to main content
Click here to Skip to main content

Finding Similiar Images

, 24 Sep 2002
Rate this:
Please Sign up or sign in to vote.
This article gives an overview of Content-Based Image Retrieval
<!-- Download Links -->


Content-Based Image Retrieval (CBIR) should be the right title for this article. 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, Hadamard transform coefficients to be used as engine in CBIR system. Retrieval by image content has received great attention in the last decades. Several techniques have been proposed to the problem of finding or indexing images based on their contents. Each method used has strong and weak points.

In this article I try to give an overview view about CBIR because this kind of topics is the most frequently asked question in Digital Image Processing. Here I used CxImage library from Davide Pizzolato ( The latest version of CxImage library contain a function to transform an image into it's frequency domain that is FFT2 function. The technique I used here is not really efficient but at least this article will guide you to more advanced CBIR.

If you want more efficient method try to follow this links and

Finding Similiar Images

There are 4 steps to perform image retrieval based on the similarity:

  1. Load Query Image (Image we want to search for or find images similar to this) 
  2. Generate Signature of Key Image using Fourier Transform 
  3. For every images 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 a auto-sorted listbox to make similarity investigation easier because smallest value stay in the top of the list and step down for similar images.

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

The libraries used:

  1. CxImage (
  2. CTokenEx Written by Daniel Madden (
  3. CDirDialog (I forgot the creator)


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Danang Suharno Ngadinegaran
Web Developer
Indonesia Indonesia
No Biography provided

Comments and Discussions

QuestionThe code can not be compiled , There l cannot find ximage.h and any lib files. should I download these files ? 3x PinmemberMember 443190029-Dec-13 16:37 
AnswerRe: The code can not be compiled , There l cannot find ximage.h and any lib files. should I download these files ? 3x PinmemberMember 1083152320-May-14 3:08 
Questioncompile PinmemberSu-Jin Oh21-Feb-13 19:33 
why i cant' compile this project?
how can i do?
QuestionPlease remember PinmembereRRaTuM22-Nov-11 1:29 
GeneralMy vote of 1 PinmembereRRaTuM22-Nov-11 1:26 
Generalcbir using color histogram MATLAB code Pinmemberwanlovewan18-Oct-10 13:10 
Questioncannot upload images Pinmembervarshanth28-Jan-10 21:29 
Generalto display images in matlab guide frame or listbox Pinmemberanjan kumar sahoo1-Dec-09 18:35 
Generalupdate from cimage.lib Pinmemberxpjandy29-Oct-09 18:01 
QuestionHow to use this in RGB color space? Pinmemberczwarty20-Oct-09 9:02 
GeneralI have the same problem is “unresolved external symbol "public: bool __thiscall CxImage::Load(unsigned short const *,unsigned long)" (?Load@CxImage@@QAE_NPBGK@Z)” Pinmemberliuyang_bnu11-May-09 22:26 
RantPost an .exe-file Pinmemberandycpp3-May-09 9:38 
GeneralLinks not found: PLS help PinmemberMember 432247112-Mar-09 1:53 
Generalsame code in matlab Pinmemberpradyuvishal10-Mar-09 6:10 
GeneralRe: same code in matlab PinmemberGAURAV JASWAL7-Dec-09 23:58 
Generalmatlab Pinmembermaryam2222-Feb-09 9:36 
GeneralCBIR Pinmembereipro22-Dec-08 4:19 
QuestionCan I find the same system in Matlab Pinmemberahmedabdu15-Dec-08 18:40 
Generali have build it successfully Pinmemberahlawat.arun@gmail.com13-Nov-08 20:45 
GeneralRe: i have build it successfully Pinmemberadamdcg3-Dec-08 22:58 
GeneralRe: i have build it successfully Pinmemberadamdcg4-Dec-08 0:00 
GeneralRe: i have build it successfully Pinmembercnbjliuaihua1-Jun-12 4:00 
GeneralRe: i have build it successfully Pinmembercnbjliuaihua1-Jun-12 18:10 
GeneralRe: i have build it successfully Pinmemberjoprem8-Mar-12 0:58 
QuestionErrors when compile Pinmembertkc_tran12-Nov-08 19:28 
AnswerRe: Errors when compile Pinmemberxpjandy29-Oct-09 17:58 
Generalcompiler for this project Pinmembertkc_tran12-Nov-08 15:20 
Generalgabor function Pinmemberradudragota29-May-07 8:52 
GeneralI have built this project successfully PinmemberKevinChen28-Dec-06 21:07 
GeneralRe: I have built this project successfully Pinmemberfelixhsu3-Jun-07 5:47 
GeneralRe: I have built this project successfully Pinmemberjoprem8-Mar-12 0:57 
GeneralRe: I have built this project successfully Pinmemberjoprem26-Mar-12 23:31 
GeneralEnquiry about the whole program Pinmemberkeigotheboss19-Oct-06 7:41 
Generalerror C2039: 'Load' : is not a member of 'CxImage' Pinmembernaraimha1-Jul-06 0:39 
Generalplz give me compiled exe file. PinmemberMyoung-Gyu Kim6-Jun-06 19:07 
Questionwhere is demo.lib? Pinmember12345life28-Feb-06 21:20 
Generalwhy Pinmemberali2121212121212110-Feb-06 1:13 
Generali have serious problem PinmemberTassadaqHussain9-Aug-05 12:28 
GeneralRe: i have serious problem Pinmemberuumeme22-Aug-05 19:38 
GeneralRe: i have serious problem Pinmemberuumeme12-Sep-05 2:16 
Generalhelp me to execute this project Pinmemberspike2028-Jul-05 4:53 
GeneralRe: help me to execute this project PinmemberMyoung-Gyu Kim6-Jun-06 17:27 
GeneralTell me where is demo lib PinmemberTassadaqHussain21-Jul-05 21:46 
GeneralMissing the file j2000.lib Pinmembertoknow2-Jun-05 3:01 
GeneralRe: Missing the file j2000.lib PinmemberMyoung-Gyu Kim6-Jun-06 17:23 
Generalerror:cximage.lib PinsussAnonymous24-May-05 19:59 
Generalwhere is the &quot;ximage.h&quot; Pinmemberzhang030112719-May-05 16:49 
GeneralRe: where is the &quot;ximage.h&quot; PinmemberWREY20-May-05 6:16 
GeneralRe: where is the &quot;ximage.h&quot; Pinmemberdjechelon10-Jan-08 5:27 
GeneralCrash when iPixelSize=3; Pinmemberseiby31-Mar-05 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150224.1 | Last Updated 25 Sep 2002
Article Copyright 2002 by Danang Suharno Ngadinegaran
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid