Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

template matching with rotation

I need to do template matching in 360 degrees.

Mostly template is 80*120 and image is 640*480 grayscale (8 bit).

For non-rotation I am using opencv cvmatchtemplate which is working pretty fine.

I tried rotating template at various angles and doing cvmatchtemplate, it's working but consuming too much time.

For normal template match it is taking 12 ms, and for 360 degrees less than 50 ms is required.

like image 642
Hoshin Avatar asked Jan 27 '11 08:01

Hoshin


1 Answers

If you convert your template and image to polar co-ordinates you can do the search as if it is a translation. This should be much faster because it is only one transform - you can implement this efficiently.

I think that expecting to get a good result for 360 degrees is challenging. The template must have changed during that transform. If it was only a few degrees then it is less likely to change.

Take a look at "An FFT based technique for translation, rotation and scale invariant image registration", Reddy and Chatterji, IEEE Transactions on Image Processing, 1996.

like image 123
koan Avatar answered Oct 30 '22 15:10

koan