mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-29 11:26:57 +08:00
Fix type errors in match_template by casting inputs to float32.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user