From 76f75c8ab619978ae219ccf11c9340d8a98e3f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 25 Aug 2012 22:46:45 +0200 Subject: [PATCH] Fix C-contiguous array bug in match template --- skimage/feature/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/feature/template.py b/skimage/feature/template.py index 500f02a0..19d22c9b 100644 --- a/skimage/feature/template.py +++ b/skimage/feature/template.py @@ -67,8 +67,8 @@ def match_template(image, template, pad_input=False): """ if np.any(np.less(image.shape, template.shape)): raise ValueError("Image must be larger than template.") - image = convert(image, np.float32) - template = convert(template, np.float32) + image = np.ascontiguousarray(image, dtype=np.float32) + template = np.ascontiguousarray(template, dtype=np.float32) if pad_input: pad_size = tuple(np.array(image.shape) + np.array(template.shape) - 1)