From 22cbfd671831cd6f1df3f0eff3641a3d8426a947 Mon Sep 17 00:00:00 2001 From: berak Date: Wed, 17 Mar 2021 09:08:40 +0100 Subject: [PATCH] ximgproc: add an assert in thinning() --- modules/ximgproc/src/thinning.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ximgproc/src/thinning.cpp b/modules/ximgproc/src/thinning.cpp index c62c13e6d..b28784d28 100644 --- a/modules/ximgproc/src/thinning.cpp +++ b/modules/ximgproc/src/thinning.cpp @@ -69,6 +69,7 @@ static void thinningIteration(Mat img, int iter, int thinningType){ // Apply the thinning procedure to a given image void thinning(InputArray input, OutputArray output, int thinningType){ Mat processed = input.getMat().clone(); + CV_CheckTypeEQ(processed.type(), CV_8UC1, ""); // Enforce the range of the input image to be in between 0 - 255 processed /= 255;