From bad7949d46f751055194f759c527d6ff39b75056 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Mon, 3 Jan 2022 15:42:54 +0100
Subject: [PATCH] opencv c++ constants

---
 src/examples/fundamental_matrix.cpp | 4 ++--
 src/matchers/matcher_base.cpp       | 2 +-
 src/vision_utils.cpp                | 8 ++++----
 src/vision_utils.h                  | 6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/examples/fundamental_matrix.cpp b/src/examples/fundamental_matrix.cpp
index 3f44500..d4ddf3d 100644
--- a/src/examples/fundamental_matrix.cpp
+++ b/src/examples/fundamental_matrix.cpp
@@ -76,8 +76,8 @@ int main(int argc, char** argv)
     vision_utils::MatcherBasePtr mat_ptr = vision_utils::setupMatcher(mat_name, mat_name + " matcher", yaml_file_params_vision_utils);
 
     // set and print image properties
-    unsigned int img_width = (unsigned int)capture.get(CV_CAP_PROP_FRAME_WIDTH);
-    unsigned int img_height = (unsigned int)capture.get(CV_CAP_PROP_FRAME_HEIGHT);
+    unsigned int img_width = (unsigned int)capture.get(cv::CAP_PROP_FRAME_WIDTH);
+    unsigned int img_height = (unsigned int)capture.get(cv::CAP_PROP_FRAME_HEIGHT);
     std::cout << "Image size: " << img_width << "x" << img_height << std::endl;
 
     // set the image buffer
diff --git a/src/matchers/matcher_base.cpp b/src/matchers/matcher_base.cpp
index 0f17eb1..22f88cb 100644
--- a/src/matchers/matcher_base.cpp
+++ b/src/matchers/matcher_base.cpp
@@ -333,7 +333,7 @@ void MatcherBase::ransacTest(const KeyPointVector& _raw_kps1,
         cv::Mat fundemental= cv::findFundamentalMat(raw_pts1,
                                                     raw_pts2,                                   // matching points
                                                     inliers,                                    // match status (inlier ou outlier)
-                                                    CV_FM_RANSAC,                             // RANSAC / LMEDS method
+                                                    cv::FM_RANSAC,                             // RANSAC / LMEDS method
                                                     params_base_ptr_->ransac_epipolar_distance, // distance to epipolar line
                                                     params_base_ptr_->ransac_confidence_prob);  // confidence probability
 
diff --git a/src/vision_utils.cpp b/src/vision_utils.cpp
index 37f9ca7..166b5b5 100644
--- a/src/vision_utils.cpp
+++ b/src/vision_utils.cpp
@@ -31,9 +31,9 @@ void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, con
     std::vector<int> Indx = sortByResponse(_kps_in, _type);
     for (unsigned int ii = 0; ii < _kps_in.size(); ii++)
     {
-        if (_type == CV_SORT_DESCENDING && _kps_in[Indx[ii]].response < _response_threshold)
+        if (_type == cv::SORT_DESCENDING && _kps_in[Indx[ii]].response < _response_threshold)
             break;
-        else if (_type == CV_SORT_ASCENDING && _kps_in[Indx[ii]].response > _response_threshold)
+        else if (_type == cv::SORT_ASCENDING && _kps_in[Indx[ii]].response > _response_threshold)
             break;
         _kps_out.push_back(_kps_in[Indx[ii]]);
     }
@@ -52,9 +52,9 @@ void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, con
 
     for (unsigned int ii = 0; ii < _kps_in.size(); ii++)
     {
-        if (_type == CV_SORT_DESCENDING && _kps_in[Indx[ii]].response < _response_threshold)
+        if (_type == cv::SORT_DESCENDING && _kps_in[Indx[ii]].response < _response_threshold)
             break;
-        else if (_type == CV_SORT_ASCENDING && _kps_in[Indx[ii]].response > _response_threshold)
+        else if (_type == cv::SORT_ASCENDING && _kps_in[Indx[ii]].response > _response_threshold)
             break;
         _kps_out.push_back(_kps_in[Indx[ii]]);
         _des_out.push_back(_des_in.row(Indx[ii]));
diff --git a/src/vision_utils.h b/src/vision_utils.h
index 23c13e2..71bd824 100644
--- a/src/vision_utils.h
+++ b/src/vision_utils.h
@@ -413,9 +413,9 @@ private:
 
 static const cv::Mat const_mat = cv::Mat();
 
-std::vector<int> sortByResponse(const KeyPointVector& _kps_in, const int& _type = CV_SORT_DESCENDING);
-void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, const int& _response_threshold = 0, const int& _type = CV_SORT_DESCENDING);
-void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, const cv::Mat& _des_in, cv::Mat& _des_out, const int& _response_threshold = 0, const int& _type = CV_SORT_DESCENDING);
+std::vector<int> sortByResponse(const KeyPointVector& _kps_in, const int& _type = cv::SORT_DESCENDING);
+void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, const int& _response_threshold = 0, const int& _type = cv::SORT_DESCENDING);
+void sortByResponse(const KeyPointVector& _kps_in, KeyPointVector& _kps_out, const cv::Mat& _des_in, cv::Mat& _des_out, const int& _response_threshold = 0, const int& _type = cv::SORT_DESCENDING);
 
 bool LessPoints(const cv::Point2f& lhs, const cv::Point2f& rhs);
 bool LessKPoints(const cv::KeyPoint& lhs, const cv::KeyPoint& rhs);
-- 
GitLab