From 51ba0f9b0170fa64af8b6ab8e3fce87e73ed55c1 Mon Sep 17 00:00:00 2001 From: nofreewill42 Date: Mon, 30 Oct 2023 05:21:23 +0100 Subject: [PATCH] Build with OpenCV version >4.0 Build fails, needs cv:: before CV_HSV2BGR after OpenCV version 4.0, at least that's what I suppose based on the following issuecomment: https://github.com/NVIDIA/DALI/issues/735#issuecomment-479760748 --- src/calibration.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/calibration.cpp b/src/calibration.cpp index a3418b3..4b4c266 100644 --- a/src/calibration.cpp +++ b/src/calibration.cpp @@ -24,7 +24,11 @@ void Create_ColorBar() pColor[ba * 3 + 1] = S[s / 13]; pColor[ba * 3 + 2] = V[v / 13 / 3]; } - cv::cvtColor(color, color_bar, CV_HSV2BGR); + #if (CV_VERSION_MAJOR >= 4) + cv::cvtColor(color, color_bar, cv::COLOR_HSV2BGR); + #else + cv::cvtColor(color, color_bar, COLOR_HSV2BGR); + #endif } @@ -647,4 +651,4 @@ bool Calibrator::ProjectOnImage(const Eigen::Vector4f &vec, const Eigen::Matrix4 if (x >= -margin && x < IMG_W + margin && y >= -margin && y < IMG_H + margin) return true; return false; -} \ No newline at end of file +}