I'm looking for a library that allow me to do some image comparison in order to recognize an image within another (with a certain sensibility configuration of course).

For instance if I take a screenshot of my Windows desktop and a screenshot of the Windows close button, I should be able to know if I have a Windows opened or not.

  • I'm interested in Java, Php or Python libraries.
  • Input format should be common one's (.png, .jpg)
  • Do the libraries have to be natively in Java/PHP, or is it ok to have external bindings to a native code library? Mar 12, 2014 at 10:31
  • I accept external binding @Gilles, I'm not looking for the highest performances. Mar 12, 2014 at 10:39

2 Answers 2


There is a similar question asked here:

Library to compare images

This is what the links post says

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.


You can use OpenCV for this. The page at wikipedia gives a good overview:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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