Hi! I have a situation that I need to know if a given image is contained inside a bigger one. I have both images as BufferedImage objects and I really wouldn't like to implement a pixel by pixel comparison
Is there some convenience class that does this for me? I only want to know is image A is inside of picture B and if yes, A is starting ar coord (x,y) of picture A.
Sounds like a homework problem to me... I can't imagine when it would be useful in practice (where you'd probably want something that looked for approximate sub-images inside of images instead of precise ones).
Image comparison is used in sign searching and validation. You want to detect if the image you are scanning has an specific anchor. Then you use the anchor to locate the sign some place in the document. Then use fussy algorithms or/and neural networks (maybe others) to know if the sign is the same to a previously scanned sign.
Well as far as I know.
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
If the big image contains an exact duplicate of the smaller image, with no rotation, distortion, or changes in color and intensity, then it should be pretty easy to do a pixel-by-pixel comparison, much as Ken described in the other link. If the bytes are not exactly the same though, this becomes much harder, and we'd need a lot more information about what kinds of errors are acceptable.
"I'm not back." - Bill Harding, Twister
Joined: Dec 06, 2004
no free lunch for me...
I will code a pixel-by pixel comparison...
this is not for a "serious" project, but not for a homework...