gpu::matchTemplate versus cvMatchTemplate
I've implemented a software for searching a pattern inside an image. With cvMatchTemplate the execution time is around 10ms (because I'm taking a pattern of 40x40 in a search window of 120x160 pixels. The image is 640x480 so I'm not considering the whole image).
I've implemented the same algorithm by using the gpu::MatchTemplate, and I was expecting improvements for the execution time. It is taking 220ms to compute the score. (The method is CV_TM_CCOEFF_NORMED).
What is happening?
Thanks.
Have you measured the time to send the image to the GPU and load the result? For short tasks, this overhead could slow down your execution.
Yes the time is 1 ms for loading the images (they are uncompressed already and i measured on the ".upload" function). The problem is that the same function on the CPU is faster. Is there any FFT performed, or is it used a different algorithm? Is there a way to change the source code?