compare -subimage-search issue "image morphology differs"

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

compare -subimage-search issue "image morphology differs"

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
maxi4
Posts: 2
Joined: 2014-08-12T01:52:22-07:00
Authentication code: 6789

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

Post 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..
maxi4
Posts: 2
Joined: 2014-08-12T01:52:22-07:00
Authentication code: 6789

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

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Try ImageMagick 6.8.9-7 Beta. Does that resolve the problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
rgupta1408
Posts: 1
Joined: 2014-08-14T02:52:51-07:00
Authentication code: 6789

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

Post by rgupta1408 »

I was also facing this issue but using ImageMagick 6.8.9-7 Beta helped me
Post Reply