Live data from Hacker News

Detecting duplicate images with Python

blog.iconfinder.com

21–30 of 52 posts

Re: Detecting duplicate images with Python

#23
post #14

Or you can use OpenCV with SIFT/SURF/ORB + KNN/RANSAC and have a very robust solution. Example [1]. OpenCV has awesome Python bindings (cv2), btw. [1] http://stackoverflow.com/questions/2146542/opencv-surf-how-t...

Using feature detectors and descriptors is only half of the solution. If you really want robust image recognition you need to use something like the vocabulary tree developed by Nister[1][2].

[1]http://www.wisdom.weizmann.ac.il/~bagon/CVspring07/files/sca... [2]http://www.cc.gatech.edu/~phlosoft/files/schindler07cvpr2.pd...

Re: Detecting duplicate images with Python

#24
Here is my question for OP. It seems like the image shrinking step coupled with the transformation to +/- values loses so much information that the hash would suffer from big false positive problem. I would have loved to see some data on this based on their own dataset.

To give a concrete example, I noticed recently that a lot of app store icons within a category look pretty similar. See for example this:

https://twitter.com/acslater00/status/450127865682489344/pho...

All of those checkmarks certainly seem to my naked eye like they the binary diff transformation would result in a very identical hash. It seems like the rounded corners in 'Finish' would blur out, and the texture in 'OmniFocus 2' would blur out, and the gradient in 'Clear' would look identical to a flat gradient on the right side of the checkmark.

Anyway, clever algorithm but curious how it works in practice on small icons?

Re: Detecting duplicate images with Python

#27

Here is my question for OP. It seems like the image shrinking step coupled with the transformation to +/- values loses so much information that the hash would suffer from big false positive problem. I would have loved to see some data on this based on their own dataset. To give a concrete example, I noticed recently that a lot of app store icons within a category look pretty similar. See for example this: https://twi…

While this algorithm could suffer from a large false positive problem, that issue could also work to his advantage when implemented as a "find similar images to this", which was addressed later in the article.

Re: Detecting duplicate images with Python

#28

Here is my question for OP. It seems like the image shrinking step coupled with the transformation to +/- values loses so much information that the hash would suffer from big false positive problem. I would have loved to see some data on this based on their own dataset. To give a concrete example, I noticed recently that a lot of app store icons within a category look pretty similar. See for example this: https://twi…

dHash seems like a fast algorithm. So, one could search for potential collisions quickly with dHash, and then run a more complex and expensive algorithm on those matches to refine the results.

Re: Detecting duplicate images with Python

#29

JPEG already has the low resolution information stored in an easily retrievable way. You could use that directly, no need to do the transforms. It would be a lot faster.

Only if it's progressively encoded (though the decoder can still do fast 1/2, 1/4, and 1/8 reductions). Also, low resolution data isn't the same as what you get from a scaling algorithm like ALTIALIAS (though I don't know what that does, probably something like Lanczos).

Plus, you still have to handle other formats like png, and get the same output from the same image.

Re: Detecting duplicate images with Python

#30
post #18

Earlier quoted context omitted.

If you only have 8 samples per row, then you have 7 adjacent pairs. If you use a bit to represent the differences, you'll only have 7 bits. If you want 8 bits, you need 8 differences, so 9 samples.

That makes sense, but why does the example have a 9 by 9 grid, would it be a 9 columns but only 8 rows?

Yes, you are right, it's a mistake in the text. I'll correct it.
Post reply on HN