views:

121

answers:

4

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.

A: 

You could probably use the AForge Framework to do something like this. It offers a variety of image processing tools. Possibly you could use their blob extraction to extracts blobs then compare those blobs to a stored image you have and see if they match.

brendan
A: 

If the images are pixel-by-pixel equal, you could start by searching for one pixel that has the same color as pixel (0,0) in the small image. Once found, compare each pixel in the area that would be covered by the small image. If there are no differences you found your position. Else start over by searching for the next pixel matching (0,0).

driis
A: 

Booyer-Moore search sounds like a solution here if you treat your pixels as characters and are looking for an exact match. Much faster than per pixel searching as well.

Michael Dorgan
A: 

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 dection 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. Downsampling both images and doing a hierarchical kind of search might be a good approach.

jakar