Merge branch 'develop'
This commit is contained in:
commit
8c97a5a416
File diff suppressed because it is too large
Load Diff
16
ppg.cpp
16
ppg.cpp
|
|
@ -11,6 +11,7 @@ int DISCARD_DURATION=5;
|
||||||
bool isDiscardData=true;
|
bool isDiscardData=true;
|
||||||
int countDiscard=0;
|
int countDiscard=0;
|
||||||
|
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
//Print "PPG algorithm" to terminal
|
//Print "PPG algorithm" to terminal
|
||||||
//Note to self: std::endl; returns to line in terminal; use it everytime when done printing something.
|
//Note to self: std::endl; returns to line in terminal; use it everytime when done printing something.
|
||||||
|
|
@ -25,6 +26,13 @@ int main(){
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
if(isDiscardData)
|
if(isDiscardData)
|
||||||
|
|
@ -49,12 +57,16 @@ int main(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cv::imshow("Color", frame);
|
cv::imshow("Color", frame);
|
||||||
|
|
||||||
if (cv::waitKey(1000.0/FPS)>=0)
|
if (cv::waitKey(1000.0/FPS)>=0)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cv::Mat frame_gray;
|
||||||
|
cv::cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY);
|
||||||
|
cv::imshow("Gray", frame_gray);
|
||||||
|
std::vector<cv::Rect> faceRectangles;
|
||||||
|
faceDetector.detectMultiScale(frame_gray, faceRectangles, 1.1, 3, 0, cv::Size(20,20));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue