views:

117

answers:

1

Please suggest any template matching algorithms, which are independent of size and rotation. (any source codes as examples if possible please)

EDIT 1: Actually I understand how the algorithm works, we can resize template and rotate it. It is computationally expensive, but we can use image pyramids. But the real problem for me now is when the picture is made at some angle to object, so that only a perspective transform can correct the image. I mean that even if we rotate image or scale it, we will not get a good match if the object in image is perspectively transformed. Of course it is possible to try to generate many templates at different perspective, but I think it is very bad idea.

EDIT 2: One more problem when using template matching based on shape matching. What if image doesn't have many sharp edges? For example a plate or dish?

EDIT 3: I've also heard about camera callibration for object detection. What is the algorithm used for that purpose? I don't understand how it can be used for template matching.

+2  A: 

I don't think there is an efficient template matching algorithm that is affine-invariant (rotation+scale+translation).

You can make template matching somewhat robust to scale+rotation by using a distance transform (see Chamfering style methods). You should probably also look at SIFT and MSER to get a sense of how the research area has been shaped the past decade. But these are not template matching algorithms.

carlosdc
What do you mean by affine invariant? I am talking about perspective invariant... How is that possible that there aren't any efficient template matching algorithms which are rotation+scale+translate invariant? For example the NCC method is very good I think for affine-invariant matching. But what about non trivial rotations? Like perspective transformations, caused because of making picture at some angle to the object?
erjik
I mean efficient affine invariant template matching in the following sense: you have template t and image img. img is an image of t except that: in img t has been rotated (say 45 degrees) and scaled (to twice the size of t) and translated (t is located in a random position of img). The way of solving his using template matching is by exhaustively scanning the space (translation, scale, rotation) and this can be very slow. This refers to in-plane rotation. The rotations due to perspective effects aren't illustrated in my example. What is the range of rotations due to perspective effects?
carlosdc
hmm, I don't know exactly the range, it depends on how the person made an image. Not too big of course.
erjik