Ask Your Question

.detectMultiScale (How to look for the function?)

asked 2015-05-29 05:31:15 -0500

Nbb gravatar image

updated 2015-05-29 08:29:21 -0500

Hello forum,

I followed this tutorial earlier today, had to edit a few lines to make it work.

My 1st question is, at the line face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); what exactly does the function do i.e. I would like to see the code in .detectMultiScale but have been unsuccessful. i think I know how haar features work but I would like to look at the code to confirm it.

I got to lines 1627 - 1637. Well, simply put I have no clue where to proceed after that.

My 2nd question is, how do I know which file/folder to visit to look for a certain function ? It seems some of them are stored in opencv/apps and most in opencv/modules

Sorry, I used to use MATLAB. Still kinda new to C++. Have been reading the books but I still get lost at times. Thank you.


Hello, after reading it through I made a little progress ( i think ). There is a .load function being used.

  bool CascadeClassifier::load( const String& filename )
    cc = makePtr<CascadeClassifierImpl>();
    return !empty();

Followed by a .detectMultiScale

void CascadeClassifier::detectMultiScale( InputArray image,
                  CV_OUT std::vector<Rect>& objects,
                  double scaleFactor,
                  int minNeighbors, int flags,
                  Size minSize,
                  Size maxSize )
    cc->detectMultiScale(image, objects, scaleFactor, minNeighbors, flags, minSize, maxSize);
    clipObjects(image.size(), objects, 0, 0);

Because of cc-> , the arguments get passed onto the function below

void CascadeClassifierImpl::detectMultiScale( InputArray _image, std::vector<Rect>& objects,
                                      double scaleFactor, int minNeighbors,
                                      int flags, Size minObjectSize, Size maxObjectSize)
    std::vector<int> fakeLevels;
    std::vector<double> fakeWeights;
    detectMultiScale( _image, objects, fakeLevels, fakeWeights, scaleFactor,
        minNeighbors, flags, minObjectSize, maxObjectSize );

So this is where I am stuck, if all the previous steps are correct. I dont see any function that takes in 9 arguments.

edit retag flag offensive close merge delete



if in debug mode, F11 is not entering the code of the function, then try to build in debug mode the OpenCV libs with CMake

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-05-29 07:38:28 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-29 11:02:13 -0500

Nbb gravatar image

I think I managed to answer my own doubt. I was tired I didn't notice that there is a function with an initialized 10th variable and hence it can take in 9 arguments. Im going to continue reading the functions and codes. Thanks.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-05-29 05:31:15 -0500

Seen: 404 times

Last updated: May 29 '15