Reading subimage-search command line results

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
kraftydevil
Posts: 10
Joined: 2017-05-01T22:24:31-07:00
Authentication code: 1151

Reading subimage-search command line results

Post by kraftydevil »

compare -metric RMSE -subimage-search writes a value with format 'A (B) @ X,Y' to stderr.

Examples:
  1. 0 (0) @ 94,86
  2. 15903.7 (0.242675) @ 233,304
  3. 22620 (0.34516) @ 614,126
So far I'm pretty sure of these values:
B = similarity threshold of match
X = x-coordinate of match
Y = y-coordinate of match

Question 1
What is A for? It's obviously 0 when there's a match, so I'm sure A and B are related - I just can't tell the relationship.

Question 2
Can the return format ever be different? For example, is there a way to get a list of the top 3 matches?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reading subimage-search command line results

Post by fmw42 »

A is the score in the quantum range of your ImageMagick compile (default for Q16 is 0 to 65535). B is in the range 0 to 1
Post Reply