From cf2e899486856c8d880cb524f5838a7933aa03a3 Mon Sep 17 00:00:00 2001 From: shimat Date: Sun, 11 Apr 2021 07:35:35 +0900 Subject: [PATCH] [ximgproc::rl::createRLEImage] make runs const --- .../include/opencv2/ximgproc/run_length_morphology.hpp | 2 +- modules/ximgproc/src/run_length_morphology.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ximgproc/include/opencv2/ximgproc/run_length_morphology.hpp b/modules/ximgproc/include/opencv2/ximgproc/run_length_morphology.hpp index 5754691a2ca..c19e2d858db 100644 --- a/modules/ximgproc/include/opencv2/ximgproc/run_length_morphology.hpp +++ b/modules/ximgproc/include/opencv2/ximgproc/run_length_morphology.hpp @@ -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& runs, OutputArray res, Size size = Size(0, 0)); +CV_EXPORTS void createRLEImage(const std::vector& runs, OutputArray res, Size size = Size(0, 0)); /** * @brief Applies a morphological operation to a run-length encoded binary image. diff --git a/modules/ximgproc/src/run_length_morphology.cpp b/modules/ximgproc/src/run_length_morphology.cpp index fb9bf76d7fa..fe2f29f5ad3 100644 --- a/modules/ximgproc/src/run_length_morphology.cpp +++ b/modules/ximgproc/src/run_length_morphology.cpp @@ -700,13 +700,13 @@ CV_EXPORTS bool isRLMorphologyPossible(InputArray rlStructuringElement) return true; } -CV_EXPORTS void createRLEImage(std::vector& runs, OutputArray res, Size size) +CV_EXPORTS void createRLEImage(const std::vector& 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);