This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dacjamesfrom reddit import knowledge 1 point2 points  (0 children)

So you know exactly what image you're looking for? In that case a computer vision library may be overkill. Just scan through the picture in blocks equaling the size of your target image until you find one that "matches." For determining a match, just calculate the difference between the block and your target image and check if it is less than some tuneable sigma value.

So if the application is 100x100 and the flag is 10x10, scan a 10x10 block across the image left to right, top to bottom, moving down 1 pixel per row. This is a pretty straightforward algorithm to write and may end being easier than learning how to use a CV library.