mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-10 12:40:08 +08:00
I hadn't realized I was reusing cc in the loop, so it would crash after one iteration.
And I had changed the second orientation, which probably wasn't correct
This commit is contained in:
@@ -125,17 +125,15 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8),
|
||||
|
||||
radius = min(cx, cy) // 2 - 1
|
||||
orientations_arr = np.arange(orientations)
|
||||
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
|
||||
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 * cc // 2, x * cr // 2])
|
||||
|
||||
centre = tuple([y * cr2 // 2, x * cc2 // 2])
|
||||
rr, cc = draw.line(int(centre[0] - dx),
|
||||
int(centre[1] + dy),
|
||||
int(centre[0] + dx),
|
||||
|
||||
Reference in New Issue
Block a user