Merge pull request #2920 from shimat:createRLEImage_const

pull/2922/head
Alexander Alekhin 4 years ago
commit 70f7ca4541
  1. 2
      modules/ximgproc/include/opencv2/ximgproc/run_length_morphology.hpp
  2. 4
      modules/ximgproc/src/run_length_morphology.cpp

@ -94,7 +94,7 @@ CV_EXPORTS bool isRLMorphologyPossible(InputArray rlStructuringElement);
* @param size image size (to be used if an "on" boundary should be used in erosion, using the default
* means that the size is computed from the extension of the input)
*/
CV_EXPORTS void createRLEImage(std::vector<cv::Point3i>& runs, OutputArray res, Size size = Size(0, 0));
CV_EXPORTS void createRLEImage(const std::vector<cv::Point3i>& runs, OutputArray res, Size size = Size(0, 0));
/**
* @brief Applies a morphological operation to a run-length encoded binary image.

@ -700,13 +700,13 @@ CV_EXPORTS bool isRLMorphologyPossible(InputArray rlStructuringElement)
return true;
}
CV_EXPORTS void createRLEImage(std::vector<cv::Point3i>& runs, OutputArray res, Size size)
CV_EXPORTS void createRLEImage(const std::vector<cv::Point3i>& runs, OutputArray res, Size size)
{
size_t nRuns = runs.size();
rlVec runsConverted(nRuns);
for (size_t i = 0u; i < nRuns; ++i)
{
Point3i &curIn = runs[i];
const Point3i &curIn = runs[i];
runsConverted[i] = rlType(curIn.x, curIn.y, curIn.z);
}
sortChords(runsConverted);

Loading…
Cancel
Save