aboutsummaryrefslogtreecommitdiffstats
path: root/app/camera.cpp
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 13:39:19 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 13:39:19 +0900
commita1375eaac269465e28164bf8f7df62c4aadabe4c (patch)
treed76c522e50f059bb33ce2ff2192cace9e79a259c /app/camera.cpp
parenta35b3631420ac051a1b50a00806ee29900f03250 (diff)
add horizontal for tachometer
Diffstat (limited to 'app/camera.cpp')
-rw-r--r--app/camera.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/camera.cpp b/app/camera.cpp
index 107880c..bd3dd99 100644
--- a/app/camera.cpp
+++ b/app/camera.cpp
@@ -16,7 +16,7 @@
#include "camera.h"
#include <QPainter>
-#include <opencv2/imgproc.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
#include <linux/videodev2.h>
#include <fcntl.h>
@@ -47,8 +47,8 @@ void Camera::paint(QPainter *painter) {
}
void Camera::enumerateCameras() {
- int maxID = 10;
- for (int idx = 0; idx <maxID; idx++){
+ int maxID = 20;
+ for (int idx = 2; idx <maxID; idx++){
std::stringstream no;
no << "/dev/video" << idx;
qDebug() << idx;
@@ -80,8 +80,8 @@ void Camera::start(int no, int fps, QString res) {
}
if (capture && capture->open(no)){
- capture->set(CAP_PROP_FRAME_WIDTH, res.section("*", 0, 0).toInt());
- capture->set(CAP_PROP_FRAME_HEIGHT, res.section("*", 1, 1).toInt());
+ capture->set(CV_CAP_PROP_FRAME_WIDTH, res.section("*", 0, 0).toInt());
+ capture->set(CV_CAP_PROP_FRAME_HEIGHT, res.section("*", 1, 1).toInt());
if (fps > 0){
timer->start(1000/fps);