From e8cff7bdd6cee5662b71c860843e3d8f2c275a0f Mon Sep 17 00:00:00 2001 From: Nicolas TRAGLIA Date: Wed, 1 Mar 2023 20:09:03 +0100 Subject: [PATCH] added comments --- ppg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ppg.cpp b/ppg.cpp index ea0365f..e327a99 100644 --- a/ppg.cpp +++ b/ppg.cpp @@ -82,7 +82,7 @@ int main(){ { cv::Mat frame_gray; cv::cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY); - //cv::imshow("Gray", frame_gray); //Shows frame in greyscale + //cv::imshow("Gray", frame_gray); //Shows frame in greyscale, disabled if as comment std::vector faceRectangles; faceDetector.detectMultiScale(frame_gray, faceRectangles, 1.1, 3, 0, cv::Size(20,20)); //Detects face @@ -143,6 +143,7 @@ int main(){ // display green FFT cv::imshow("FFT module green", plotGraph(greenFFTModule, range)); + //Find max Value and index of said value from FFT float maxValue=-1; int indexValue=0; for(auto i=0.5*(BUFFER_DURATION);i<(4*BUFFER_DURATION);i++) @@ -153,6 +154,7 @@ int main(){ indexValue=i; } } + //Calculate and print Heart Rate Beat Per Minute float HRBPM=(indexValue*60.0)/(BUFFER_DURATION); std::cout<