Computer Vision Interview 20 essential Q&A Updated 2026
Harris

Harris Corner Detector: 20 Essential Q&A

Second-moment matrix, response function, and why corners score high.

~11 min read 20 questions Intermediate
HarrisM matrixeigenvaluesk
1 What does the Harris corner detector find? ⚡ easy
Answer: Locations where intensity changes strongly in two directions—corners and strong junctions—via local second-order structure of gradients.
2 What does Harris maximize? 📊 medium
Answer: Change in SSD of a patch under small shifts u,v—approximated by quadratic form involving structure tensor M.
3 Define the second-moment matrix M. 🔥 hard
Answer: M = Σ w(x,y) [Ix² IxIy; IxIy Iy²] over a window—captures local gradient covariance; eigenvectors give principal gradient directions.
4 Interpret eigenvalues λ1, λ2 of M? 📊 medium
Answer: Both small: flat; one large, one small: edge; both large: corner (intensity varies along two orthogonal directions).
5 Harris response R? 📊 medium
Answer: R = det(M) − k·trace(M)² = λ1λ2 − k(λ1+λ2)²—avoids explicit eigen decomposition; k ≈ 0.04–0.06 typical.
6 Effect of k? ⚡ easy
Answer: Tunes sensitivity vs noise; too large suppresses corners; empirical constant, not learned from data in classical form.
7 R on flat region? ⚡ easy
Answer: det≈0, trace≈0 → R negative or near zero—rejected.
8 R on edge? ⚡ easy
Answer: One eigenvalue ~0 → det≈0 while trace>0 → R negative—rejected as corner.
9 What is Shi-Tomasi “good features to track”? 📊 medium
Answer: Score = min(λ1, λ2) with threshold—more stable for tracking; picks corners with minimum directional strength guaranteed.
10 Effect of window size? 📊 medium
Answer: Larger window: smoother M, less localization noise but merges nearby corners; smaller: noisier, better localization.
11 Why Gaussian weights w? ⚡ easy
Answer: Emphasize center of patch, reduce boundary artifacts when sliding window—standard in cornerHarris.
12 Invariances of Harris? 📊 medium
Answer: Invariant to rotation (eigenvalues of symmetric M); not scale invariant—same corner changes type across scales; partial brightness affine in practice.
13 How fix scale weakness? 🔥 hard
Answer: Multi-scale Harris, scale-space extrema (like SIFT), or detectors with inherent scale selection (LoG).
14 Refine corners to sub-pixel? 📊 medium
Answer: Fit quadratic to corner response surface or iterative refinement (OpenCV cornerSubPix) using gradients.
15 Need NMS? ⚡ easy
Answer: Yes—Harris map is dense; keep local maxima above threshold separated by minimum distance.
16 Harris vs FAST? 📊 medium
Answer: FAST: speed-optimized segment test, not gradient matrix—faster, less accurate localization; Harris more principled, slower.
17 OpenCV cornerHarris output? ⚡ easy
Answer: Float response map; threshold + NMS to get points; often followed by goodFeaturesToTrack (Shi-Tomasi).
R = cv2.cornerHarris(gray, 2, 3, 0.04)
18 Why use det − k·trace²? 🔥 hard
Answer: Algebraic proxy for “both eigenvalues large” without sqrt—computationally cheap and continuous score.
19 Gradients Ix, Iy? ⚡ easy
Answer: Usually Sobel or Scharr on smoothed image—noise reduction before derivative recommended.
20 Planar surface assumption? 📊 medium
Answer: Harris assumes small motion model in image plane—breaks for strong perspective on 3D corners unless patch small enough.

Harris Cheat Sheet

M matrix
  • Sum of outer products
  • Weighted window
λ’s
  • Flat / edge / corner
Limits
  • Not scale-inv.
  • Shi-Tomasi for track

💡 Pro tip: Corner = two strong eigenvalues; edge = one.

Full tutorial track

Go deeper with the matching tutorial chapter and code examples.