Fix input test of template matching

This commit is contained in:
Johannes Schönberger
2014-01-13 06:50:19 -05:00
parent 7b098ce35d
commit bc8c11933f
+3 -2
View File
@@ -105,8 +105,9 @@ def match_template(image, template, pad_input=False, mode='constant',
if image.ndim not in (2, 3) or template.ndim not in (2, 3):
raise ValueError("Only 2- and 3-D images supported.")
if image.ndim != template.ndim:
raise ValueError("Dimensionality of template must match image.")
if image.ndim < template.ndim:
raise ValueError("Dimensionality of template must be less than or "
"equal to the dimensionality of image.")
if np.any(np.less(image.shape, template.shape)):
raise ValueError("Image must be larger than template.")