mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-12 12:30:16 +08:00
Removed unused import, applied pep8 formatting and corrected a method call
that should have been refactored.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
from scipy.ndimage import uniform_filter
|
||||
from .._shared.utils import assert_nD
|
||||
from . import _hoghistogram
|
||||
|
||||
|
||||
def hog(image, orientations=9, pixels_per_cell=(8, 8),
|
||||
cells_per_block=(3, 3), visualise=False, normalise=False):
|
||||
"""Extract Histogram of Oriented Gradients (HOG) for a given image.
|
||||
@@ -116,8 +116,8 @@ def hog(image, orientations=9, pixels_per_cell=(8, 8),
|
||||
# compute orientations integral images
|
||||
orientation_histogram = np.zeros((n_cellsy, n_cellsx, orientations))
|
||||
|
||||
_hoghistogram.hog_histograms(gx, gy, cx, cy, sx, sy, n_cellsx, n_cellsy,
|
||||
visualise, orientations, orientation_histogram)
|
||||
_hoghistogram.hog_histograms(gx, gy, cx, cy, sx, sy, n_cellsx, n_cellsy,
|
||||
visualise, orientations, orientation_histogram)
|
||||
|
||||
# now for each cell, compute the histogram
|
||||
hog_image = None
|
||||
|
||||
@@ -117,7 +117,7 @@ def hog_histograms(cnp.float64_t[:, :] gx,
|
||||
x = cx / 2
|
||||
|
||||
while x < cx2:
|
||||
orientation_histogram[yi, xi, i] = CellHog(magnitude,
|
||||
orientation_histogram[yi, xi, i] = cell_hog(magnitude,
|
||||
orientation, ori1, ori2, cx, cy, x, y, sx, sy)
|
||||
xi += 1
|
||||
x += cx
|
||||
|
||||
Reference in New Issue
Block a user