Is there some way for matchTemplate to work with a non-rectangular templ? For example to use the alpha channel, etc to ignore certain pixels when calculating the score?
The various formulas for scores SHOULD generalize to non-rectangular templates.
If you are using openCV 3 you can use mask to do template match on non-rectangular regions.
But in case you are using openCV 2, you have to write your own function to mask your template and then do template match on the source image.
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