From d43049da713df6bab2e56a755f9f50f764f5109b Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Sun, 11 Dec 2011 23:05:57 -0500 Subject: [PATCH] Wrap long lines --- skimage/detection/_template.pyx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skimage/detection/_template.pyx b/skimage/detection/_template.pyx index fb9d4028..3c6a726f 100644 --- a/skimage/detection/_template.pyx +++ b/skimage/detection/_template.pyx @@ -176,12 +176,14 @@ def match_template(np.ndarray[float, ndim=2, mode="c"] image, # use inversed area for accuracy cdef double inv_area = 1.0 / (template.shape[0] * template.shape[1]) # calculate template norm according to the following: - # variance ** 2 = 1/K Sigma[(x_k - mean) ** 2] = 1/K Sigma[x_k ** 2] - mean ** 2 + # variance ** 2 = 1/K Sigma[(x_k - mean) ** 2] + # = 1/K Sigma[x_k ** 2] - mean ** 2 cdef double template_norm cdef double template_mean = np.mean(template) if num_type == 0: - template_norm = sqrt((np.std(template) ** 2 + template_mean ** 2)) / sqrt(inv_area) + template_norm = sqrt((np.std(template) ** 2 + + template_mean ** 2)) / sqrt(inv_area) else: template_norm = sqrt((template_mean ** 2)) / sqrt(inv_area)