mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-07 09:52:21 +08:00
Merge pull request #272 from ahojnnes/template-contiguous
BUG: Fix C-contiguous array bug in match template.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user