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:
Look at opencv example . You gotta call the matchTemplate
function:
matchTemplate( img, templ, result, match_method );
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
, and
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.