changeset 1093:05ccd8ef150c

updated to OpenCV4
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Sat, 02 Feb 2019 09:33:26 -0500
parents 49c0bb6eacc2
children c96388c696ac
files c/Makefile c/Motion.cpp c/cvutils.cpp c/feature-based-tracking.cpp c/test_feature.cpp c/test_graph.cpp include/cvutils.hpp
diffstat 7 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/c/Makefile	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/Makefile	Sat Feb 02 09:33:26 2019 -0500
@@ -25,9 +25,8 @@
 #LDFLAGS += -Wl,--as-needed -Wl,-Bdynamic,-lgcc_s,-Bstatic
 
 ifeq ($(UNAME), Linux)
-	OPENCV_HOME=/usr/local
-	INCLUDE+= -I$(OPENCV_HOME)/include -I$(OPENCV_HOME)/include/opencv
-	LIBS += -L$(OPENCV_HOME)/lib
+	INCLUDE+= -I/usr/local/include/opencv4
+	LIBS += -L/usr/local/lib
 	LINUX_BOOST_PREFIX = /usr/local
 	CFLAGS += -DLINUX
 	EXE_EXTENSION=''
--- a/c/Motion.cpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/Motion.cpp	Sat Feb 02 09:33:26 2019 -0500
@@ -4,8 +4,8 @@
 #include "src/TrajectoryDBAccessList.h"
 
 //#include "opencv2/core/core.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-#include "opencv2/highgui/highgui.hpp"
+#include "opencv2/imgproc.hpp"
+#include "opencv2/highgui.hpp"
 
 #include <boost/graph/connected_components.hpp>
 
--- a/c/cvutils.cpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/cvutils.cpp	Sat Feb 02 09:33:26 2019 -0500
@@ -1,9 +1,9 @@
 #include "cvutils.hpp"
 #include "utils.hpp"
 
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/features2d/features2d.hpp"
+#include "opencv2/core.hpp"
+#include "opencv2/highgui.hpp"
+#include "opencv2/features2d.hpp"
 
 #include <iostream>
 #include <vector>
--- a/c/feature-based-tracking.cpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/feature-based-tracking.cpp	Sat Feb 02 09:33:26 2019 -0500
@@ -7,13 +7,14 @@
 #include "src/TrajectoryDBAccessList.h"
 #include "src/TrajectoryDBAccessBlob.h"
 
-#include "opencv2/core/core.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
+#include "opencv2/core.hpp"
+#include "opencv2/imgproc.hpp"
 #include "opencv2/video/tracking.hpp"
-#include "opencv2/features2d/features2d.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/objdetect/objdetect.hpp"
-#include "opencv2/calib3d/calib3d.hpp"
+#include "opencv2/features2d.hpp"
+#include "opencv2/highgui.hpp"
+#include "opencv2/videoio.hpp"
+#include "opencv2/objdetect.hpp"
+#include "opencv2/calib3d.hpp"
 
 #include <boost/foreach.hpp>
 #include <boost/filesystem.hpp>
@@ -101,8 +102,8 @@
     exit(0);
   }
   
-  Size videoSize = Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT));
-  unsigned int nFrames = capture.get(CV_CAP_PROP_FRAME_COUNT);
+  Size videoSize = Size(capture.get(CAP_PROP_FRAME_WIDTH), capture.get(CAP_PROP_FRAME_HEIGHT));
+  unsigned int nFrames = capture.get(CAP_PROP_FRAME_COUNT);
   if (nFrames <= 0) {
     cout << "Guessing that the number of frames could not be read: " << nFrames << endl;
     nFrames = numeric_limits<int>::max();
@@ -154,7 +155,7 @@
   if (params.nFrames > 0)
     lastFrameNum = MIN(params.frame1+static_cast<unsigned int>(params.nFrames), nFrames);
 
-  capture.set(CV_CAP_PROP_POS_FRAMES, params.frame1);
+  capture.set(CAP_PROP_POS_FRAMES, params.frame1);
   for (unsigned int frameNum = params.frame1; (frameNum < lastFrameNum) && !::interruptionKey(key); frameNum++) {
     capture >> frame;
     if (frame.empty()) {
@@ -163,7 +164,7 @@
     } else if (!params.quiet && (frameNum%50 ==0))
       cout << "frame " << frameNum << endl;
     
-    cvtColor(frame, currentFrameBW, CV_RGB2GRAY);
+    cvtColor(frame, currentFrameBW, COLOR_RGB2GRAY);
     
     if (!prevPts.empty()) {
       currPts.clear();
--- a/c/test_feature.cpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/test_feature.cpp	Sat Feb 02 09:33:26 2019 -0500
@@ -3,7 +3,7 @@
 #include "Motion.hpp"
 #include "testutils.hpp"
 
-#include "opencv2/core/core.hpp"
+#include "opencv2/core.hpp"
 
 #include "catch.hpp"
 
--- a/c/test_graph.cpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/c/test_graph.cpp	Sat Feb 02 09:33:26 2019 -0500
@@ -1,7 +1,7 @@
 #include "Motion.hpp"
 #include "testutils.hpp"
 
-#include "opencv2/core/core.hpp"
+#include "opencv2/core.hpp"
 
 #include "catch.hpp"
 
--- a/include/cvutils.hpp	Wed Jan 30 16:51:52 2019 -0500
+++ b/include/cvutils.hpp	Sat Feb 02 09:33:26 2019 -0500
@@ -1,8 +1,8 @@
 #ifndef CVUTILS_HPP
 #define CVUTILS_HPP
 
-#include "opencv2/core/core.hpp"
-#include "opencv2/features2d/features2d.hpp"
+#include "opencv2/core.hpp"
+#include "opencv2/features2d.hpp"
 
 class CvCapture;
 //template<typename T> class Point_<T>;