From fa4d32f7dde6a6ca5ba688e16a4984dfd0cb15ec Mon Sep 17 00:00:00 2001 From: LaurentBerger Date: Mon, 6 Feb 2017 22:49:18 +0100 Subject: [PATCH 1/2] Solve issue 8136 opencv doc of threshold --- modules/imgproc/include/opencv2/imgproc.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 243d72b32e..3680492077 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -2709,7 +2709,7 @@ CV_EXPORTS_W void createHanningWindow(OutputArray dst, Size winSize, int type); /** @brief Applies a fixed-level threshold to each array element. -The function applies fixed-level thresholding to a single-channel array. The function is typically +The function applies fixed-level thresholding to a multiple-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image ( cv::compare could be also used for this purpose) or for removing a noise, that is, filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by @@ -2721,8 +2721,8 @@ or Triangle algorithm and uses it instead of the specified thresh . The function computed threshold value. Currently, the Otsu's and Triangle methods are implemented only for 8-bit images. -@param src input array (single-channel, 8-bit or 32-bit floating point). -@param dst output array of the same size and type as src. +@param src input array (multiple-channel, 8-bit or 32-bit floating point). +@param dst output array of the same size and type and the same number of channels as src. @param thresh threshold value. @param maxval maximum value to use with the THRESH_BINARY and THRESH_BINARY_INV thresholding types. From b3c1bd788a313071ba33239baf7ff80edef8e5b1 Mon Sep 17 00:00:00 2001 From: LaurentBerger Date: Tue, 7 Feb 2017 10:14:24 +0100 Subject: [PATCH 2/2] Add note about OTSU and TRIANGLE (comment sovrasov) --- modules/imgproc/include/opencv2/imgproc.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 3680492077..c2c694b36b 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -2721,6 +2721,8 @@ or Triangle algorithm and uses it instead of the specified thresh . The function computed threshold value. Currently, the Otsu's and Triangle methods are implemented only for 8-bit images. +@note Input image should be single channel only in case of CV_THRESH_OTSU or CV_THRESH_TRIANGLE flags + @param src input array (multiple-channel, 8-bit or 32-bit floating point). @param dst output array of the same size and type and the same number of channels as src. @param thresh threshold value.