Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3432602
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:28:10+00:00 2026-05-18T07:28:10+00:00

I need a simple and fast way to compare two images for similarity. I.e.

  • 0

I need a simple and fast way to compare two images for similarity. I.e. I want to get a high value if they contain exactly the same thing but may have some slightly different background and may be moved / resized by a few pixel.

(More concrete, if that matters: The one picture is an icon and the other picture is a subarea of a screenshot and I want to know if that subarea is exactly the icon or not.)

I have OpenCV at hand but I am still not that used to it.

One possibility I thought about so far: Divide both pictures into 10×10 cells and for each of those 100 cells, compare the color histogram. Then I can set some made up threshold value and if the value I get is above that threshold, I assume that they are similar.

I haven’t tried it yet how well that works but I guess it would be good enough. The images are already pretty much similar (in my use case), so I can use a pretty high threshold value.

I guess there are dozens of other possible solutions for this which would work more or less (as the task itself is quite simple as I only want to detect similarity if they are really very similar). What would you suggest?


There are a few very related / similar questions about obtaining a signature/fingerprint/hash from an image:

  • OpenCV / SURF How to generate a image hash / fingerprint / signature out of the descriptors?
  • Image fingerprint to compare similarity of many images
  • Near-Duplicate Image Detection
  • OpenCV: Fingerprint Image and Compare Against Database.
  • more, more, more, more, more, more, more

Also, I stumbled upon these implementations which have such functions to obtain a fingerprint:

  • pHash
  • imgSeek (GitHub repo) (GPL) based on the paper Fast Multiresolution Image Querying
  • image-match. Very similar to what I was searching for. Similar to pHash, based on An image signature for any kind of image, Goldberg et al. Uses Python and Elasticsearch.
  • iqdb
  • ImageHash. supports pHash.
  • Image Deduplicator (imagededup). Supports CNN, PHash, DHash, WHash, AHash.

Some discussions about perceptual image hashes: here


A bit offtopic: There exists many methods to create audio fingerprints. MusicBrainz, a web-service which provides fingerprint-based lookup for songs, has a good overview in their wiki. They are using AcoustID now. This is for finding exact (or mostly exact) matches. For finding similar matches (or if you only have some snippets or high noise), take a look at Echoprint. A related SO question is here. So it seems like this is solved for audio. All these solutions work quite good.

A somewhat more generic question about fuzzy search in general is here. E.g. there is locality-sensitive hashing and nearest neighbor search.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T07:28:10+00:00Added an answer on May 18, 2026 at 7:28 am

    Can the screenshot or icon be transformed (scaled, rotated, skewed …)? There are quite a few methods on top of my head that could possibly help you:

    • Simple euclidean distance as mentioned by @carlosdc (doesn’t work with transformed images and you need a threshold).
    • (Normalized) Cross Correlation – a simple metrics which you can use for comparison of image areas. It’s more robust than the simple euclidean distance but doesn’t work on transformed images and you will again need a threshold.
    • Histogram comparison – if you use normalized histograms, this method works well and is not affected by affine transforms. The problem is determining the correct threshold. It is also very sensitive to color changes (brightness, contrast etc.). You can combine it with the previous two.
    • Detectors of salient points/areas – such as MSER (Maximally Stable Extremal Regions), SURF or SIFT. These are very robust algorithms and they might be too complicated for your simple task. Good thing is that you do not have to have an exact area with only one icon, these detectors are powerful enough to find the right match. A nice evaluation of these methods is in this paper: Local invariant feature detectors: a survey.

    Most of these are already implemented in OpenCV – see for example the cvMatchTemplate method (uses histogram matching): http://dasl.mem.drexel.edu/~noahKuntz/openCVTut6.html. The salient point/area detectors are also available – see OpenCV Feature Detection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a simple way of checking how much ram and fast the CPU
In .NET, I need a way to compare two files. I thought of a
I need fast and simple way to encrypt/decrypt a lot of String data. I
How do I create unique key value in PHP? I need simple unique keys
I need a simple communication protocol between two devices (a PC and a microcontroller).
I need an simple way to check whether a string that is sent to
Is there any buildin function or a alternative simple and fast way of escape
Long story short, I need to get up to speed with Joomla fast .
Is there a fast way to get the scheme, host, port (only if not
I need a simple C program which creates tcl interpreter, initializes tcl and tk

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.