diff --git a/skimage/feature/template.py b/skimage/feature/template.py index d90fe0c5..4533c636 100644 --- a/skimage/feature/template.py +++ b/skimage/feature/template.py @@ -60,33 +60,33 @@ def match_template(image, template, pad_input=False, mode='constant', >>> template = np.zeros((3, 3)) >>> template[1, 1] = 1 >>> template - array([[ 0. 0. 0.] - [ 0. 1. 0.] - [ 0. 0. 0.]]) + array([[ 0., 0., 0.], + [ 0., 1., 0.], + [ 0., 0., 0.]]) >>> image = np.zeros((6, 6)) >>> image[1, 1] = 1 >>> image[4, 4] = -1 >>> image - array([[ 0. 0. 0. 0. 0. 0.] - [ 0. 1. 0. 0. 0. 0.] - [ 0. 0. 0. 0. 0. 0.] - [ 0. 0. 0. 0. 0. 0.] - [ 0. 0. 0. 0. -1. 0.] - [ 0. 0. 0. 0. 0. 0.]]) + array([[ 0., 0., 0., 0., 0., 0.], + [ 0., 1., 0., 0., 0., 0.], + [ 0., 0., 0., 0., 0., 0.], + [ 0., 0., 0., 0., 0., 0.], + [ 0., 0., 0., 0., -1., 0.], + [ 0., 0., 0., 0., 0., 0.]]) >>> result = match_template(image, template) >>> np.round(result, 3) - array([[ 1. -0.125 0. 0. ] - [-0.125 -0.125 0. 0. ] - [ 0. 0. 0.125 0.125] - [ 0. 0. 0.125 -1. ]]) + array([[ 1. , -0.125, 0. , 0. ], + [-0.125, -0.125, 0. , 0. ], + [ 0. , 0. , 0.125, 0.125], + [ 0. , 0. , 0.125, -1. ]]) >>> result = match_template(image, template, pad_input=True) >>> np.round(result, 3) - array([[-0.125 -0.125 -0.125 0. 0. 0. ] - [-0.125 1. -0.125 0. 0. 0. ] - [-0.125 -0.125 -0.125 0. 0. 0. ] - [ 0. 0. 0. 0.125 0.125 0.125] - [ 0. 0. 0. 0.125 -1. 0.125] - [ 0. 0. 0. 0.125 0.125 0.125]]) + array([[-0.125, -0.125, -0.125, 0. , 0. , 0. ], + [-0.125, 1. , -0.125, 0. , 0. , 0. ], + [-0.125, -0.125, -0.125, 0. , 0. , 0. ], + [ 0. , 0. , 0. , 0.125, 0.125, 0.125], + [ 0. , 0. , 0. , 0.125, -1. , 0.125], + [ 0. , 0. , 0. , 0.125, 0.125, 0.125]]) """ if np.any(np.less(image.shape, template.shape)):