From bc8c11933fc31688c0e0e0745e94c66a54a7dc74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 12 Jan 2014 20:26:05 -0500 Subject: [PATCH] Fix input test of template matching --- skimage/feature/template.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/skimage/feature/template.py b/skimage/feature/template.py index 781ee951..fbf95866 100644 --- a/skimage/feature/template.py +++ b/skimage/feature/template.py @@ -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.")