• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

image comparisons

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 4323
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Strange that this exact question was asked here too.
 
Scott Selikoff
author
Posts: 4323
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic