Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

image comparisons

 
Paulo Pontes
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks for any help
Paulo
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt there's anything in the standard API for it, but you can probably find a sourceforge/apache project to help you. Pattern matching in general is not a trivial topic.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange that this exact question was asked here too.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Jaime M. Tovar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paulo Pontes
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

thanks for all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic