OpenCV match Template

asked 2013-01-15 07:57:40 -0500

Ajay Nair gravatar image

I am trying to match a logo (template) I have with some images. My images are all colored in nature and the way I am doing it is using the cvMatchTemplate() from openCV and running the template (logo) over my source image. I scale the template to multiple levels to find the best match. Please note that I am just finding the digitally imprinted logos on the image and not the logos present in the scene. Eg: Detecting sky sports from this image (The image is purely for representation and clarity of my task and is not images I am working with

My images are not of fixed resolution so I scale it up to a standard 800x600. Now when my source image resolution is very bad say 300x300, the results are very ordinary. I am using the method=CV_TM_CCOEFF_NORMED in the template parameter and the scores even for accurate matches is quite low (as low as 0.4 on a scale of 0 to 1.0) making it difficult for me to confidently say if the logo is present or not. I have two questions on this:

1 - In opencv template matching, how does it handle colored images. I tried to comprehend from the document and my inference was it computes the score for each channel separately and the best is taken. If that is the case wont I would be better off taking all the three channels into account for better results

2 - Any alternative approach !! :)

Let me know if any thing is not clear !


edit retag flag offensive close merge delete