i'm trying to detect a face using a cascade classifier (haarcascade_frontalface_alt_tree.xml
), but this line
cascade.detectMultiScale(img, vec, 1.1, 2, CV_HAAR_FIND_BIGGEST_OBJECT, cv::Size(40, 40), cv::Size(125, 160));
gives me this error:
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /home/rigu10/opencv-2.4.9/modules/core/src/array.cpp, line 2482
terminate called after throwing an instance of 'cv::Exception'
what(): /home/rigu10/opencv-2.4.9/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat
the image img
is a cv::Mat
created using imread()
and vec
is a vector<cv::Rect>
.
i'm woring on debian with opencv 2.4.9, but the same code works fine in macos using the same version of opencv.