Unrecognized or unsupported array type in function cvGetMat (c++) in detectMultiscale

asked 2014-12-04 09:40:46 -0600

bongia gravatar image

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?

edit retag flag offensive close merge delete

Comments

hey is the problem solved? Did u find the solution to this ?

praneeth gravatar imagepraneeth ( 2016-03-24 02:23:22 -0600 )edit