Ask Your Question

bongia's profile - activity

2018-05-30 08:38:01 -0600 received badge  Popular Question (source)
2014-12-04 09:40:46 -0600 asked a question Unrecognized or unsupported array type in function cvGetMat (c++) in detectMultiscale

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(path, CV_LOAD_IMAGE_GRAYSCALE) 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. Any ideas?