Skip to content

Commit

Permalink
fix OpenCV3 build
Browse files Browse the repository at this point in the history
  • Loading branch information
vrabaud committed Jan 3, 2016
1 parent 287959c commit 8ed5ff5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cv_bridge/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
add_definitions(-DPYTHON3)
endif()

if (OpenCV_VERSION VERSION_EQUAL "3")
if (OpenCV_VERSION_MAJOR VERSION_EQUAL 3)
add_library(${PROJECT_NAME}_boost module.cpp module_opencv3.cpp)
else()
add_library(${PROJECT_NAME}_boost module.cpp module_opencv2.cpp)
Expand Down
7 changes: 7 additions & 0 deletions opencv_apps/src/nodelet/simple_flow_nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/video/tracking.hpp>
#if CV_MAJOR_VERSION == 3
#include <opencv2/optflow.hpp>
#endif

#include <dynamic_reconfigure/server.h>
#include "opencv_apps/SimpleFlowConfig.h"
Expand Down Expand Up @@ -145,7 +148,11 @@ class SimpleFlowNodelet : public nodelet::Nodelet
}

float start = (float)cv::getTickCount();
#if CV_MAJOR_VERSION == 3
cv::optflow::calcOpticalFlowSF(gray, prevGray,
#else
cv::calcOpticalFlowSF(gray, prevGray,
#endif
flow,
3, 2, 4, 4.1, 25.5, 18, 55.0, 25.5, 0.35, 18, 55.0, 25.5, 10);
NODELET_INFO("calcOpticalFlowSF : %lf sec", (cv::getTickCount() - start) / cv::getTickFrequency());
Expand Down

0 comments on commit 8ed5ff5

Please sign in to comment.