Error message for wrong kernel size was insufficient.

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.
pull/6335/head
themightyoarfish 9 years ago
parent 1e1dc1429f
commit 68d97502fe
  1. 2
      modules/imgproc/src/canny.cpp

@ -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);

Loading…
Cancel
Save