Template Matching Of A Single Template With Multiple Source Images
I have a template 'X'(symbol) which is cropped out of 'Image1'. I am using OpenCV's matchTemplate() method to match the template 'X' with 'Image1' and it does that successfully.
Solution 1:
First of all, TemplateMatching only works in the images almost same. Small changes on the desired objects included in new frames can create difficulties to make a good match.
In your case, the first example is working properly because you just cropped the template from it. Like the examples also did exactly like that: Example 1 and Example 2.
I dont suggest using TemplateMatching alone. matchShape function is also a very effective function. You can get the contour arrays of your template image(for example symbol x contour) and compare with the other contours. My suggestion is you should support your TemplateMatching function with the other OpenCV structural functions.
The same problems are also mentioned in these posts: here and also here
Post a Comment for "Template Matching Of A Single Template With Multiple Source Images"