From 8b6460b06eb333af9de44330b65fb6308e453f28 Mon Sep 17 00:00:00 2001 From: Martin Zackrisson Date: Mon, 30 May 2016 11:13:58 +0200 Subject: [PATCH] Correcting the Error raised for Otsu Threshold The previous error, `TypeError` did not reflect the test done and would typically be raised while `image` indeed had the correct type. --- skimage/filters/thresholding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/filters/thresholding.py b/skimage/filters/thresholding.py index 331ea3f4..d21bd579 100644 --- a/skimage/filters/thresholding.py +++ b/skimage/filters/thresholding.py @@ -133,7 +133,7 @@ def threshold_otsu(image, nbins=256): # Check if the image is multi-colored or not if image.min() == image.max(): - raise TypeError("threshold_otsu is expected to work with images " \ + raise ValueError("threshold_otsu is expected to work with images " \ "having more than one color. The input image seems " \ "to have just one color {0}.".format(image.min()))