diff --git a/modules/imgproc/src/contours_new.cpp b/modules/imgproc/src/contours_new.cpp index 67bc7aa2dd..ed48f1e1ff 100644 --- a/modules/imgproc/src/contours_new.cpp +++ b/modules/imgproc/src/contours_new.cpp @@ -649,7 +649,7 @@ void cv::findContours(InputArray _image, } // Fast path: RETR_LIST without hierarchy → findTRUContours (parallel contour extraction) - if (mode == RETR_LIST && !_hierarchy.needed()) + if (mode == RETR_LIST && !_hierarchy.needed() && _image.type() == CV_8UC1) { // findTRUContours requires FOREGROUND=255; binarize=true thresholds the padded // image in-place, avoiding an extra allocation (findContours accepts any non-zero value) diff --git a/modules/imgproc/src/contours_truco.cpp b/modules/imgproc/src/contours_truco.cpp index a4d3c0cce0..94f1f332f6 100644 --- a/modules/imgproc/src/contours_truco.cpp +++ b/modules/imgproc/src/contours_truco.cpp @@ -618,7 +618,7 @@ void findTRUContours(InputArray _src, OutputArrayOfArrays _contours, int minSize { CV_INSTRUMENT_REGION(); Mat src = _src.getMat(); - CV_Assert(!src.empty() && src.type() == CV_8UC1); + CV_Assert(src.type() == CV_8UC1); // Buffer handling cv::Mat padded;