3

I am wanting to be able to check to see if two images appear to be the same, within a certain threshold.

Image 1

Image 2

These two images are the same to the eye, but one has slightly different colors. I have tried the following example:

http://www.vb-helper.com/howto_net_image_compare_threshold.html

Unfortunately, it only seems to detect when the images are identical. How can I determine if the images are the same within a certain threshold, with VB.NET?

3
  • Couldn't you just display the image, recapture it and then use the code you have? Commented Dec 5, 2011 at 4:35
  • Sorry, could you explain that? Commented Dec 5, 2011 at 4:48
  • Have you used TinEye.com? They also have an API: ideeinc.com/products/pixmatch - I'm didn't see info on its tolerence but I'm sure there would be many other 3rd party tools that are similar, HTH Commented Dec 5, 2011 at 5:54

2 Answers 2

4
  1. Resize both images to the same, small size, such as 16x12 or 90x60 (depending on your threshold).
  2. Reduce the color depth to 4 or 8 bits per pixel (not palettized). You might use a posterize function for this.

Then then see if the two smaller images are duplicates. If so, the originals must be pretty close.

Sign up to request clarification or add additional context in comments.

Comments

0
  • Divide image into R, G, B
  • For each color:
    • For each (x, y):
      • Multiply the pixel of Image 1 with the pixel of Image 2
    • Sum all the pixel values
  • Sum the 3 values for each color

This is the correlation between the two images. To get a value from 0 to 1, first calculate the correlation of an image with itself to see what the best possible value is, then do the correlation of Image 1 with Image 2 and divide by the best possible value.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.