Image Pyramids & Template Matching

asked 2015-05-12 08:35:35 -0600

Storiy gravatar image

updated 2015-05-13 04:03:17 -0600

I am trying to get into Image Pyramids, and while googling found this turorial. It compiles, and founds the 1:1 template, but when i am trying to increase template image, at least for 10 px, function stops finding it on image. What is wrong?

edit retag flag offensive close merge delete

Comments

I did not have time to go through the tutorial from the official opencv documentation and your issue but I would like to suggest you to have a look at this tutorial here as well. It is quite nice and it might help you solve your problem ;-).

theodore gravatar imagetheodore ( 2015-05-12 17:05:02 -0600 )edit

thanks, i am looking up to this one right now. but i have a problem with a right number of layers that i send to the function. if i add too much, i just get my PC lagging, and any low value just dont found the template, if that is the case of a problem, ofc. edit: increasing level value dont seem to help at all.

Storiy gravatar imageStoriy ( 2015-05-13 04:08:02 -0600 )edit

first you should know that template matching, in this form, is not scale and rotation invariant. So, when you increase the template image is normal that the function cannot find the image anymore. As for the lagging how many layers are you trying and what are the dimensions of the images, both original and template image. You should be aware that template matching is not that fast by following this approach.

theodore gravatar imagetheodore ( 2015-05-13 07:11:56 -0600 )edit

than my approach is completely wrong. i need to find the template on image, and i dont know the size of the one on the image, since every time i will match them in my program, size of it will be different.

Storiy gravatar imageStoriy ( 2015-05-13 07:22:44 -0600 )edit

I would suggest you to go with something like this then. I think it will work much better in your case.

theodore gravatar imagetheodore ( 2015-05-13 07:34:50 -0600 )edit

btw, can i use this resize function? and somewhy my opencv dont see the libraries, although they are connected, so i keep getting the "undefined reference" to any SURF function

Storiy gravatar imageStoriy ( 2015-05-13 08:21:42 -0600 )edit

in order to get SURF to work you need to have opencv with contrib modules enabled. I guess you did not do that. If not then check the README file in the above link in order to see how to do it ;-).

theodore gravatar imagetheodore ( 2015-05-13 08:35:10 -0600 )edit