what would be the best (fastest) way to check if a small picture is inside a big picture?
(Zoomed picture:)
Want to Find:
I have a solution, but it is very slow:
- i iterate through every single pixel (x,y) in the big picture and compare the pixel (0,0) of the small picture (color value).
- if the pixel is the same, I iterate through the small picture and compare it with the bigger one.. if it fails, it goes back to the big picture scanning loop..
this method needs like ~7 seconds to find a 50x50 pic on 1600x1200 photo.
maybe you know a better algorithm? i know a software which can do this in under a second.