From 6a4c3b61e6fe8f40e52f510048d712497ce3bb3d Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Mon, 4 Jul 2022 12:09:33 +0300 Subject: [PATCH] Improve doc of calcHist overload that accepts vectors It's not clear how ranges argument should be used in the overload of calcHist that accepts std::vector. The main overload uses array of arrays there, while std::vector overload uses a plain array. The code interprets the vector as a flattened array and rebuilds array of arrays from it. This is not obvious interpretation, so documentation has been added to explain the expected usage. --- modules/imgproc/include/opencv2/imgproc.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 4cb077f375..fd1a5d9721 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -3270,7 +3270,14 @@ CV_EXPORTS void calcHist( const Mat* images, int nimages, const int* histSize, const float** ranges, bool uniform = true, bool accumulate = false ); -/** @overload */ +/** @overload + +this variant supports only uniform histograms. + +ranges argument is either empty vector or a flattened vector of histSize.size()*2 elements +(histSize.size() element pairs). The first and second elements of each pair specify the lower and +upper boundaries. +*/ CV_EXPORTS_W void calcHist( InputArrayOfArrays images, const std::vector& channels, InputArray mask, OutputArray hist,