How can I match a masked image using matchTemplate() in OpenCV with C++?
This is my masked template image:
And this is my source image:
How can I match a masked image using matchTemplate() in OpenCV with C++?
This is my masked template image:
And this is my source image:
matchTemplate
's fifth argument is a mask
array which you can use for this purpose. In your case, you'll want a binary mask. That is, a Mat
with:
CV_8U
, andLook at opencv example. You gotta call the matchTemplate
function:
matchTemplate( img, templ, result, match_method );