I am trying to match a template with transparency in a scene with OpenCv v3.3.0 I am using the Java example code from the official documentation.
My test case looks like this:
Scene:
Template with transparency:
Template mask (masked the transparency layer to black):
Matching result (red border marks the match):
Expected result (red border marks the expected match):
For the matching I am using CV_TM_CCORR_NORMED. The matching itself works fine with the mask (without the mask I get a wrong possition). But the found region is the same size as the template and it's mask. I expected it to be the size of the masks colored content.
How can I get the expected results (see image)?