Computer Vision Interview 20 essential Q&A Updated 2026
HOG

HOG Descriptor: 20 Essential Q&A

Histograms of oriented gradients—how blocks normalize and why SVM + HOG worked for people.

~11 min read 20 questions Advanced
cellsblocksSVMpedestrian
1 What is HOG? ⚡ easy
Answer: Histogram of Oriented Gradients—counts gradient orientations in local cells, groups into blocks with contrast normalization—handcrafted descriptor for object detection (classic pedestrians).
2 What is a cell? 📊 medium
Answer: Small spatial tile (e.g. 8×8 px) where unsigned gradient orientations vote into fixed orientation bins with magnitude weighting.
3 How many orientation bins? ⚡ easy
Answer: Typically 9 unsigned bins over 0–180° (Dalal-Triggs); signed 0–360° variants exist.
4 What is a block? 📊 medium
Answer: Group of cells (e.g. 2×2 cells) concatenated into one vector—provides local spatial structure before normalization.
5 Why block normalization? 🔥 hard
Answer: Dividing by block L2 norm (with clipping L2-Hys) achieves illumination and shadow invariance—critical for outdoor pedestrians.
6 Block stride? 📊 medium
Answer: Sliding window step for blocks—smaller stride = denser descriptor, larger feature vector, more overlap.
7 Typical detection window? 📊 medium
Answer: 64×128 pedestrian crop in Dalal-Triggs paper—fixed aspect; scanning at multiple scales for multi-size objects.
8 Classifier with HOG? ⚡ easy
Answer: Linear SVM on HOG feature vector—fast sliding-window scoring; extensions used kernels but linear was standard.
9 Relation to CNNs? 🔥 hard
Answer: Early conv layers learn similar local edge/orientation filters; HOG is fixed handcrafted analog of shallow hierarchical gradients.
10 Unsigned vs signed gradients? 📊 medium
Answer: Unsigned merges opposite contrast edges into same bin—more stable for object shape; signed preserves direction when needed.
11 Use color? 📊 medium
Answer: Compute gradients per channel and take max or concatenate—RGB helps slightly over grayscale for some classes.
12 Multi-scale detection? 📊 medium
Answer: Resize image pyramid; run sliding window at each scale—or use faster feature pyramids.
13 NMS after scanning? ⚡ easy
Answer: Merge overlapping high-score windows—standard object detection post-process.
14 Why gradients not raw pixels? 📊 medium
Answer: Gradients emphasize edges and shape while reducing sensitivity to absolute brightness.
15 What is L2-Hys? 🔥 hard
Answer: L2 normalize block, clip max value per dimension, renormalize—reduces influence of very large gradients.
16 Visualize HOG? ⚡ easy
Answer: Show dominant orientation per cell as lines—“HOG picture” for debugging.
17 Speed tricks? 🔥 hard
Answer: Integral images for histograms, coarse stride, cascaded classifiers—needed for near real-time before deep detectors.
18 Link to DPM? 🔥 hard
Answer: Deformable Part Models extend HOG with root + part filters and deformation costs—won PASCAL era before R-CNN.
19 OpenCV? ⚡ easy
Answer: cv2.HOGDescriptor + setSVMDetector for default people detector; detectMultiScale.
hog = cv2.HOGDescriptor()
hog.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector())
rects, _ = hog.detectMultiScale(img)
20 Limitations? 📊 medium
Answer: Rigid window, hand-tuned cells/blocks, weaker than CNNs on cluttered scenes and fine-grained classes—still useful baseline and interpretable.

HOG Cheat Sheet

Compute
  • Gradients
  • Cell hist
Normalize
  • Block L2-Hys
Detect
  • Sliding + SVM
  • NMS

💡 Pro tip: Cells vote gradients; blocks normalize for lighting invariance.

Full tutorial track

Go deeper with the matching tutorial chapter and code examples.