This commit is contained in:
Estevan BIAU-LOYER 2023-03-02 00:26:15 +01:00
parent c1f23e57e5
commit d120d0242a
1 changed files with 0 additions and 31 deletions

31
ppg.cpp
View File

@ -6,9 +6,6 @@
#define FPS 30.0
bool isDiscardData = true;
int countDiscard = 0;
<<<<<<< HEAD
int main(){
=======
const double nyquistFreq = FPS / 2.0;
template <typename T>
cv::Mat plotGraph(std::vector<T>& vals, int YRange[2])
@ -31,7 +28,6 @@ int main(){
int sampleIdBuffer = 0;
int BUFFER_DURATION= 10;
>>>>>>> Estevan
std::cout<<"PPG, j'adore gitbash même si avec github desktop c'est mieux"<< std::endl;
cv::VideoCapture cap;
cap.open(0);
@ -40,10 +36,6 @@ int main(){
std::cerr << "[ERROR] Unable to open camera!" << std::endl;
return -2;
}
<<<<<<< HEAD
while (true)
{
=======
cv::CascadeClassifier faceDetector;
if( !faceDetector.load("./haarcascade_frontalface_alt.xml"))
{
@ -57,28 +49,19 @@ int main(){
{
break;
}
>>>>>>> Estevan
if (isDiscardData)
{
countDiscard++;
std::cout <<"countDiscard= " << countDiscard<< std::endl;
<<<<<<< HEAD
if (countDiscard == 10*FPS)
=======
if (countDiscard == 1*FPS)
>>>>>>> Estevan
isDiscardData = false;
}
else
{
// create a matrix to store the image from the cam
<<<<<<< HEAD
cv::Mat frame;
=======
cv::Mat frame, frame_gray;
bool isBufferFull = false;
>>>>>>> Estevan
// wait for a new frame from camera and store it into 'frame'
cap.read(frame);
// check if we succeeded
@ -87,19 +70,6 @@ int main(){
std::cerr << "[ERROR] blank frame grabbed" << std::endl;
break;
}
<<<<<<< HEAD
cv::imshow("Color", frame);
}
if (cv::waitKey(1000.0/FPS) >= 0)
{
break;
}
}
return 0;
}
=======
std::vector<cv::Rect> faceRectangles;
cvtColor(frame, frame_gray, cv::COLOR_BGR2GRAY);
faceDetector.detectMultiScale(frame_gray, faceRectangles, 1.1, 3, 0, cv::Size(20, 20));
@ -186,5 +156,4 @@ int main(){
return 0;
}
>>>>>>> Estevan