Subimage search - getting error ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bipsen
Posts: 2
Joined: 2017-11-02T01:12:55-07:00
Authentication code: 1151

Subimage search - getting error ?

Post by bipsen »

Hi

When trying to search for a sub-image in a larger image, I get an error from Magick.exe (windows).

Command called as:

magick compare -subimage-search -metric rmse c:\temp\Coin-unknown.png c:\temp\Coin-Sub5.png
compare: `c:\temp\Coin-unknown.png' @ error/compare.c/CompareImagesCommand/937.

The version output:

Version: ImageMagick 7.0.2-5 Q16 x64 2016-07-22 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

The subimage is 14x11 pixels, the larger is 20x30 pixels...


Tried to update to:
Version: ImageMagick 7.0.7-9 Q16 x64 2017-10-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib


The error still pops up - another line, though:
compare: `c:\temp\Coin-unknown.png' @ error/compare.c/CompareImagesCommand/1155.


Any idea what could be the issue ?
bipsen
Posts: 2
Joined: 2017-11-02T01:12:55-07:00
Authentication code: 1151

Re: Subimage search - getting error ?

Post by bipsen »

Found problem - an output name is needed...
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Subimage search - getting error ?

Post by snibgo »

Yes, that's it. You need two inputs and an output. The output can be "NULL:".
snibgo's IM pages: im.snibgo.com
shen
Posts: 1
Joined: 2019-02-11T01:52:06-07:00
Authentication code: 1152

Re: Subimage search - getting error ?

Post by shen »

What do you mean for "an output name is needed"?

I get 1155 for this command:

> magick compare -verbose a.png b.png

Output:
a.png PNG 398x452 398x452+0+0 8-bit sRGB 21329B 0.016u 0:00.008
compare: `a.png' @ error/compare.c/CompareImagesCommand/1155.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Subimage search - getting error ?

Post by snibgo »

shen wrote:magick compare -verbose a.png b.png
You have two inputs but no output. You need an output. The output can be "NULL:". Like this:

Code: Select all

magick compare -verbose a.png b.png NULL:
snibgo's IM pages: im.snibgo.com
Post Reply