From 15c484e5a70b67e4e530b770b1078c35c390bac8 Mon Sep 17 00:00:00 2001 From: Alexandre VEROT Date: Fri, 24 Feb 2023 11:27:23 +0100 Subject: [PATCH] Added 4.2.2 --- ppg.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/ppg.cpp b/ppg.cpp index e2367c6..40c20d9 100644 --- a/ppg.cpp +++ b/ppg.cpp @@ -1,9 +1,61 @@ //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; - return 0; + + 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; + + } + } + } +} +