Skip to content
CoreSource checked

HOG Feature Descriptor

Describes local image shape by accumulating gradient-orientation histograms over cells.

Quick Facts

Compact metadata for implementation and discovery.

Category
Image Processing
Difficulty
Intermediate
Family
Feature Extraction
Tier
Core
Status
Verified
Review
Source Checked
Sources
2
Formulas
0
Relationships
5
Code example
Ready
Visualization
Ready
Aliases
Histogram of Oriented Gradients

Overview

The HOG descriptor computes image gradients, bins their orientations inside small cells, and normalizes groups of cells into blocks. The result captures edge and silhouette structure for detection tasks.

Core Concepts

image feature descriptionfeature extractiongeometric predicatefeature matchingimage processing

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n)

Average

O(n log n)

Worst

O(n^2)

Space

O(n)

When to Use

  • Use when edge and silhouette structure are more important than texture or color.
  • Use when a classical descriptor is preferred over learned features.

When Not to Use

  • Avoid when viewpoint, scale, or lighting varies beyond what the descriptor can tolerate.
  • Avoid when end-to-end learned features are available and substantially more accurate.

What It Does

  • Computes local image gradients
  • Accumulates orientation histograms in cells
  • Normalizes neighboring cells into descriptor blocks

Use Cases

  • Object and pedestrian detection
  • Classical feature extraction pipelines
  • Comparing local shape patterns across image windows

Inputs

  • Grayscale or color image grid I(x, y)
  • Cell size, block normalization stride, and orientation bin count

Outputs

  • Normalized histogram of oriented gradient (HOG) feature vector
  • Spatial cell gradient magnitude/orientation maps

Pseudocode

  1. 1.Compute horizontal and vertical image gradients
  2. 2.Convert gradients to magnitude and orientation
  3. 3.For each cell, accumulate weighted orientation votes
  4. 4.Group neighboring cells into blocks
  5. 5.Normalize each block and concatenate descriptor values

Canonical Example

Input
a 16x16 grayscale patch containing a vertical edge
Output
histogram bins with strong vertical-edge orientation response
Explanation
Gradients near the edge vote into orientation bins, and block normalization scales the local descriptor.

Implementation Notes

  • Define gradient filters, orientation bins, cell size, block size, and normalization method explicitly.
  • Use tiny synthetic edge patches to check binning and interpolation.
  • Keep descriptor layout stable so trained classifiers receive consistent features.

Common Pitfalls

  • Using inconsistent cell, block, or stride sizes makes descriptors incomparable.
  • Skipping normalization makes the descriptor too sensitive to contrast.
  • Testing only centered objects hides detection-window alignment errors.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show accumulating local gradient orientation histograms over cells on a small image feature description example.

HOG Feature Descriptor mechanism walkthrough step 1 of 5
Step 1 of 5: Compute horizontal and vertical image gradients
image-processing-mechanism

Notes

HOG describes local gradient structure; it is usually paired with a classifier or detector window.

Sources (2)

What each reference supports for this entry.

Histograms of Oriented Gradients

Paper

Original HOG reference for gradient orientation histograms and block normalization.

Open source

Computer Vision: Algorithms and Applications

Book

Computer-vision textbook support for HOG Feature Descriptor's feature, matching, flow, or multiscale image-analysis workflow.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Conceptual neighborSIFT

Both describe local gradient orientations, but SIFT builds keypoint descriptors while HOG often describes dense windows.

Often paired withTemplate Matching

HOG features and template matching are both used in classical detection pipelines.

Alternative toORB

ORB is a binary keypoint descriptor, while HOG is a histogram-based window descriptor.

Related Algorithms

Tags

Image Processing