Ask Your Question

Revision history [back]

OpenCV Template Matching

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

OpenCV Template Matching

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