1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
diff --git a/include/VideoFileSource.h b/include/VideoFileSource.h
index 0fda14e..8c15178 100644
--- a/include/VideoFileSource.h
+++ b/include/VideoFileSource.h
@@ -50,5 +50,7 @@
#include <QString>
#include <opencv2/opencv.hpp>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#include "ImageSource.h"
class VideoFileSource : public ImageSource {
diff --git a/include/WebcamSource.h b/include/WebcamSource.h
index 8c1911a..9194385 100644
--- a/include/WebcamSource.h
+++ b/include/WebcamSource.h
@@ -53,6 +53,8 @@
#include <QString>
#include <QVector>
#include <opencv2/opencv.hpp>
+#include <opencv2/videoio.hpp>
+#include <opencv2/videoio/videoio_c.h>
#include "ImageSource.h"
class QSplashScreen;
diff --git a/zart.pro b/zart.pro
index d98a192..ddb2d3b 100644
--- a/zart.pro
+++ b/zart.pro
@@ -19,7 +19,7 @@
CONFIG += warn_on
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
-PKGCONFIG += opencv fftw3 zlib
+PKGCONFIG += opencv4 fftw3 zlib
# LIBS += -lfftw3_threads
DEFINES += cimg_use_fftw3 cimg_use_zlib
diff --git a/src/ImageConverter.cpp b/src/ImageConverter.cpp
--- a/src/ImageConverter.cpp
+++ b/src/ImageConverter.cpp
@@ -70,7 +70,7 @@
cv::Mat tmp(in->cols, in->rows, in->depth());
- cvtColor(*in, tmp, (in->channels() == 1) ? CV_GRAY2RGB : CV_BGR2RGB);
+ cvtColor(*in, tmp, (in->channels() == 1) ? cv::COLOR_GRAY2RGB : cv::COLOR_BGR2RGB);
const unsigned int w3 = 3 * tmp.cols;
unsigned char * src = reinterpret_cast<unsigned char *>(tmp.ptr());
@@ -106,7 +106,7 @@
dst += step;
}
}
- cvtColor(**out, **out, CV_BGR2RGB);
+ cvtColor(**out, **out, cv::COLOR_BGR2RGB);
}
void ImageConverter::convert(const cimg_library::CImg<float> & in, QImage * out)
|