Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opencv finding image cordinates on another image

How to find image "A" coordinates on image "B" which contains image "A".

I wrote this program which is only checking pixel values, does anyone know is there any library tool do this.

like image 667
haykart Avatar asked Dec 07 '11 13:12

haykart


2 Answers

As Throwback1986 suggested, you will probably want to use matchTemplate. Here is one of my answers showing how to detect the Sun from virtual spacecraft. Here is the newer tutorial from OpenCV on using matchTemplate. Now, there are some caveats for using the matchTemplate approach. If image "A" can be at an arbitrary pose (e.g., changes in scale, rotation, perspective, etc) in image "B", then matchTemplate isn't going to work very well. If that happens to be the case, you will want to use to go the feature detection route as suggested by Adrian Popovici.

like image 159
mevatron Avatar answered Sep 17 '22 20:09

mevatron


You should take a look at the last 3 tutorials from this link: http://opencv.itseez.com/doc/tutorials/features2d/table_of_content_features2d/table_of_content_features2d.html

I don't think the checking of pixels is a good approach.

like image 23
Adrian Avatar answered Sep 20 '22 20:09

Adrian