mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-21 12:50:27 +08:00
Set match_template to default to no padding and fix test.
This commit is contained in:
@@ -6,7 +6,7 @@ import _template
|
||||
from skimage.util.dtype import _convert
|
||||
|
||||
|
||||
def match_template(image, template, pad_output=True):
|
||||
def match_template(image, template, pad_output=False):
|
||||
"""Match a template to an image using normalized correlation.
|
||||
|
||||
The output is an array with values between -1.0 and 1.0, which correspond
|
||||
|
||||
@@ -59,8 +59,8 @@ def test_normalization():
|
||||
sorted_result = np.argsort(result.flat)
|
||||
iflat_min = sorted_result[0]
|
||||
iflat_max = sorted_result[-1]
|
||||
min_result = np.unravel_index(iflat_min, (N, N))
|
||||
max_result = np.unravel_index(iflat_max, (N, N))
|
||||
min_result = np.unravel_index(iflat_min, result.shape)
|
||||
max_result = np.unravel_index(iflat_max, result.shape)
|
||||
|
||||
# shift result by 1 because of template border
|
||||
assert np.all((np.array(min_result) + 1) == (ineg, jneg))
|
||||
|
||||
Reference in New Issue
Block a user