Ask Your Question
0

Manually call Haar features / LBP

asked 2016-02-10 20:45:23 -0600

Nbb gravatar image

Hi,

Is it possible to manually call the haar feature / local binary pattern function at a specific scale once ? I know of detectMultiScale but it does the haar feature in a sliding window manner at multiple scales. Given an image id like to call the function on it once if I know the scale instead of evaluating it at different scales and positions.

Also, how do I see the score for the haar features at the current window ? Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-02-11 08:23:11 -0600

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!

edit flag offensive delete link more

Comments

Hi thanks. Im not confident of using cmake. It has broken my code once. Is there an idiot proof guide that would have me follow instructions without any errors ?

Nbb gravatar imageNbb ( 2016-02-17 10:44:10 -0600 )edit

No there is not, dealing with CMAKE can indeed be quite cumbersome and has a steap learning curve, but it will do exactly what you want!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-02-18 04:46:53 -0600 )edit

Hi, I am in the process of learning CMAKE currently but im wondering if it is possible to set the minSize to lets say 80% of the known scale. It should speed up the function right ? The detector will not run haar features for sizes below 80% of the known scale ?

Nbb gravatar imageNbb ( 2016-02-24 03:44:17 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-02-10 20:45:23 -0600

Seen: 114 times

Last updated: Feb 11 '16