From 6825375694be46933aed68dfe7e196fed26d9772 Mon Sep 17 00:00:00 2001 From: anirudt Date: Mon, 29 Aug 2016 20:22:08 +0530 Subject: [PATCH 1/3] docs: adds note for python in docs related to moments --- 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 71c4f48d12..ad71d8b8ee 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -3570,6 +3570,8 @@ results are returned in the structure cv::Moments. @param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array ( \f$1 \times N\f$ or \f$N \times 1\f$ ) of 2D points (Point or Point2f ). +Note: For Python users, note that the numpy type for the input array should be either np.int32 or +np.float32, or in general of type CV_32S or CV_32F. @param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is used for images only. @returns moments. From 06e0fb25e92ec7abbdae75e3e502a785a11367e1 Mon Sep 17 00:00:00 2001 From: anirudt Date: Fri, 9 Sep 2016 13:23:43 +0530 Subject: [PATCH 2/3] docs: adds doxygen @note for python in docs related to contour moments --- modules/imgproc/include/opencv2/imgproc.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index ad71d8b8ee..15bed25b9b 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -3570,12 +3570,15 @@ results are returned in the structure cv::Moments. @param array Raster image (single-channel, 8-bit or floating-point 2D array) or an array ( \f$1 \times N\f$ or \f$N \times 1\f$ ) of 2D points (Point or Point2f ). -Note: For Python users, note that the numpy type for the input array should be either np.int32 or -np.float32, or in general of type CV_32S or CV_32F. @param binaryImage If it is true, all non-zero image pixels are treated as 1's. The parameter is used for images only. @returns moments. +@note Only applicable to contour moments calculations: For Python users, note that the numpy +type for the input array should be either np.int32 or np.float32, or in general of type CV_32S or CV_32F. +Thus, np.float will not work in this case, as it is the same as np.float64 and does not satisfy the +Point2f type check. + @sa contourArea, arcLength */ CV_EXPORTS_W Moments moments( InputArray array, bool binaryImage = false ); From 2879eada253eaad31b962ae0f45f7d91b0e537a6 Mon Sep 17 00:00:00 2001 From: anirudt Date: Tue, 13 Sep 2016 16:14:05 +0530 Subject: [PATCH 3/3] docs: truncated commit msg --- modules/imgproc/include/opencv2/imgproc.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/include/opencv2/imgproc.hpp b/modules/imgproc/include/opencv2/imgproc.hpp index 15bed25b9b..fef0f6083f 100644 --- a/modules/imgproc/include/opencv2/imgproc.hpp +++ b/modules/imgproc/include/opencv2/imgproc.hpp @@ -3574,10 +3574,8 @@ results are returned in the structure cv::Moments. used for images only. @returns moments. -@note Only applicable to contour moments calculations: For Python users, note that the numpy -type for the input array should be either np.int32 or np.float32, or in general of type CV_32S or CV_32F. -Thus, np.float will not work in this case, as it is the same as np.float64 and does not satisfy the -Point2f type check. +@note Only applicable to contour moments calculations from Python bindings: Note that the numpy +type for the input array should be either np.int32 or np.float32. @sa contourArea, arcLength */