Merge branch 'darrenlebg' into main

This commit is contained in:
Darren GALLOIS 2023-02-24 11:17:57 +01:00
commit 2a2f27256e
3 changed files with 46 additions and 2 deletions

View File

@ -7,5 +7,4 @@ convert a video to a heart pulse rate graph
C plusse plusse
there is a new branche called darrenleg

9
makefile Normal file
View File

@ -0,0 +1,9 @@
all: ppg
g++ ppg.o -o ppg.exe -L/usr/lib/x86_64-linux-gnu -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_highgui -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_quality -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_shape -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_ml -lopencv_videostab -lopencv_videoio -lopencv_viz -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core
ppg: ppg.cpp
g++ -c ppg.cpp -I/usr/include/opencv4/opencv -I/usr/include/opencv4
clean:
rm *.o
rm *.exe

36
ppg.cpp Normal file
View File

@ -0,0 +1,36 @@
#include <iostream>
#include "opencv2/opencv.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#define FPS 30.0
int main(){
std::cout<<"PPG, j'adore gitbash même si avec github desktop c'est mieux"<< std::endl;
cv::VideoCapture cap;
cap.open(0);
if (!cap.isOpened())
{
std::cerr << "[ERROR] Unable to open camera!" << std::endl;
return -2;
}
while (true)
{
// create a matrix to store the image from the cam
cv::Mat frame;
// wait for a new frame from camera and store it into 'frame'
cap.read(frame);
// check if we succeeded
if (frame.empty())
{
std::cerr << "[ERROR] blank frame grabbed" << std::endl;
break;
}
cv::imshow("Color", frame);
if (cv::waitKey(1000.0/FPS) >= 0)
{
break;
}
}
return 0;}