Before neural networks learned what to look for, humans hand-designed the features: gradient directions (HOG) and rectangle-sum patterns (Haar). Inspect the exact per-pixel math, watch the integral image do its trick, then break these hand-crafted features on purpose — rotation, lighting, scale — to feel exactly why deep learning replaced them.
Scan everywhere, score everything
Every classical detector is the same loop: slide a window across the image at multiple scales, score each position with hand-designed features, keep the confident ones.
Drag the amber window, then hover anywhere for a live gradient-vector magnifying glass — I_x, I_y, magnitude, angle, and the exact bin it lands in.
Window size
96px
Orientation bins
9
📋 Live OpenCV codeHOGDescriptor
With the mesh on, drag a box anywhere — its 4 corners (A,B,C,D) light up and the live sum formula computes below, in exactly 4 lookups no matter the box size.
Integral lookup
Drag a box on the mesh to compute Sum = ii(D) + ii(A) − ii(B) − ii(C)
Cascade rejection funnel
📋 Live OpenCV codeCascadeClassifier
Orientation bins
9
Cell size
8px
Cascade stages
3
Yahi wajah hai ki deep learning algorithms convolutional weights ko khud optimized scale par learn karte hain — hand-crafted detectors ko hum manually ek pyramid dete hain.
Detect thresh.
55%
Without NMS you will see dozens of overlapping amber boxes around every real object. NMS keeps only the single strongest box per cluster.
Hand-designed features, then a classifier▾
HOG is not rotation-invariant
Gradient bins are fixed to image axes. Rotate the object and every gradient direction shifts, scrambling which bin it lands in — coarser bins tolerate a bit more drift, but nothing here makes HOG genuinely rotation-invariant.
Normalisation fights lighting
Dividing a Haar response by the window's own local mean/variance cancels out a uniform brightness shift or gradient — the same trick behind real Viola-Jones robustness to lighting.
Pyramids fake scale-invariance
A fixed-size detector can only ever match one physical size well. An image pyramid tests the same small window against many resized copies of the image — brute-forcing scale coverage a CNN instead learns implicitly.
Predict, then verify
In Level 1 (Angle of Attack), you set Orientation Bins very high (18) for maximum precision. As the pedestrian rotates toward 45°, what happens to detection confidence?