From 9d3072d3f8460d1d64a8ec1354461f03a45cae20 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sat, 4 Feb 2012 00:34:34 -0500 Subject: [PATCH] Fix type errors in `match_template` by casting inputs to float32. --- skimage/feature/template.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skimage/feature/template.py b/skimage/feature/template.py index 6bf02896..448326f1 100644 --- a/skimage/feature/template.py +++ b/skimage/feature/template.py @@ -3,6 +3,8 @@ import numpy as np import _template +from skimage.util.dtype import _convert + try: import cv opencv_available = True @@ -80,5 +82,7 @@ def match_template(image, template, method="norm-coeff"): method_num = 1 else: raise ValueError("Unknown template method: %s" % method) + image = _convert(image, np.float32) + template = _convert(template, np.float32) return _template.match_template(image, template, method_num)