Ask Your Question

Revision history [back]

MatchTemplate use fourier transform. Only way to speed this algorithm is to reduce size as you have already done.

If you want to use previous location and you are sure that object (size(wx,wy)) move less than (dx,dy) per image you can extract a new image around previous location (x,y)

  Mat imgnew=img(Rect(x-dx-wx,y-dy-wy,wx+2*dx,wy+2*dy);

then you can try matchTemplate with this new image and hope size is less than previous image

MatchTemplate use fourier transform. Only way to speed this algorithm is to reduce size as you have already done.

If you want to use previous location and you are sure that object (size(wx,wy)) move less than (dx,dy) per image you can extract a new image around previous location (x,y)

  Mat imgnew=img(Rect(x-dx-wx,y-dy-wy,wx+2*dx,wy+2*dy);

then you can try matchTemplate with this new image and hope size is less than previous image

image description