Set match_template to default to no padding and fix test.

This commit is contained in:
Tony S Yu
2012-05-08 21:32:08 -04:00
parent ad99285bc0
commit 383ca6220a
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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))