Flags parameter in the detectMultiScale function [closed]

asked Jul 11 '16

Kelvin gravatar image

updated Nov 13 '17

Can someone explain to me what does the flags parameter do in the detectMultiScale function?

For example:

face = faceCascade.detectMultiScale(
    gray_image,
    scaleFactor = scaleFactor,
    minNeighbors = min_neighbors,
    minSize = (min_size, min_size),
    flags = cv2.CASCADE_SCALE_IMAGE
)

I could not find the flags in the documentation.

Note: I'm using OpenCV 3.1.0.

Thanks

Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-13 12:39:01.795655

Comments

What don't you understand in doc (C++) ?

LBerger gravatar imageLBerger (Nov 13 '17)edit

It is not used for a new cascade.

sturkmen gravatar imagesturkmen (Nov 13 '17)edit

It only says:

flags Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.

Which flags can I use? What does each flag do?

Kelvin gravatar imageKelvin (Nov 13 '17)edit

@sturkmen, what is a 'new cascade'? I don't get it.

Kelvin gravatar imageKelvin (Nov 13 '17)edit
1

I understand that you can set this value to 0 if you use a new format for cascade classifier. I think source code is here

Flags for old cascade classifier are here

LBerger gravatar imageLBerger (Nov 13 '17)edit
1

Ok, I see that the flags parameter is only being used by the Old Format Cascade, but I still don't know if I'm using the 'old format cascade' or the 'new format cascade'. I'm using OpenCV 3.1.0 with Python 2.7. Thanks for the help.

Kelvin gravatar imageKelvin (Nov 13 '17)edit
1

you can find old format cascades here. you can use them if you want and with those cascades flags are still meaningful. but with new cascades flags change nothing.

sturkmen gravatar imagesturkmen (Nov 13 '17)edit

Thanks @sturkmen, so, these are the 'new format cascades'?

Kelvin gravatar imageKelvin (Nov 13 '17)edit