From 8b7920ea131ba6c4712325d984f5fed5f9bd5e99 Mon Sep 17 00:00:00 2001 From: ivoflipse Date: Wed, 18 Nov 2015 23:05:32 +0100 Subject: [PATCH] Fix an error in the centre calculation --- skimage/feature/_hog.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/skimage/feature/_hog.py b/skimage/feature/_hog.py index afb2b4e9..c0f4cba8 100644 --- a/skimage/feature/_hog.py +++ b/skimage/feature/_hog.py @@ -127,13 +127,11 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8), orientations_arr = np.arange(orientations) dx_arr = radius * np.cos(orientations_arr / orientations * np.pi) dy_arr = radius * np.sin(orientations_arr / orientations * np.pi) - cr2 = cy + cy - cc2 = 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 * cr2 // 2, x * cc2 // 2]) + centre = tuple([y * cy + cy // 2, x * cx + cx // 2]) rr, cc = draw.line(int(centre[0] - dx), int(centre[1] + dy), int(centre[0] + dx),