mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
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.
This commit is contained in:
@@ -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()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user