# Thread: How to compare images to check the similarity?

1. Member
Join Date
Dec 2009
Posts
14

## How to compare images to check the similarity?

I am beginner(fresher) programmer in this vast programming language. Right now i am learning programming languages like Java, C++, C sharp, DBMS and PHP. I just love to learn new-new invention(things) in the programming world. I am doing a project, in which i want to compare the two images and check whether it is similar or not? Please any one can help me.

2. Member
Join Date
Apr 2008
Posts
1,949

## Re: How to compare images to check the similarity?

Good question asked by you. Most of the people gets problem in this comparison of two images, it is not that easy also, but not impossible also. Till my knowledge of the programming language, i think there three ways to achieve this comparison of images, to check their similarity. The three steps are as follows:
1] You can convert the two images to an array of integer.
2] Also compare the two arrays.
3] And after that decide if they are a similar or not.
Hope your problem will be solved soon.

3. Member
Join Date
May 2008
Posts
2,015

## Re: How to compare images to check the similarity?

I think that the comparison of the images contents is not that a simple task, and in many cases, a ill-defined one. To check whether both(2) images are equal or not, hope it can be done by simple function or operator which can return true or false and/or may be a value that is 0 and 1, where 0 means different, 1 means equal and intermediate values can be considered different degrees of similarity. Hope your problem will be fix soon.

4. Member
Join Date
Apr 2008
Posts
2,010

## Re: How to compare images to check the similarity?

According to me, the comparing of images is not an easy job to do. I think you will need someone how is good/expert in the programming. There are some ways through which you can achieve the comparison of the images. Firstly, locate the ROI(Region of Interest, where the objects appear in the given image), now resize the ROIs into a common size. After that, do substraction of ROIs and calculate the Black and White Ratio of the resultant image after subtraction. Hope this would help you.

5. Member
Join Date
May 2008
Posts
2,302

## Re: How to compare images to check the similarity?

I think you need good experience to develop the program on the comparison of the images. The programming language is very deep to understand and learn. To compare the two images is a very long process. The comparison of two images can be done by counting the pixel-by-pixel, which very long and time consuming process. I would suggest you to search "image processing" on GIMP's website and you can find source code of the program. Hope your problem will be fix.

6. Member
Join Date
Jan 2008
Posts
1,521

## Re: How to compare images to check the similarity?

Actually i also have the same issue as of yours, i also wants know to compare two images. My aim is little bit different from yours, i have two images on a JFrame and they are represented by labels. One is generated randomly and i want to compare it to another and if both of them are same, then a message dialog box is shown stating that the images are the same or else showing images are no same.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•