Ask Your Question

OpenCV Template Matching

asked 2014-08-16 06:16:05 -0500

updated 2020-11-02 17:15:01 -0500

Hi Guys.

so I am a complete rookie when it comes to template matching and i had a few questions to problems/functionality advancements.

so I currently have a object tracking code using the functions inbuilt into OpenCV. this functions updates the template for every match (every frame in this case) which helps with detections from different angles. it works quite well and can follow the region the I select quite well. I had a few questions about these process

1.) once i give the ROI to track it works well then the object is in the frame, but when i remove it, it goes to the next closest match which is a False Positive (it is very similar to the object I want but not the object). is there a way I can check to see if the ROI is the match to the template and if it isn't skip the frame? I originally had the idea of using a threshold value that can be obtained from the original template and comparing that to the match. and since all objects will be different I can filter out the one I want. I wasn't sure how could I go about implementing something that could do this.

2.) How can I get a different sized template match? so at different distances that objects will be different to the original template. so i was wondering if I could make the ROI that I am trying to detect change sizes and compare which one is more correct?

i am mainly looking for a explanation on implementation as I am very curious and im not sure how to get these methods working

edit retag flag offensive close merge delete



if you got 'angles' as well as different sizes, - probably template matching is the wrong approach.

you don't mention your input, but 'real time' seems to hint at a webcam. in that case you also got perspective distortion, not just 'angles'.

berak gravatar imageberak ( 2014-08-16 06:54:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-16 08:26:10 -0500

yeah its going to be running from a webcam, template matching is the method i was advised to go with. do you know a better method?

edit flag offensive delete link more

Question Tools


Asked: 2014-08-16 06:16:05 -0500

Seen: 457 times

Last updated: Aug 16 '14