From 5424987dd11a3e3d968cbcf625bdfc0bb42e6fc6 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Thu, 11 Jan 2018 13:11:16 +0000
Subject: [PATCH] Fixed unused tracking for OpenCV 2.x
---
src/yolo_console_dll.cpp | 3 ++-
src/yolo_v2_class.hpp | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/yolo_console_dll.cpp b/src/yolo_console_dll.cpp
index dd922ec..68a92cd 100644
--- a/src/yolo_console_dll.cpp
+++ b/src/yolo_console_dll.cpp
@@ -13,6 +13,7 @@
#define OPENCV
#endif
+// To use tracking - uncomment the following line. Tracking is supported only by OpenCV 3.x
//#define TRACK_OPTFLOW
#include "yolo_v2_class.hpp" // imported functions from DLL
@@ -107,7 +108,7 @@
auto obj_names = objects_names_from_file(names_file);
std::string out_videofile = "result.avi";
- bool const save_output_videofile = true;
+ bool const save_output_videofile = false;
#ifdef TRACK_OPTFLOW
Tracker_optflow tracker_flow;
detector.wait_stream = true;
diff --git a/src/yolo_v2_class.hpp b/src/yolo_v2_class.hpp
index 66eab73..78cc67b 100644
--- a/src/yolo_v2_class.hpp
+++ b/src/yolo_v2_class.hpp
@@ -8,11 +8,6 @@
#include <opencv2/opencv.hpp> // C++
#include "opencv2/highgui/highgui_c.h" // C
#include "opencv2/imgproc/imgproc_c.h" // C
-
-#include <opencv2/cudaoptflow.hpp>
-#include <opencv2/cudaimgproc.hpp>
-#include <opencv2/cudaarithm.hpp>
-#include <opencv2/core/cuda.hpp>
#endif // OPENCV
#ifdef YOLODLL_EXPORTS
@@ -149,6 +144,11 @@
#if defined(TRACK_OPTFLOW) && defined(OPENCV)
+#include <opencv2/cudaoptflow.hpp>
+#include <opencv2/cudaimgproc.hpp>
+#include <opencv2/cudaarithm.hpp>
+#include <opencv2/core/cuda.hpp>
+
class Tracker_optflow {
public:
const int gpu_count;
--
Gitblit v1.10.0