• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compare two images irrespective of their size  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to develop a code which will take two images and compare them. It will give a percentage of similarity between two images. For example if percentage is 100% then two images are same and 0% if they are different.
And if the two images are of different size but same image then also it will give 100%.

I know it is not going to be a small task. Can anyone help to starts with some initial input?

Thanks,
Surodip
 
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Likes 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that is a very hard problem to solve in the general case.

The first question I have is what does it mean to be the same? To a person it might mean something like is this photograph taken today show the same scene as that one taken yesterday?

Can you limit the type of images you are looking at to some domain like faces or microscope images of bacteria or satellite pictures of farmland?

Size of the image is going to be the least of your problems, the much bigger one is to figure out what you're looking for.

If I'm making it much more complicated than necessary and you're looking for something like duplicates in a photo album that may have been resized I can think of some metrics for saying how different they are.

How about more information on what you're trying to do?

Joe
 
Ranch Hand
Posts: 178
2
Java MySQL Database Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can recognize the smaller image and larger image, first convert larger image to a smaller image. The following code will be useful..



getImage method has 3 parameters. Image must be the larger image and x, y is the size of smaller image. Then this method will return an Image instance of smaller size.

Then you can compare the smaller image and the returned image...
 
Surodip Patra
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.

But I just want to compare images like 2D diagrams (like diagrams in reasoning questions). And I am giving a drawing editor like paint to draw diagrams. So suppose one draw a image with a square and a circle and again draw a image with a little big square and a smaller circle. The two images are same but their figures sizes are different. I want to consider those two images as same and not different.

Surodip
 
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is an extremely hard problem that is the topic of ongoing research. I think it's highly unlikely that you will be able to come up with a solution.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!