How would you template match this?

asked 2014-11-18 15:03:18 -0500

Doombot gravatar image

updated 2020-11-02 17:12:03 -0500

Template image:

image description

Query image (imagine the background is the same white colour than the one in the template, it is rendering a little greyish in my browser...):

image description

I would like to template match this, but it fails because even if the black lines will have a good correlation with the similar shape in the centre of the query image, the white background of the template won't match. Is there some way to make the template matching of OpenCV ignore some pixels with a mask or maybe a transparency layer?

Previous experimentation makes me think that feature-descriptors (ORB, etc.) won't be of use here so that's why I am using template matching.

edit retag flag offensive close merge delete