ppg.cpp
This commit is contained in:
parent
16e5abc275
commit
a54bb1c9cb
16
ppg.cpp
16
ppg.cpp
|
|
@ -35,6 +35,15 @@ int main()
|
||||||
return 0;
|
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)
|
while (true)
|
||||||
{
|
{
|
||||||
// create a matrix to store the image from the cam
|
// create a matrix to store the image from the cam
|
||||||
|
|
@ -50,6 +59,13 @@ int main()
|
||||||
cv::imshow("Color", frame);
|
cv::imshow("Color", frame);
|
||||||
if (cv::waitKey(1000.0/FPS) >= 0)
|
if (cv::waitKey(1000.0/FPS) >= 0)
|
||||||
break;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue