hog

hog

skimage.feature.hog(image, orientations=9, pixels_per_cell=(8, 8), cells_per_block=(3, 3), visualise=False, transform_sqrt=False, feature_vector=True, normalise=None) [source]

Extract Histogram of Oriented Gradients (HOG) for a given image.

Compute a Histogram of Oriented Gradients (HOG) by

  1. (optional) global image normalisation
  2. computing the gradient image in x and y
  3. computing gradient histograms
  4. normalising across blocks
  5. flattening into a feature vector
Parameters:

image : (M, N) ndarray

Input image (greyscale).

orientations : int

Number of orientation bins.

pixels_per_cell : 2 tuple (int, int)

Size (in pixels) of a cell.

cells_per_block : 2 tuple (int,int)

Number of cells in each block.

visualise : bool, optional

Also return an image of the HOG.

transform_sqrt : bool, optional

Apply power law compression to normalise the image before processing. DO NOT use this if the image contains negative values. Also see notes section below.

feature_vector : bool, optional

Return the data as a feature vector by calling .ravel() on the result just before returning.

normalise : bool, deprecated

The parameter is deprecated. Use transform_sqrt for power law compression. normalise has been deprecated.

Returns:

newarr : ndarray

HOG for the image as a 1D (flattened) array.

hog_image : ndarray (if visualise=True)

A visualisation of the HOG image.

Notes

Power law compression, also known as Gamma correction, is used to reduce the effects of shadowing and illumination variations. The compression makes the dark regions lighter. When the kwarg transform_sqrt is set to True, the function computes the square root of each color channel and then applies the hog algorithm to the image.

References

doc_scikit_image
2017-01-12 17:21:14
Comments
Leave a Comment

Please login to continue.