From 526efbd9bb34ff0de8a0c7e049b20feddd1723e4 Mon Sep 17 00:00:00 2001 From: Wenqiang Date: Sat, 25 Dec 2021 01:11:37 -0500 Subject: [PATCH] adapt to ubuntu 20.04 --- .../include/camodocal/calib/CameraCalibration.h | 2 ++ camera_model/include/camodocal/chessboard/Chessboard.h | 2 ++ pose_graph/src/ThirdParty/DVision/BRIEF.cpp | 2 +- pose_graph/src/keyframe.cpp | 4 ++-- pose_graph/src/pose_graph.cpp | 10 +++++----- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/camera_model/include/camodocal/calib/CameraCalibration.h b/camera_model/include/camodocal/calib/CameraCalibration.h index ac80f690b..d98c875c1 100644 --- a/camera_model/include/camodocal/calib/CameraCalibration.h +++ b/camera_model/include/camodocal/calib/CameraCalibration.h @@ -4,6 +4,8 @@ #include #include "camodocal/camera_models/Camera.h" +#include +#include namespace camodocal { diff --git a/camera_model/include/camodocal/chessboard/Chessboard.h b/camera_model/include/camodocal/chessboard/Chessboard.h index fb421988a..9d26a90de 100644 --- a/camera_model/include/camodocal/chessboard/Chessboard.h +++ b/camera_model/include/camodocal/chessboard/Chessboard.h @@ -3,6 +3,8 @@ #include #include +#include +#include namespace camodocal { diff --git a/pose_graph/src/ThirdParty/DVision/BRIEF.cpp b/pose_graph/src/ThirdParty/DVision/BRIEF.cpp index 6af73c481..49940d1ad 100644 --- a/pose_graph/src/ThirdParty/DVision/BRIEF.cpp +++ b/pose_graph/src/ThirdParty/DVision/BRIEF.cpp @@ -50,7 +50,7 @@ void BRIEF::compute(const cv::Mat &image, cv::Mat aux; if(image.depth() == 3) { - cv::cvtColor(image, aux, CV_RGB2GRAY); + cv::cvtColor(image, aux, cv::COLOR_RGB2GRAY); } else { diff --git a/pose_graph/src/keyframe.cpp b/pose_graph/src/keyframe.cpp index b8e757eba..f3f83574c 100644 --- a/pose_graph/src/keyframe.cpp +++ b/pose_graph/src/keyframe.cpp @@ -441,9 +441,9 @@ bool KeyFrame::findConnection(KeyFrame* old_kf) cv::line(loop_match_img, matched_2d_cur[i], old_pt, cv::Scalar(0, 255, 0), 2, 8, 0); } cv::Mat notation(50, COL + gap + COL, CV_8UC3, cv::Scalar(255, 255, 255)); - putText(notation, "current frame: " + to_string(index) + " sequence: " + to_string(sequence), cv::Point2f(20, 30), CV_FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(255), 3); + putText(notation, "current frame: " + to_string(index) + " sequence: " + to_string(sequence), cv::Point2f(20, 30), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(255), 3); - putText(notation, "previous frame: " + to_string(old_kf->index) + " sequence: " + to_string(old_kf->sequence), cv::Point2f(20 + COL + gap, 30), CV_FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(255), 3); + putText(notation, "previous frame: " + to_string(old_kf->index) + " sequence: " + to_string(old_kf->sequence), cv::Point2f(20 + COL + gap, 30), cv::FONT_HERSHEY_SIMPLEX, 1, cv::Scalar(255), 3); cv::vconcat(notation, loop_match_img, loop_match_img); /* diff --git a/pose_graph/src/pose_graph.cpp b/pose_graph/src/pose_graph.cpp index ada506522..d2115a846 100644 --- a/pose_graph/src/pose_graph.cpp +++ b/pose_graph/src/pose_graph.cpp @@ -309,7 +309,7 @@ int PoseGraph::detectLoop(KeyFrame* keyframe, int frame_index) { int feature_num = keyframe->keypoints.size(); cv::resize(keyframe->image, compressed_image, cv::Size(376, 240)); - putText(compressed_image, "feature_num:" + to_string(feature_num), cv::Point2f(10, 10), CV_FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); + putText(compressed_image, "feature_num:" + to_string(feature_num), cv::Point2f(10, 10), cv::FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); image_pool[frame_index] = compressed_image; } TicToc tmp_t; @@ -330,7 +330,7 @@ int PoseGraph::detectLoop(KeyFrame* keyframe, int frame_index) { loop_result = compressed_image.clone(); if (ret.size() > 0) - putText(loop_result, "neighbour score:" + to_string(ret[0].Score), cv::Point2f(10, 50), CV_FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255)); + putText(loop_result, "neighbour score:" + to_string(ret[0].Score), cv::Point2f(10, 50), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255)); } // visual loop result if (DEBUG_IMAGE) @@ -340,7 +340,7 @@ int PoseGraph::detectLoop(KeyFrame* keyframe, int frame_index) int tmp_index = ret[i].Id; auto it = image_pool.find(tmp_index); cv::Mat tmp_image = (it->second).clone(); - putText(tmp_image, "index: " + to_string(tmp_index) + "loop score:" + to_string(ret[i].Score), cv::Point2f(10, 50), CV_FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255)); + putText(tmp_image, "index: " + to_string(tmp_index) + "loop score:" + to_string(ret[i].Score), cv::Point2f(10, 50), cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255)); cv::hconcat(loop_result, tmp_image, loop_result); } } @@ -357,7 +357,7 @@ int PoseGraph::detectLoop(KeyFrame* keyframe, int frame_index) { auto it = image_pool.find(tmp_index); cv::Mat tmp_image = (it->second).clone(); - putText(tmp_image, "loop score:" + to_string(ret[i].Score), cv::Point2f(10, 50), CV_FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); + putText(tmp_image, "loop score:" + to_string(ret[i].Score), cv::Point2f(10, 50), cv::FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); cv::hconcat(loop_result, tmp_image, loop_result); } } @@ -393,7 +393,7 @@ void PoseGraph::addKeyFrameIntoVoc(KeyFrame* keyframe) { int feature_num = keyframe->keypoints.size(); cv::resize(keyframe->image, compressed_image, cv::Size(376, 240)); - putText(compressed_image, "feature_num:" + to_string(feature_num), cv::Point2f(10, 10), CV_FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); + putText(compressed_image, "feature_num:" + to_string(feature_num), cv::Point2f(10, 10), cv::FONT_HERSHEY_SIMPLEX, 0.4, cv::Scalar(255)); image_pool[keyframe->index] = compressed_image; }