# image comparsion

• January 12th, 2013, 08:24 AM
larbie
image comparsion
hello :)
i am student and working on my final project which is related to image comparison and semantic image searching.i started image comparison on the bases of RGB but it is not a good technique when image is in different size or in different format.
i want to know which techniques can i use to get more efficiency in it and also for semantic image searching .
• January 12th, 2013, 09:47 AM
copeg
Re: image comparsion
What are you trying to compare between the two images? You say 'search', are you trying to search an image for something? Color, feature, sub-image? What does your algorithm currently compare?
• January 13th, 2013, 05:10 AM
larbie
Re: image comparsion
1 have to complete 2 task.1st to compare images and 2nd to show user other images which are related to user given image.
I m not finding any specific feature from image, just trying to show how similar two or more images on the base of color and feature.I m beginner in image processing so I started on the base of color.My algo is simple it gets the RGB value of every pixel from the images and then store separately in 2 arrays then compare them.if 2 images pixels values are totally similar then it show 100% otherwise show the percentage according to similar pixels.
My algo is going well for images of same size,, greysacle and also it giving efficient result if one image position is different(rotated,flip).

"Problem" is when both images are in different sizes or different format, it gives wrong result due to different pixels value.
Plz Tell me a better technique which can resolve my problem and also it compare on the base of features.
• January 13th, 2013, 06:37 AM
Norm
Re: image comparsion
Quote:

store separately in 2 arrays then compare them
Can you describe what is in the arrays and how they are compared?
Can you give an example?

Quote:

.if 2 images pixels values are totally similar
What are the values here? What does totally similiar mean?
Can you give an example?
• January 13th, 2013, 07:18 AM
larbie
Re: image comparsion
values are actually the combination of RGB code of some pixel like -1186128 (B=176 R= 237 G= 230)
I use 2 array and initialized size of array according to the size(height*width) of images then store RGB values according to pixels position.like pixel value on position (0,0) store in array index zero and so on.
After storing values of both images in different array,i simply used for loop to compare both arrays values.
totally similar mean both arrays are equal.
• January 13th, 2013, 07:50 AM
Norm
Re: image comparsion
Are you saying that the content of the arrays is an exact duplication of the RGB values of the image?
There is no processing or summing done to colors contained in the image.
I don't see how that would allow the program to do more than say that the two images were identical or not.
• January 13th, 2013, 10:24 AM
larbie
Re: image comparsion
yes content of the arrays is an exact duplication of the RGB values of the image.
I don't understand what you want to say. I know my technique is not good but it is giving right result to some extent.
• January 13th, 2013, 10:43 AM
Norm
Re: image comparsion
If the array is an exact duplicate of the image, what analysis of the contents of the array is done?
What does the program do other than say all the pixels of two images are the same?
• January 13th, 2013, 11:05 AM
larbie
Re: image comparsion
You are asking too much complicated question ,May be i am not giving you clear concept of my algo.
if all the pixel are not same then it just tell the number of similar pixels in both images.
• January 13th, 2013, 01:46 PM
curmudgeon
Re: image comparsion
Just a wild guess, but I suppose you could resize both images to a significantly smaller equal size using an averaging algorithm, and then go pixel by pixel getting the Manhattan distance (look it up) between each pixel, and then get the sum of the squares of these distances and add them up.
• January 15th, 2013, 09:20 AM
larbie
Re: image comparsion
okk sir i will try to apply this..
Can you tell me which technique is good for semantic image searching using java??