Solved

Quick comparing two images for differences in VB.NET

Posted on 2010-09-17
3
1,190 Views
Last Modified: 2012-05-10
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
Comment
Question by:Frosty555
3 Comments
 
LVL 9

Accepted Solution

by:
Hawkvalley1 earned 500 total points
ID: 33700667
0
 

Expert Comment

by:c_hubbard
ID: 33702131
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
 
LVL 31

Author Closing Comment

by:Frosty555
ID: 33717380
Well that certainly sped things up to what I needed it to be at. Thank you!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
More on Time zones in vb 2010 12 37
Resolve Dependency Issues 4 41
VB.Net How to Exit Sub - Exit Form??? 5 47
Web Form VB.Net  import CSV 4 17
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now