From ef2661ef0434e5b0a7a7d5f59919d492bd0a3ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20=C3=89corchard?= Date: Thu, 8 Oct 2020 22:17:18 +0200 Subject: [PATCH] Port to OpenCV 4 --- src/file.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cpp b/src/file.cpp index 617aa44..313294c 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -88,7 +88,7 @@ loadMapFromFile(nav_msgs::GetMap::Response* resp, fname + std::string("\""); throw std::runtime_error(errmsg); } - cvtColor(imgColor, img, CV_BGR2GRAY); + cvtColor(imgColor, img, cv::COLOR_BGR2GRAY); // Copy the image data into the map structure resp->map.info.width = img.rows; @@ -113,7 +113,7 @@ loadMapFromFile(nav_msgs::GetMap::Response* resp, for (i = 0; i < resp->map.info.width; i++) { // Compute mean of RGB for this pixel - color_avg = (double)(img.at(i, j)); + color_avg = static_cast(img.at(i, j)); // If negate is true, we consider blacker pixels free, and whiter // pixels free. Otherwise, it's vice versa.