Advertisement
cd62131

build https://github.com/davidstutz/superpixel-benchmark

Feb 9th, 2023 (edited)
1,620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.06 KB | None | 0 0
  1. diff --git a/etps_cli/main.cpp b/etps_cli/main.cpp
  2. index 4330734..1ad0f74 100644
  3. --- a/etps_cli/main.cpp
  4. +++ b/etps_cli/main.cpp
  5. @@ -32,7 +32,6 @@
  6.  #include <fstream>
  7.  #include <opencv2/opencv.hpp>
  8.  #include <boost/filesystem.hpp>
  9. -#include <boost/timer.hpp>
  10.  #include <boost/program_options.hpp>
  11.  #include <boost/timer.hpp>
  12.  #include "etps_opencv.h"
  13. diff --git a/lib_crs/crs_opencv.h b/lib_crs/crs_opencv.h
  14. index 01992f1..c035d3f 100644
  15. --- a/lib_crs/crs_opencv.h
  16. +++ b/lib_crs/crs_opencv.h
  17. @@ -84,7 +84,7 @@ public:
  18.              switch (color_space) {
  19.                  default:
  20.                  case 0: // YCrCb
  21. -                    cv::cvtColor(image, image_YCrCb, CV_BGR2YCrCb);
  22. +                    cv::cvtColor(image, image_YCrCb, cv::COLOR_BGR2YCrCb);
  23.                      cv::split(image_YCrCb, image_channels);
  24.                      break;
  25.                  case 1: // RGB
  26. diff --git a/lib_etps/spixel.cpp b/lib_etps/spixel.cpp
  27. index 3e88a45..a5bbc37 100644
  28. --- a/lib_etps/spixel.cpp
  29. +++ b/lib_etps/spixel.cpp
  30. @@ -75,7 +75,7 @@ void ProcessFilesBatch(SPSegmentationParameters& params, const vector<string>& f
  31.  
  32.      for (const string& f : files) {
  33.          string fileName = fileDir + f;
  34. -        Mat image = imread(fileName, CV_LOAD_IMAGE_COLOR);
  35. +        Mat image = imread(fileName, cv::IMREAD_COLOR);
  36.  
  37.          if (image.rows == 0 || image.cols == 0) {
  38.              cout << "Failed reading image '" << fileName << "'" << endl;
  39. @@ -121,8 +121,8 @@ void ProcessFilesStereoBatch(SPSegmentationParameters& params, const vector<stri
  40.      for (const string& f : files) {
  41.          string fileName = fileDir + f;
  42.          string dispFileName = dispPattern.empty() ? dispDir : ChangeExtension(dispDir + f, dispPattern);
  43. -        Mat image = imread(fileName, CV_LOAD_IMAGE_COLOR);
  44. -        Mat dispImage = imread(dispFileName, CV_LOAD_IMAGE_ANYDEPTH);
  45. +        Mat image = imread(fileName, cv::IMREAD_COLOR);
  46. +        Mat dispImage = imread(dispFileName, cv::IMREAD_ANYDEPTH);
  47.  
  48.          if (image.rows == 0 || image.cols == 0) {
  49.              cout << "Failed reading image '" << fileName << "'" << endl;
  50. @@ -171,8 +171,8 @@ void ProcessFilesStereoBatchSGM(SPSegmentationParameters& params, const vector<s
  51.      for (const string& f : files) {
  52.          string leftFileName = leftFileDir + f;
  53.          string rightFileName = rightIsName ? rightFileDir : rightFileDir + f;
  54. -        Mat leftImage = imread(leftFileName, CV_LOAD_IMAGE_COLOR);
  55. -        Mat rightImage = imread(rightFileName, CV_LOAD_IMAGE_COLOR);
  56. +        Mat leftImage = imread(leftFileName, cv::IMREAD_COLOR);
  57. +        Mat rightImage = imread(rightFileName, cv::IMREAD_COLOR);
  58.  
  59.          if (leftImage.empty()) {
  60.              cout << "Failed reading left image '" << leftImage << "'" << endl;
  61. diff --git a/lib_eval/evaluation.cpp b/lib_eval/evaluation.cpp
  62. index 3555af0..929a12e 100644
  63. --- a/lib_eval/evaluation.cpp
  64. +++ b/lib_eval/evaluation.cpp
  65. @@ -521,7 +521,7 @@ float Evaluation::computeMeanDistanceToEdge(const cv::Mat &labels,
  66.      }
  67.      
  68.      cv::Mat distance;
  69. -    cv::distanceTransform(boundary, distance, CV_DIST_L2, 3);
  70. +    cv::distanceTransform(boundary, distance, cv::DIST_L2, 3);
  71.      
  72.      float mean_distance_edge = 0;
  73.      int count = 0;
  74. @@ -719,7 +719,7 @@ float Evaluation::computeContourDensity(const cv::Mat &labels) {
  75.  void computeGradientMagnitude(const cv::Mat &image, cv::Mat &gradient_magnitude) {
  76.      cv::Mat image_gray;
  77.      if (image.channels() == 3) {
  78. -        cv::cvtColor(image, image_gray, CV_BGR2GRAY);
  79. +        cv::cvtColor(image, image_gray, cv::COLOR_BGR2GRAY);
  80.      }
  81.      else {
  82.          image_gray = image.clone();
  83. @@ -755,7 +755,7 @@ void computeGradientMagnitude(const cv::Mat &image, cv::Mat &gradient_magnitude)
  84.  void computeCannyEdges(const cv::Mat &image, float threshold, cv::Mat &canny) {
  85.      cv::Mat image_gray;
  86.      if (image.channels() == 3) {
  87. -        cv::cvtColor(image, image_gray, CV_BGR2GRAY);
  88. +        cv::cvtColor(image, image_gray, cv::COLOR_BGR2GRAY);
  89.      }
  90.      else {
  91.          image_gray = image.clone();
  92. diff --git a/lib_eval/evaluation_summary.cpp b/lib_eval/evaluation_summary.cpp
  93. index e94762a..b37e426 100644
  94. --- a/lib_eval/evaluation_summary.cpp
  95. +++ b/lib_eval/evaluation_summary.cpp
  96. @@ -1188,7 +1188,7 @@ void EvaluationSummary::computeSummary(int &gt_max) {
  97.          cv::Mat sp_segmentation;
  98.  //        IOUtil::readMatCSVInt(it->second, sp_segmentation, image.rows, image.cols);
  99.          IOUtil::readMatCSVInt(it->second, sp_segmentation);
  100. -        cv::Mat image = cv::imread(img_file.string(), CV_LOAD_IMAGE_COLOR);
  101. +        cv::Mat image = cv::imread(img_file.string(), cv::IMREAD_COLOR);
  102.          
  103.  //        cv::namedWindow("Image");
  104.  //        cv::imshow("Image", image);
  105. diff --git a/lib_eval/robustness_tool.cpp b/lib_eval/robustness_tool.cpp
  106. index 08400e9..e344edd 100644
  107. --- a/lib_eval/robustness_tool.cpp
  108. +++ b/lib_eval/robustness_tool.cpp
  109. @@ -512,12 +512,12 @@ BilateralFilterDriver::BilateralFilterDriver(const std::vector<int> &sizes_, con
  110.  void BilateralFilterDriver::computeImage(const cv::Mat& image, cv::Mat& computed_image) {
  111.      
  112.      cv::Mat image_lab;
  113. -    cv::cvtColor(image, image_lab, CV_BGR2Lab);
  114. +    cv::cvtColor(image, image_lab, cv::COLOR_BGR2Lab);
  115.      
  116.      cv::Mat computed_image_lab;
  117.      Transformation::applyBilateralFilter(image_lab, sizes[current], color_variances[current],
  118.              space_variances[current], computed_image_lab);
  119. -    cv::cvtColor(computed_image_lab, computed_image, CV_Lab2BGR);
  120. +    cv::cvtColor(computed_image_lab, computed_image, cv::COLOR_Lab2BGR);
  121.      
  122.  }
  123.  
  124. diff --git a/lib_eval/transformation.cpp b/lib_eval/transformation.cpp
  125. index 8ad2729..454b80c 100644
  126. --- a/lib_eval/transformation.cpp
  127. +++ b/lib_eval/transformation.cpp
  128. @@ -78,7 +78,7 @@ void Transformation::applyGaussianSamplingErrors(const cv::Mat &image, float var
  129.      std::normal_distribution<float> g(0, variance);
  130.      
  131.      cv::Mat image_gray;
  132. -    cv::cvtColor(image, image_gray, CV_BGR2GRAY);
  133. +    cv::cvtColor(image, image_gray, cv::COLOR_BGR2GRAY);
  134.      
  135.      cv::Mat grad_x;
  136.      cv::Mat grad_y;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement