Error message for wrong kernel size was insufficient.
authorthemightyoarfish <rdiederichse@uos.de>
Mon, 28 Mar 2016 12:06:55 +0000 (14:06 +0200)
committerthemightyoarfish <rdiederichse@uos.de>
Mon, 28 Mar 2016 12:06:55 +0000 (14:06 +0200)
When setting a wrong kernel size, the error message only tells the user that it
must be odd, however the conditions for rejection include values > 7 which must
be communicated. Without that, the message would be incorrect and confusing if
the user is unaware that only values 3, 5, 7 are accepted.

modules/imgproc/src/canny.cpp

index 22ed547..18cdbd7 100644 (file)
@@ -607,7 +607,7 @@ void cv::Canny( InputArray _src, OutputArray _dst,
     }
 
     if ((aperture_size & 1) == 0 || (aperture_size != -1 && (aperture_size < 3 || aperture_size > 7)))
-        CV_Error(CV_StsBadFlag, "Aperture size should be odd");
+        CV_Error(CV_StsBadFlag, "Aperture size should be odd between 3 and 7");
 
     if (low_thresh > high_thresh)
         std::swap(low_thresh, high_thresh);