From bea9886a12e329ba5eef139e6a8caeafa1b42f7e Mon Sep 17 00:00:00 2001 From: Ivo Flipse Date: Thu, 18 Jun 2015 22:01:44 +0200 Subject: [PATCH] I noticed that cy+cy and cx+cx was repeated in the inner-most loop as well --- skimage/feature/_hog.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/skimage/feature/_hog.py b/skimage/feature/_hog.py index a66e5e4e..743597b0 100644 --- a/skimage/feature/_hog.py +++ b/skimage/feature/_hog.py @@ -128,11 +128,13 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8), dx_arr = radius * np.cos(orientations_arr / orientations_arr * np.pi) dy_arr = radius * np.sin(orientations_arr / orientations_arr * np.pi) + cc = cy + cy + cr = cx + cx hog_image = np.zeros((sy, sx), dtype=float) for x in range(n_cellsx): for y in range(n_cellsy): for o, dx, dy in zip(orientations_arr, dx_arr, dy_arr): - centre = tuple([y * cy + cy // 2, x * cx + cx // 2]) + centre = tuple([y * cc // 2, x * cr // 2]) rr, cc = draw.line(int(centre[0] - dx), int(centre[1] + dy),