Skip to content

Commit 4f91755

Browse files
committed
Migrating to new opencv
1 parent 24e6555 commit 4f91755

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

Baseline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <fstream>
1212
#include "opencv.hpp"
13-
#include <opencv2/imgproc/imgproc.hpp>
13+
#include <opencv2/imgproc.hpp>
1414

1515
bool Baseline::load(const double samplingFrequency, const double timeBase, const string baseline_path) {
1616

Baseline.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <stdio.h>
1313
#include <string>
14-
#include <opencv2/core/core.hpp>
14+
#include <opencv2/core.hpp>
1515

1616
using namespace std;
1717
using namespace cv;
@@ -23,33 +23,33 @@ enum class CSVState {
2323
};
2424

2525
class Baseline {
26-
26+
2727
public:
28-
28+
2929
// Constructor
3030
Baseline() {;}
31-
31+
3232
bool load(const double samplingFrequency, const double timeBase, const string baseline_path);
33-
33+
3434
// Process a frame
3535
void processFrame(Mat &frameRGB, int64_t time);
36-
36+
3737
private:
38-
38+
3939
vector<string> readCSVRow(const string &row);
40-
40+
4141
// Settings
4242
double samplingFrequency;
4343
double timeBase;
44-
44+
4545
// Data
4646
vector<vector<string>> data;
4747
int dataIndex = 2;
48-
48+
4949
// State variables
5050
int64_t time;
5151
int64_t lastSamplingTime = 0;
52-
52+
5353
// Estimation
5454
double bpm_ppg = 0.0;
5555
double bpm_ecg = 0.0;

Heartbeat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#include "Heartbeat.hpp"
1010

1111
#include <opencv2/imgcodecs.hpp>
12-
#include <opencv2/videoio/videoio.hpp>
13-
#include <opencv2/highgui/highgui.hpp>
14-
#include <opencv2/imgproc/imgproc.hpp>
12+
#include <opencv2/videoio.hpp>
13+
#include <opencv2/highgui.hpp>
14+
#include <opencv2/imgproc.hpp>
1515
#include "opencv.hpp"
1616
#include "Baseline.hpp"
1717

@@ -291,11 +291,11 @@ int main(int argc, char * argv[]) {
291291
break;
292292

293293
// Generate grayframe
294-
cvtColor(frameRGB, frameGray, CV_BGR2GRAY);
294+
cvtColor(frameRGB, frameGray, COLOR_BGR2GRAY);
295295
equalizeHist(frameGray, frameGray);
296296

297297
int time;
298-
if (offlineMode) time = (int)cap.get(CV_CAP_PROP_POS_MSEC);
298+
if (offlineMode) time = (int)cap.get(CAP_PROP_POS_MSEC);
299299
else time = (cv::getTickCount()*1000.0)/cv::getTickFrequency();
300300

301301
if (i % downsample == 0) {

RPPG.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#include "RPPG.hpp"
1010

11-
#include <opencv2/imgproc/imgproc.hpp>
12-
#include <opencv2/highgui/highgui.hpp>
13-
#include <opencv2/core/core.hpp>
14-
#include <opencv2/video/video.hpp>
11+
#include <opencv2/imgproc.hpp>
12+
#include <opencv2/highgui.hpp>
13+
#include <opencv2/core.hpp>
14+
#include <opencv2/video.hpp>
1515

1616
#include "opencv.hpp"
1717

@@ -185,7 +185,7 @@ void RPPG::detectFace(Mat &frameRGB, Mat &frameGray) {
185185
switch (faceDetAlg) {
186186
case haar:
187187
// Detect faces with Haar classifier
188-
haarClassifier.detectMultiScale(frameGray, boxes, 1.1, 2, CV_HAAR_SCALE_IMAGE, minFaceSize);
188+
haarClassifier.detectMultiScale(frameGray, boxes, 1.1, 2, CASCADE_SCALE_IMAGE, minFaceSize);
189189
break;
190190
case deep:
191191
// Detect faces with DNN

RPPG.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <fstream>
1313
#include <string>
14-
#include <opencv2/objdetect/objdetect.hpp>
14+
#include <opencv2/objdetect.hpp>
1515
#include <opencv2/dnn.hpp>
1616

1717
#include <stdio.h>

opencv.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "opencv.hpp"
1010
#include <limits>
1111

12-
#include <opencv2/highgui/highgui.hpp>
13-
#include <opencv2/imgproc/imgproc.hpp>
12+
#include <opencv2/highgui.hpp>
13+
#include <opencv2/imgproc.hpp>
1414

1515
using namespace std;
1616

@@ -212,7 +212,7 @@ namespace cv {
212212
Mat outputPlanes[2];
213213
split(a, outputPlanes);
214214
Mat output = Mat(a.rows, 1, a.type());
215-
normalize(outputPlanes[0], output, 0, 1, CV_MINMAX);
215+
normalize(outputPlanes[0], output, 0, 1, NORM_MINMAX);
216216
output.copyTo(_b);
217217
}
218218

@@ -222,7 +222,7 @@ namespace cv {
222222
CV_Assert(a.type() == CV_64F);
223223

224224
// Perform PCA
225-
cv::PCA pca(a, cv::Mat(), CV_PCA_DATA_AS_ROW);
225+
cv::PCA pca(a, cv::Mat(), PCA::DATA_AS_ROW);
226226

227227
// Calculate PCA components
228228
cv::Mat pc = a * pca.eigenvectors.t();

opencv.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <stdio.h>
1313

1414
#include <iostream>
15-
#include <opencv2/core/core.hpp>
15+
#include <opencv2/core.hpp>
1616

1717
namespace cv {
1818

@@ -29,7 +29,7 @@ namespace cv {
2929
double getFps(cv::Mat &t, const double timeBase);
3030
void push(cv::Mat &m);
3131
void plot(cv::Mat &mat);
32-
32+
3333
/* FILTERS */
3434

3535
void normalization(cv::InputArray _a, cv::OutputArray _b);

0 commit comments

Comments
 (0)