I am working on a small personal project where i have to know wether an image shown is a car or not. I am using the basic OpenCV python based template matching.
Car Top View :- https://i.sstatic.net/zXr1U.jpg
The simple template matching by using one of the positive image on the other is giving the required result.
But when we are using negative images like https://i.sstatic.net/YLVwc.jpg the template finder is finding this as a positive match.
Increase the threshold for template matching :- Increasing the threshold is causing many of the actual positive images to stop matching
Different types of template matching techniques that are there in OpenCV :- Not giving any better result
Using multiple templates to reinforce positive and negative matches:- Doesn't work well for all the cases
Is there a better way to remove the template matching false positives that we are getting. Are there any feature matching or edge detection based techniques that can be used instead of template matching to improve my algorithm.
simple way but might worth trying in your case is to divide your template into ("4") parts - corner and then apply template matching on each of the parts and only accept when the 4 parts are found
also:
adding different template while increasing the threshold
apply some normalization if it is not already being applied
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With