-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two identical image diff significant #41
Comments
Nope, it should return Thanks for reporting the issue. |
Ok, I only get a distance of 0.09, which should be under the threshold for matching. However these images should be identical. In [1]: from image_match.goldberg import ImageSignature
In [2]: gis = ImageSignature()
In [3]: path1 = 'https://cloud.githubusercontent.com/assets/1967804/18188884/53e77c7a-70e8-11e6-8e27-98c196f1e242.jpg'
In [4]: path2 = 'https://cloud.githubusercontent.com/assets/1967804/18188887/5bbba7aa-70e8-11e6-93b9-3e881bc03e66.jpg'
In [5]: sig1 = gis.generate_signature(path1)
In [6]: sig2 = gis.generate_signature(path2)
In [7]: gis.normalized_distance(sig1, sig2)
Out[7]: 0.094653959692538772 What's going on? I think one of these images is greyscale, and one is color. In [8]: from skimage.io import imread
In [9]: imread(path1).shape
Out[9]: (1334, 750, 3)
In [10]: imread(path2).shape
Out[10]: (1334, 750) So In [12]: imread(path1, as_grey=True)
Out[12]:
array([[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.],
...,
[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.],
[ 1., 1., 1., ..., 1., 1., 1.]])
In [13]: imread(path2, as_grey=True)
Out[13]:
array([[255, 255, 255, ..., 255, 255, 255],
[255, 255, 255, ..., 255, 255, 255],
[255, 255, 255, ..., 255, 255, 255],
...,
[255, 255, 255, ..., 255, 255, 255],
[255, 255, 255, ..., 255, 255, 255],
[255, 255, 255, ..., 255, 255, 255]], dtype=uint8) Hence the slightly different signatures. The correct fix would be get rid of the |
Interestingly, when I try dividing by import skimage
print(skimage.__version__) ? I'm using version |
@rhsimplex , Thank you for your reply. I use pavlov/match docker image and the Would use |
If you're using pavlov's match, then the real problem is that it's using an out-of-date image-match build. Their docker file has the line:
And we're at version 1+ now. My colleague @vrde has actually ported match to use the latest version of image-match (which now uses python3), you can find that fork here: https://github.com/vrde/match. I'll ask him to make a PR against the original repository. Sorry about the confusion, but see if using this version helps. If so, I probably won't make any changes because |
@rhsimplex Good news, I will use @vrde's fork and see if it woks out. Thank you very much. 👍 |
You're welcome. Please let me know if it fixes your problem. |
@rhsimplex vrde's fork fixed my problem, issue solved 😃 |
there is now a PR dsys/match#8 on Pavlov's match. When the merge it you can pull from there directly =) |
@rhsimplex Nice, love you guys. |
Hi, I have two identical image, but the algorithm outs two different signatures.
First image:
Second image:
Code below:
which outputs
Is that right?
The text was updated successfully, but these errors were encountered: