Ask Your Question

Revision history [back]

No matching function for call to 'rectangle'

I am trying to draw an rectangle in video but I get this error :" No matching function for call to 'rectangle' " I searched for a solution online but with no success. here are my imports :

#import <opencv2/opencv.hpp>
#import <opencv2/videoio/cap_ios.h>
#import <opencv2/features2d.hpp>
#import <opencv2/objdetect.hpp>

and here is the code itself:

face_cascade.detectMultiScale(image, faces, 1.3, 5);
printf("%zd face(s) are found.\n", faces.size());
for(int i = 0; i< faces.size(); i++){
    cv::Rect r = faces[i];
    x = r.x;
    y = r.y;
    w = r.width;
    h = r.height;
    rectangle(image,(x,y),(x+w,y+h),(255,0,0),2); // my error is here
}