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.