I'm looking for a .NET library (that can be accessed from C# code) that can compare 2 images and tell how similar they are. I'm trying to find a way to compare a scanned copy of a document with the original, and tell whether this really is the scan of the original document or something completely different. The scan can obviously be blurry or can be rotated at different angles.

I want the input to be 2 image files, and the output - something that can be interpreted as a scale (e.g. 0 - images completely different, 100 - identical). If the scanned copy is identical but rotated or smaller in size, the score should also be ~100.

I understand that this task cannot be automated with 100% success, but a tool that could at least work in some of the cases would be nice too. I don't have any requirements for the type of the library (free or commercial, open- or closed-source) as long as it gets the job done.

  • 1
    So, you want a kind of score, for instance 0=completely different, 100=identical? Should the same image rotated or smaller have a score of 100 too?
    – Nicolas Raoul
    Oct 11, 2016 at 8:33
  • @NicolasRaoul, yes, that's right Oct 11, 2016 at 8:39
  • 1
    Could you please explain that in your question? Comments get removed. Also specify your budget or whether you want gratis or open source.
    – Nicolas Raoul
    Oct 11, 2016 at 8:42

1 Answer 1


You could check out the Correlation command from the LEADTOOLS Imaging SDK.

Here is what the Image processing command does:

This command compares the correlation image (or part of the correlation image) with all the areas of the same dimensions in the image to be searched and finds those portions that match according to the measure of correlation. Correlation is a measure of association (resemblance) between two images. It varies from 0 (zero resemblance) to 100 (perfect resemblance). This command updates the Points property (or the points parameter of the Constructor) with the point of origin for those areas of the image to be searched where the resemblance with the correlation image (or part of the correlation image) is greater than the threshold. The correlation image dimensions must be less than or equal to the dimensions of the image to be searched.

There are also a lot of other image processing commands in the SDK that you can use to help in your image comparison. A sample c# project was written and posted on the LEADTOOLS Blog. You can download the sample project here:

LEADTOOLS Compare Images Blog Post

Here are some screenshots showing what this demo does and looks like:

Mostly Similar Images mostly similar images

Identical Images identical images

Mostly Different Images enter image description here

Disclaimer : I am an employee of this library.

  • No prices on the website? Then it is insanely expensive. I personally never buy from any vendor who cannot list prices on the website. It's because your sales guys will first look up all information they can find about me and then make the price as high as I can afford. Oct 12, 2016 at 16:44
  • 1
    There are prices on the website at the following links: leadtools.com/sdk/product-overview and here leadtools.com/resources/weborder
    – hcham1
    Oct 12, 2016 at 18:10
  • Thanks for the links. Maybe it's just because I'm not a native speaker, but since I didn't find a "Buy" item, I went to "Licensing" only. Oct 12, 2016 at 18:37
  • That's no problem!
    – hcham1
    Oct 12, 2016 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.