Page 1 of 1

compare -subimage-search issue "image morphology differs"

Posted: 2014-08-12T07:16:22-07:00
by snibgo
My stupid fingers deleted a topic instead of moving it to bugs. Sorry about that.

The report was this:

Code: Select all

compare -metric RMSE -subimage-search reso1_res.png settingsReso1_1.png null:

compare: image morphology differs `reso1_res.png' @ error/compare.c/SimilarityMetricImage/1988.
The comparison works fine under 6.8.9-5 on Windows, but fails under 6.8.9-6.

@maxi4: can you link to your sample files again?

Sorry again.

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-12T09:28:52-07:00
by fmw42
this seems to work fine for me under IM 6.8.9.6 Q16 Mac OSX

Code: Select all

compare -metric rmse -subimage-search mandril3.png mandril3_156_22.png null:
0 (0) @ 156,22

Is there something odd about your input images? Or am I misunderstanding the issue?

Note when using -subimage-search the first image is larger than the second image.

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-12T20:21:33-07:00
by maxi4
oh, snigbo, don`t worry, that`s ok!
here are files:
image https://drive.google.com/file/d/0B8qRom ... sp=sharing
sub-image https://drive.google.com/file/d/0B8qRom ... sp=sharing
yes, i know about image and sub-image order on command line.

Please tell me, can i use legacy IM version, like you?
May be it will work for me..

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-12T20:43:05-07:00
by maxi4
yep fmw42, ImageMagick 6.8.9-5 has worked:
C:\print_log\script\settingsReso1>compare -metric RMSE -subimage-search reso1_re
s.png settingsReso1_1.png null:
0 (0) @ 5,341
C:\print_log\script\settingsReso1>compare -version
Version: ImageMagick 6.8.9-5 Q16 x64 2014-06-26 http://www.imagemagick.org

thank you, fmw42!

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-12T21:14:59-07:00
by fmw42
With your images, I get your error message:

Code: Select all

compare -metric rmse -subimage-search reso1_res.png settingsReso1_1.png null:
compare: image morphology differs `reso1_res.png' @ error/compare.c/SimilarityMetricImage/1988.


I created two new images of the same size and it works fine.

Code: Select all

compare -metric rmse -subimage-search \( -size 23x1754 gradient: \) \( -size 16x16 xc:gray50 \) null:
173.114 (0.00264155) @ 0,872

However, it fails, saving the gradient and the gray50 image as png

Code: Select all

convert -size 23x1754 gradient: grad.png
convert -size 16x16 xc:gray50 gray50.png
compare -metric rmse -subimage-search grad.png gray50.png null:
compare: image morphology differs `grad.png' @ error/compare.c/SimilarityMetricImage/1988.


But saving as tif, works.

Code: Select all

convert -size 23x1754 gradient: grad.tif
convert -size 16x16 xc:gray50 gray50.tif
compare -metric rmse -subimage-search grad.tif gray50.tif null:
173.114 (0.00264155) @ 0,872


Looks like it is a PNG issue with very small images, since it worked fine for me with larger PNG images.

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-13T06:24:38-07:00
by magick
Try ImageMagick 6.8.9-7 Beta. Does that resolve the problem?

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-13T10:14:02-07:00
by fmw42
magick wrote:Try ImageMagick 6.8.9-7 Beta. Does that resolve the problem?
Yes, for me this now works.

Code: Select all

convert -size 23x1754 gradient: grad.png
convert -size 16x16 xc:gray50 gray50.png
im6897beta compare -metric rmse -subimage-search grad.png gray50.png null:
173.114 (0.00264155) @ 0,872

Re: compare -subimage-search issue "image morphology differs

Posted: 2014-08-14T02:58:23-07:00
by rgupta1408
I was also facing this issue but using ImageMagick 6.8.9-7 Beta helped me