Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find image position inside a larger image

Basically I want to find the pixel location of a small image inside a large image. I have searched for something similar to this but have had no luck.

like image 502
Matthew Avatar asked May 03 '10 18:05

Matthew


1 Answers

It depends on how similar you want the result to match your query image. If you're trying to match corresponding parts of different photorealistic images, take a look at the Feature detection Wikipedia page. What you want to use depends on the transformation you expect one image to undergo to become the other.

That said, if you are looking for an exact pixel-by-pixel match, a brute-force search is probably bad. That can be O(m^2*n^2) for an m*m image used to search within an n*n image. Using better algorithms, it can be improved to O(n^2), linear in the number of pixels. Downsampling both images and doing a hierarchical kind of search might be a good approach.

like image 198
jakar Avatar answered Oct 21 '22 07:10

jakar