diff --git a/cells/opencv/features2d/DescriptorExtractor.cpp b/cells/opencv/features2d/DescriptorExtractor.cpp index 97b4e08..7afa820 100644 --- a/cells/opencv/features2d/DescriptorExtractor.cpp +++ b/cells/opencv/features2d/DescriptorExtractor.cpp @@ -104,7 +104,7 @@ struct EctoDescriptorExtractor #else descriptor_extractor_ = cv::DescriptorExtractor::create(descriptor_extractor_type_names[T]); #endif - read_tendrils_as_file_node(params, *descriptor_extractor_); + read_tendrils_as_file_node(params, descriptor_extractor_); } int diff --git a/cells/opencv/features2d/FeatureDetector.cpp b/cells/opencv/features2d/FeatureDetector.cpp index 80d7ebd..2ec08f5 100644 --- a/cells/opencv/features2d/FeatureDetector.cpp +++ b/cells/opencv/features2d/FeatureDetector.cpp @@ -102,8 +102,7 @@ struct EctoFeatureDetector #else feature_detector_ = cv::FeatureDetector::create(feature_detector_type_names[T]); #endif - - read_tendrils_as_file_node(params, *feature_detector_); + read_tendrils_as_file_node(params, feature_detector_); } int diff --git a/cells/opencv/features2d/ORB.cpp b/cells/opencv/features2d/ORB.cpp index 47e2f5d..658a118 100644 --- a/cells/opencv/features2d/ORB.cpp +++ b/cells/opencv/features2d/ORB.cpp @@ -32,7 +32,7 @@ struct ORB #if CV_MAJOR_VERSION ==3 orb_ = cv::ORB::create(*n_features_, *scale_factor_, *n_levels_); #elif (CV_MAJOR_VERSION == 2) && (CV_MINOR_VERSION >= 4) - orb = cv::Ptr(new cv::ORB(*n_features_, *scale_factor_, *n_levels_)); + orb_ = cv::Ptr(new cv::ORB(*n_features_, *scale_factor_, *n_levels_)); #else cv::ORB::CommonParams orb_params; orb_params.first_level_ = 0; diff --git a/cells/opencv/features2d/interfaces.h b/cells/opencv/features2d/interfaces.h index be66c49..6f79178 100644 --- a/cells/opencv/features2d/interfaces.h +++ b/cells/opencv/features2d/interfaces.h @@ -52,7 +52,7 @@ using ecto::tendrils; template void -read_tendrils_as_file_node(const ecto::tendrils & tendrils, T obj) { +read_tendrils_as_file_node(const ecto::tendrils & tendrils, cv::Ptr obj) { // Get the file std::string file_name; { @@ -90,7 +90,7 @@ read_tendrils_as_file_node(const ecto::tendrils & tendrils, T obj) { { cv::FileStorage fs(file_name, cv::FileStorage::READ); - obj.read(fs.root()); + obj->read(fs.root()); } // Remove the temporary file diff --git a/cells/opencv/rgbd/Odometry.cpp b/cells/opencv/rgbd/Odometry.cpp index 76dc1c6..9d31e60 100644 --- a/cells/opencv/rgbd/Odometry.cpp +++ b/cells/opencv/rgbd/Odometry.cpp @@ -126,7 +126,7 @@ using namespace std; if (odometry_.empty()) { - odometry_.reset(new RgbdOdometry()); + odometry_ = cv::Ptr(new RgbdOdometry()); #if CV_VERSION_MAJOR == 3 odometry_->setCameraMatrix(cameraMatrix); #else diff --git a/test/cells/ImageGen.cpp b/test/cells/ImageGen.cpp index 3f06b28..1236ef8 100644 --- a/test/cells/ImageGen.cpp +++ b/test/cells/ImageGen.cpp @@ -3,7 +3,7 @@ #include #include #define SHOW() std::cout << __PRETTY_FUNCTION__ << std::endl; -#if CV_MAJOR_VERSION +#if CV_MAJOR_VERSION == 3 #define REFCOUNT(X) std::cout << "ref count:" << ((X->u) ? (X->u->refcount) : 0) << std::endl; #else #define REFCOUNT(X) std::cout << "ref count:" << ((X->refcount) ? *(X->refcount) : 0) << std::endl;