From 31a26ff9c90472d91055c83b2fef9166458291cb Mon Sep 17 00:00:00 2001 From: asantamaria <asantamaria@iri.upc.edu> Date: Tue, 13 Dec 2016 17:24:31 +0100 Subject: [PATCH] working with opencv3.0. ROS indigo has problems with it...trying top set compatibility with opencv2 --- src/CMakeLists.txt | 2 +- src/mvbluefox3.cpp | 4 ++-- src/mvbluefox3.h | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f87350..6037c67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,7 +44,7 @@ ADD_LIBRARY(mvbluefox3 SHARED ${sources} ${sources_ex} ${sources_mut}) #if CV then add the libraries if (USE_CV) INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS}) - TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY} ${OpenCV_LIBS}) + TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY} ${OpenCV_LIBRARIES}) else(USE_CV) TARGET_LINK_LIBRARIES(mvbluefox3 ${mvIMPACT_LIBRARY}) endif(USE_CV) diff --git a/src/mvbluefox3.cpp b/src/mvbluefox3.cpp index aff28a4..bfbe721 100644 --- a/src/mvbluefox3.cpp +++ b/src/mvbluefox3.cpp @@ -229,8 +229,8 @@ void CMvbluefox3::GetImageCV(cv::Mat &image) "Invalid depth. OpenCV Depth not implemented here."); break; } - cv::Mat image2 = cv::Mat(this->params_.height,this->params_.width,type,image_raw); - image = image2.clone(); + image = cv::Mat(this->params_.height,this->params_.width,type,image_raw); + delete [] image_raw; } #endif diff --git a/src/mvbluefox3.h b/src/mvbluefox3.h index d24adc0..5ad0d11 100644 --- a/src/mvbluefox3.h +++ b/src/mvbluefox3.h @@ -189,13 +189,6 @@ class CMvbluefox3 */ void OpenDevice(const std::string &serial); - /** - * \brief Close device - * - * Close device. - */ - void CloseDevice(void); - /** * \brief Get image request format * @@ -384,6 +377,13 @@ class CMvbluefox3 */ ~CMvbluefox3(); + /** + * \brief Close device + * + * Close device. + */ + void CloseDevice(void); + /** * \brief Get device product name * -- GitLab