can some one write a python code for template matching?

asked 2014-08-28 15:40:13 -0500

updated 2014-08-29 04:08:56 -0500

berak gravatar image

I understand the code given in opencv docs but I want a code that uses a single template image and try 's to match it with 10 or more images.I'm doing a project for car plate recognition and hence im using a camera to scan the car no. plate (template) and match it with a database of other car no. plates .So can any one help?I'M new to opencv and python!! and what is the use of image pyramids ?

edit retag flag offensive close merge delete

Comments

2

If you do understand the code given in opencv docs, then what's the problem? Start hacking away. If iterating through a bunch of images is confusing you, then google that. (Hint: os.listdir will give you names of all files in a dir). If you don't know how what image pyramids are, look in the opencv docs. It's all right there. Pyramids btw are rescaled matrices of your input image matrices. In template matching, the template object could be bigger or smaller in size than the template image you're using. So pyramids come into use. It's not that complex. The example here at the docs is sufficient to get you started: http://goo.gl/RWE0y4

bad_keypoints gravatar imagebad_keypoints ( 2014-08-29 01:42:16 -0500 )edit

still, template matching might be the wrong idea, as it has problems with scale/perspective distortion. also, it looks for exact duplicates, and no numberplate is the same.

berak gravatar imageberak ( 2014-08-29 04:10:55 -0500 )edit

Exactly. Now go look for SURF/ORB implementations, and FLANN index creation of a number images. And you probably might do better with running OCR on your images rather than feature matching. Look into tesseract.

bad_keypoints gravatar imagebad_keypoints ( 2014-08-29 07:05:52 -0500 )edit