diff --git a/modules/imgproc/src/deriv.cpp b/modules/imgproc/src/deriv.cpp index c0b6e0853a..5e920ec0b8 100644 --- a/modules/imgproc/src/deriv.cpp +++ b/modules/imgproc/src/deriv.cpp @@ -410,7 +410,7 @@ static bool IPPDerivScharr(InputArray _src, OutputArray _dst, int ddepth, int dx static bool IPPDerivSobel(InputArray _src, OutputArray _dst, int ddepth, int dx, int dy, int ksize, double scale, double delta, int borderType) { - if ((borderType != BORDER_REPLICATE) || (3 != ksize) || (5 != ksize)) + if ((borderType != BORDER_REPLICATE) || ((3 != ksize) && (5 != ksize))) return false; if (fabs(delta) > FLT_EPSILON) return false;