This commit is contained in:
majd.safitli 2023-02-24 11:50:56 +01:00
parent 16e5abc275
commit a54bb1c9cb
1 changed files with 16 additions and 0 deletions

16
ppg.cpp
View File

@ -34,6 +34,15 @@ int main()
{
return 0;
}
cv::CascadeClassifier faceDetector;
if( !faceDetector.load("./haarcascade_frontalface_alt.xml"))
{
std::cerr << "[ERROR] Unable to load face cascade" << std::endl;
return -1;
};
while (true)
{
@ -50,6 +59,13 @@ int main()
cv::imshow("Color", frame);
if (cv::waitKey(1000.0/FPS) >= 0)
break;
std::vector<cv::Rect> faceRectangles;
faceDetector.detectMultiScale(frame, faceRectangles, 1.1, 3, 0, cv::Size(20, 20));
cv::Rect foreheadROI;
foreheadROI = faceRectangles[0];
foreheadROI.height *= 0.3;
}
return 0;
}