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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With