I'm trying to find a way to work with a rotation invariant template matching. I can actually detect my objets, calculate the angle and rotate them so they are in the same orientation as the template (I took a capture of the template alone, in orientation 0). After that for each blob of my image, I execute the template matching function and it works quite well so far. The problem is that sometimes it doesn't find an object corresponding to my template, and sometimes it finds objects that totally do not correspond to the template. I thought modifing the threshold whould permit to filter the ones that shouldn't match but it filter the good ones too. I tried different matching methods and I find the best results with the CCOEF_NORM.
Here you have the objects I have to identify
the good matching object and the one that should not match
.
I don't really know how to perform a good matching program. I also tried searching for key points but it's not really dedicated for that type of objects.