//C++ #include //include those opencv2 files in our program #include "opencv2/opencv.hpp" #include "opencv2/videoio.hpp" #include "opencv2/highgui.hpp" int FPS=30; //FPS variable. FPS is the framerate of your video, aka your recording device's int DISCARD_DURATION=5; bool isDiscardData=true; int countDiscard=0; int main(){ //Print "PPG algorithm" to terminal //Note to self: std::endl; returns to line in terminal; use it everytime when done printing something. std::cout << "PPG algorithm"<< std::endl; cv::VideoCapture cap; cap.open(0); if (!cap.isOpened()) { //Check if we can access the camera std::cerr<<"[ERROR] unable to open camera!"<=0) { break; } cv::Mat frame_gray; cv::cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY); cv::imshow("Gray", frame_gray); std::vector faceRectangles; faceDetector.detectMultiScale(frame_gray, faceRectangles, 1.1, 3, 0, cv::Size(20,20)); } } }