From 22eb91a7e024bcc979d2cb11eb0835def56f6a69 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Sat, 3 Sep 2022 11:49:00 +0300 Subject: [PATCH] Update hough.cpp --- modules/imgproc/src/hough.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/imgproc/src/hough.cpp b/modules/imgproc/src/hough.cpp index 40ac546a41..13e349b97e 100644 --- a/modules/imgproc/src/hough.cpp +++ b/modules/imgproc/src/hough.cpp @@ -2293,6 +2293,9 @@ static void HoughCircles( InputArray _image, OutputArray _circles, break; case HOUGH_GRADIENT_ALT: { + if( param2 >= 1 ) + CV_Error( Error::StsOutOfRange, "when using HOUGH_GRADIENT_ALT method, param2 parameter must be smaller than 1.0" ); + std::vector circles; Mat image = _image.getMat(); HoughCirclesAlt(image, circles, dp, minDist, minRadius, maxRadius, param1, param2); @@ -2320,7 +2323,7 @@ static void HoughCircles( InputArray _image, OutputArray _circles, } break; default: - CV_Error( Error::StsBadArg, "Unrecognized method id. Actually only CV_HOUGH_GRADIENT is supported." ); + CV_Error( Error::StsBadArg, "Unrecognized method id. Actually supported methods are HOUGH_GRADIENT and HOUGH_GRADIENT_ALT" ); } }