Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1273
  • Last Modified:

Quick comparing two images for differences in VB.NET

In VB.NET, I have a source image and a reference image that I want to compare and identify the differences. The two images are jpegs so the pixels can differ slightly while still being basically the same. I'm trying to determine how alike the two pictures are, e.g. are the 95% identical, or 10% identical etc.

I know how to loop through the image doing GetPixel() and comparing the results, but that is pretty slow for large images especially when you have to process the pixels to determine "how different" they are as opposed to just comparing them.

Does anybody have any ideas/tricks that can do this in a faster way?
0
Frosty555
Asked:
Frosty555
1 Solution
 
Hawkvalley1Commented:
0
 
c_hubbardCommented:
Why not sample a % of the pixels in the image rather than reading all of them.

How are you comparing pixels?
  You could average (Math.abs(R1-R2)+Math.abs(G1-G2)+Math.abs(B1-B2))/255//3 over all the pixels.
 
0
 
Frosty555Author Commented:
Well that certainly sped things up to what I needed it to be at. Thank you!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now