detectMultiScale() function

asked 2019-07-19 02:44:31 -0500

updated 2019-07-19 03:29:24 -0500

berak gravatar image

Hello! I'm new to OpenCV. Took an example from official documentation. When I try to run the code, an error pops up. When you try to run the code, an error pops up when you call the function detectMultiScale ()

Mat image;
image = imread("1.jpg", CV_LOAD_IMAGE_COLOR);
imshow("cam", image);
// Load Face cascade (.xml file)
CascadeClassifier face_cascade;
face_cascade.load("C:/opencv/sources/data/haarcascades/haarcascade_frontalface_alt2.xml");

// Detect faces
std::vector<Rect> faces;

Mat frame_gray;
cvtColor(image, frame_gray, COLOR_BGR2GRAY);
equalizeHist(frame_gray, frame_gray);
face_cascade.detectMultiScale(frame_gray, faces, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE, Size(30, 30));

Error

Tell me how to solve this problem?

edit retag flag offensive close merge delete

Comments

1

please no useless screenshots of your ide here.

if there is an errormsg, we need it as text, so we can quote you, it can be indexed for search, etc.

berak gravatar imageberak ( 2019-07-19 03:13:34 -0500 )edit

opencv version ? os ? compiler ?

berak gravatar imageberak ( 2019-07-19 03:18:49 -0500 )edit
2

@berak version 3.4.6. os Windows 10 I write code for the visual studio 2019.

mananasaly gravatar imagemananasaly ( 2019-07-19 03:23:25 -0500 )edit