Ask Your Question

Revision history [back]

Let us combine some things here

  1. If you know the scale, then resize the image in such a way beforehand that your object has the size of the model.
  2. Then run a single scale detector on top of a region of interest around your object with a slight extra edge of pixel, letting it do a few sliding window steps (to improve detection quality, because some pixels can make the difference)

To do that you will need to manually adapt the source code, and make the detectSingleScale function public instead of protected. It was in older versions of OpenCV, not really sure why they removed it to the protected state. Then rebuilt OpenCV and you are ready to go!