Hi,
I'm not sure how to go about this (or if it's even possible), but here's my goal:
Image A is the key that I will use to look for Image C
Image B is a fairly large image that has Image C somewhere in it
Image C is the image within Image B, but is slightly different from Image A
I want to find Image C's location within Image B, if it is there at all.
I looked at PHASH, but it warns that it is expensive, and I'm not sure how to set it up so that it looks within Image B. Can anyone offer advice?
Thanks in advance.
Find an image location within an image using an approximate key
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Find an image location within an image using an approximate key
I suppose you know about "-subimage-search", which searches for one image (C) within another (B).
I don't know what you mean by "Image A is the key that I will use to look for Image C". Perhaps you can show examples.
I don't know what you mean by "Image A is the key that I will use to look for Image C". Perhaps you can show examples.
snibgo's IM pages: im.snibgo.com
Re: Find an image location within an image using an approximate key
It's a little difficult to show, but Image A is the sample image I want to look for within Image B. It's the same as Image C except a few pixels that are a slightly different shade. I have it so that ImageMagick knows what to look for when looking for Image C.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Find an image location within an image using an approximate key
See the compare function, as user snibgo said. See
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
and in the example below, you now need to add -subimage-search to the command line.
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
and in the example below, you now need to add -subimage-search to the command line.
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Find an image location within an image using an approximate key
Note that compare only works if there is an offset (shift) when looking for the match. It does not work if there is relative scale or rotation between the two images.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Find an image location within an image using an approximate key
Sorry, I don't understand.knox wrote:It's a little difficult to show, but Image A is the sample image I want to look for within Image B. It's the same as Image C except a few pixels that are a slightly different shade. I have it so that ImageMagick knows what to look for when looking for Image C.
IM can search for C within B. Or it can search for A within B. Would the two searches give different results? If A should give an exact match but C would give only an approximate match, then you should search for A, not C, within B.
Please put up sample images.
snibgo's IM pages: im.snibgo.com