Page 1 of 1
Find an image location within an image using an approximate key
Posted: 2015-08-18T17:15:20-07:00
by knox
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.
Re: Find an image location within an image using an approximate key
Posted: 2015-08-18T17:27:40-07:00
by snibgo
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.
Re: Find an image location within an image using an approximate key
Posted: 2015-08-18T18:37:19-07:00
by knox
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.
Re: Find an image location within an image using an approximate key
Posted: 2015-08-18T18:40:57-07:00
by fmw42
Re: Find an image location within an image using an approximate key
Posted: 2015-08-18T18:44:07-07:00
by fmw42
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.
Re: Find an image location within an image using an approximate key
Posted: 2015-08-19T06:59:47-07:00
by snibgo
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.
Sorry, I don't understand.
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.