Compare doesnt work with different width and height

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sagarghuge16
Posts: 2
Joined: 2013-07-19T02:37:31-07:00
Authentication code: 6789

Compare doesnt work with different width and height

Post by sagarghuge16 »

Hi,
I am using Version: ImageMagick 6.8.6-6 2013-07-19
i have two images larger one and smaller one. i want to fire " compare -verbose jump_scrshot.png seekbar.png out.png"

but it gives me error "compare: image widths or heights differ `jump_scrshot.png' @ error/compare.c/CompareImageCommand/977"

i want the coordinate where we find the smaller image.

you will find images here:
https://www.dropbox.com/s/w17cafzoh04v7 ... crshot.png
https://www.dropbox.com/s/6jaloo0ab5jkxt0/seekbar.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compare doesnt work with different width and height

Post by snibgo »

Use "-subimage-search": http://www.imagemagick.org/script/comma ... age-search

Eg:

Code: Select all

D:\web\im>%IM%compare -metric RMSE -subimage-search jump_scrshot.png seekbar.png NULL:
1.39105 (2.12261e-005) @ 81,572
The location is 81,572.
snibgo's IM pages: im.snibgo.com
sagarghuge16
Posts: 2
Joined: 2013-07-19T02:37:31-07:00
Authentication code: 6789

Re: Compare doesnt work with different width and height

Post by sagarghuge16 »

-subimage-search works fine but it takes time.
when i used -verbose on previous version it took around 8 sec to find subimage. i want efficient way to find the subimage.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Compare doesnt work with different width and height

Post by fmw42 »

if on Linux/Mac and compile in HDRI mode, then you can try my FFT normcrosscor. See link below.
Post Reply