robev
robev

Reputation: 1949

Viola Jones - How to scale a weak classifier (feature)

Once you've trained a Strong classifier for the Viola Jones face detector, you are supposed to run a 24x24 subwindow over your testing images. Once you've moved it over the screen, you are supposed to scale it (the paper recommends x1.5 each time).

My question is, the point of this is that features are easily calculated at different scales. However, how are you supposed to scale the feature? You just multiply the width/height by the scale factor? Or do you have to move it as well? (scale towards bottom right). Or do you have to multiply it so its width/height ratio to the original subwindow height/width stays the same?

Here's an image of what I mean:enter image description here

The original subwindow is 4x3, and I'm multiplying it by 2 so its 8x6. How big should the 2x1 feature be? And where should its top left corner be? The same spot?

Thanks

Upvotes: 2

Views: 947

Answers (1)

user334856
user334856

Reputation:

Yes, just multiply the height and width of the the window each by 1.25 (or whatever scale factor you want to increase by).

For the locations of the feature top/left/right/bottom should also be scaled so that they occupy the same relative position to the larger window.

In your example, the 2x1 feature will end up being 4x2, centred in the larger window (btw, you drew the larger window width 9, instead of width 8).

Upvotes: 1

Related Questions