-
Notifications
You must be signed in to change notification settings - Fork 1
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
vector_normalized_distance varies depending on size of image #5
Comments
Thank you, @benkasminbullock. Can you compare the same images using puzzle-diff? It should have been installed when you installed libpuzzle. https://download.pureftpd.org/libpuzzle/doc/man8/puzzle-diff.8.html |
@benkasminbullock, I have not attempted nor am I going to attempt to reproduce the results you got. What I am asking you to do is to use the "puzzle-diff" utility that comes with libpuzzle to see if it gives you the same numbers when comparing two files. You can also attach a tar.gz of the images you're comparing so that when I have some time, I can use puzzle-diff myself to see if it is libpuzzle or my module that is causing the unexpected variances you're seeing. Thank you! |
I am going to keep this open. Worst case, I can have a test that compares module output with that of puzzle-diff (if installed). @benkasminbullock will you please attach a tar.gz of the images you tested above, being sure to denote the original image. Thank you. |
You can get the images I referred to by running these scripts: https://github.com/benkasminbullock/image-similar/blob/master/t/images/lenagercke/lenagercke.pl https://github.com/benkasminbullock/image-similar/blob/master/t/images/chess/make-chessboards.pl |
Further to that, the C program I mentioned in the bug report is here: https://gist.github.com/benkasminbullock/42a6ac50470ed3bf2fe3 Sorry but I didn't carefully track changes to this. The Makefile for that is as follows: puzzletest: puzzletest.c $(CC) $(CFLAGS) -I /usr/local/include -o $@ puzzletest.c -L /usr/local/lib -lpuzzle -lgd |
@benkasminbullock you deleted your comments so now I have nothing to go by. Based on reconstructin through email, you first wrote: Using the following image: http://xtremewalls.com/supermodels/Lena_Gercke/lena-gercke-001-01.jpg I made various sized versions using Imager: #!/home/ben/software/install/bin/perl Then I tried running Image::Libpuzzle against the original and smaller images: #!/home/ben/software/install/bin/perl The outputs look like this: 100: 0.631680045723442 It's very striking that the numbers are completely different for numbers which are a factor of three and which are not. Did I make some kind of error here? I was also able to reproduce this using a C program with the original libpuzzle. I did some digging and found that the centres of the pixel squares seem to be wrong, which may be why this happens. I tried this on a number of different images and was able to reproduce it with most of them. Since they were private photos I couldn't use them, so I tried with a Lenna image. I couldn't reproduce it with a Lenna image but the above I found on a google image search for "lena". |
Then: The following script prints simple chessboard graphics: #!/home/ben/software/install/bin/perl Make simple images for use in testing libpuzzleuse warnings; http://www.lemoda.net/cairo/cairo-tutorial/line.htmlfor my $s (1..20) { The chessboards can be visually inspected. Using these I adapted the above script to compare the chessboards as follows: #!/home/ben/software/install/bin/perl Test Libpuzzle on simple imagesuse warnings; my $oldsig; The output I get is as follows: 200: 0.297885626124051 Since it's comparing identical images each time, the variation indicates something amiss. |
@benkasminbullock thanks for the C program, but where in the bug report do you mention it? So you compared the output of that program with the output of the Perl script using Image::LibPuzzle? |
@benkasminbullock - can you read through this and tell me if this might be the cause of your issue? https://rt.cpan.org/Ticket/Display.html?id=113716&results=610b7d631bbf5ca74ba6c2804c051fdb Thank you |
@benkasminbullock can you check this branch to see if it fixes your issue? I believe now the char representation of the signature will be more consistent from image to image. |
@benkasminbullock after looking into this more, I have reported this upstream. I have reproduced it with puzzle-diff, so it's not an issue with my module. I would like to get this resolved, though. |
No description provided.
The text was updated successfully, but these errors were encountered: