laxman digari
laxman digari

Reputation: 127

How to compare different size images

I am having an issue while comparing two images which are same. if the image sizes are same then can compare (No issues), if sizes are different, then I am unable to compare. I am comparing pixel by pixel.

Is there any way in C#.net to compare similar images like can match around 70%.

Thanks

Laxman

Upvotes: 8

Views: 7380

Answers (2)

oknsnl
oknsnl

Reputation: 351

Use gaussian filter and resize bigger one to smaller's size then use gaussian filter on smaller one too then try to compare them.Color ratios will not change too much you can use that too if you dont want to resize them. You can search pyramid feature detection.I hope that may help. http://en.wikipedia.org/wiki/Pyramid_(image_processing)

Upvotes: 0

Muhammad Hasan Khan
Muhammad Hasan Khan

Reputation: 35156

You need to calculate and compare perceptual hash of both the images.

Read the following article and implement it in C# https://www.memonic.com/user/aengus/folder/coding/id/1qVeq

OR

You can use Exhaustive Template Matching class of AForge to compute image similarity

The class also can be used to get similarity level between two image of the same size, which can be useful to get information about how different/similar are images:

Upvotes: 3

Related Questions