So, say I have two images, one which is a .bmp of some text and another which is a bufferedImage, how would I go about finding if the .bmp is inside the bufferedImage? Im really lost on how to find an image within an image, a color is easier as its just one thing to search for but an image seems much harder...
Asked
Active
Viewed 2,733 times
0
-
I think this falls into the category of image recognition, which (imo) is rather complicated and involved. http://stackoverflow.com/questions/7881133/detecting-if-an-object-from-one-image-is-in-another-image-with-opencv might be helpful if you want to use OpenCV's implementations of SIFT and SURF. For java, you can use the JavaCV wrappers. – Vineet Kosaraju Nov 13 '13 at 06:20
-
Here are some more links about using OpenCV as Bucco suggested - Another discussion on how to find an image in an image using OpenCV: http://stackoverflow.com/questions/8416414/opencv-finding-image-cordinates-on-another-image. Also have a look at http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html - OpenCV has a Java API, see http://opencv.org/opencv-java-api.html for a starting point. - Discussion on converting between Java and OpenCV image formats: http://stackoverflow.com/questions/14958643/converting-bufferedimage-to-mat-in-opencv – halfbit Nov 13 '13 at 06:36
-
1Could you post the two images or provide a link? – Gabriel Archanjo Nov 13 '13 at 12:01
1 Answers
0
One Solution to this Problem is "Template Matching".
This means sliding your Template (the image you want to find) over the Image (you want to search in) and at every Position compare the similiarity of all Pixels.
The Position of your Template in the Image is at the Maximum this procedure returned.
As suggested in the comments you can use OpenCV for this Task which support Template Matching.

Mailerdaimon
- 6,003
- 3
- 35
- 46