Computer Vision Interview 20 essential Q&A Updated 2026
filtering

Image Filtering: 20 Essential Q&A

Linear filtering, convolution vs correlation, blur types, and how kernels tie to low-pass and high-pass ideas.

~11 min read 20 questions Beginner–Intermediate
convolutionGaussianmedianpadding
1 What is image filtering? ⚡ easy
Answer: Computing a new image where each output pixel is a function of a neighborhood of input pixels. Linear filters use weighted sums (convolution/correlation); nonlinear filters include median, bilateral, morphological ops.
2 Define 2D convolution (discrete). 📊 medium
Answer: Slide a kernel over the image; at each location, sum of elementwise products of kernel and flipped neighborhood (strict convolution). Many libraries implement cross-correlation without flip—know which convention your framework uses.
3 Correlation vs convolution for symmetric kernels? 📊 medium
Answer: For symmetric kernels (Gaussian), results match. For asymmetric kernels (Sobel direction), flip matters for strict signal-processing convolution vs correlation.
4 What is a kernel / mask? ⚡ easy
Answer: Small matrix of weights defining neighborhood contributions. Size (e.g. 3×3, 5×5) sets spatial support; larger kernels increase blur radius and compute cost (~kernel area per pixel).
5 Examples of nonlinear filters? ⚡ easy
Answer: Median (order-statistic, good for salt-and-pepper), bilateral (edge-preserving smoothing), morphology (min/max). They do not obey superposition like convolutions.
6 Why use a Gaussian kernel? 📊 medium
Answer: Smooth low-pass filtering that reduces noise and high frequencies while avoiding sharp ringing like ideal low-pass. Separable implementation makes it fast; σ controls blur strength.
import cv2
blur = cv2.GaussianBlur(img, (5, 5), sigmaX=1.0)
7 What does separable filter mean? 🔥 hard
Answer: A 2D kernel K can equal outer product v vᵀ. Convolving with K is equivalent to 1D conv along rows then columns—cost drops from O(WHk²) to O(2WHk) for k×k support.
8 Mean / box filter properties? ⚡ easy
Answer: Simple average of neighborhood—fast (especially with integral images) but has a sharp frequency nulls profile vs Gaussian; can create blocky artifacts compared to Gaussian blur.
9 When prefer median filtering? 📊 medium
Answer: Impulsive salt-and-pepper noise where mean blur smears outliers. Median preserves edges better than Gaussian for that noise but is costlier and can remove thin structures.
10 Intuition for bilateral filter? 🔥 hard
Answer: Weighted average where weights drop with both spatial distance and intensity difference—smooths flat regions but preserves sharp edges. Used for denoising and tone mapping; slower than Gaussian.
11 What is padding in convolution? 📊 medium
Answer: Extends the image border so output size can match input (same padding) or follow strict convolution (valid). Modes: zero, reflect, replicate, wrap—choice affects edges and CNN behavior.
12 Why do edges look different after filtering? ⚡ easy
Answer: Neighborhoods at borders are incomplete; padding synthesizes missing neighbors. Wrong padding can cause dark/bright fringes—noticeable on small images and CNN feature maps.
13 Basic sharpening idea? 📊 medium
Answer: Emphasize high frequencies by adding a scaled Laplacian-like response or subtracting a blurred version from the original—makes edges pop but can amplify noise.
14 What is unsharp masking? 📊 medium
Answer: Enhancement: original + amount × (original − blurred). The difference is a high-boost of details; used in photography and preprocessing (with care for noise).
15 How is CNN stride related to classical filtering? 📊 medium
Answer: Stride >1 subsamples the output—like convolve-then-downsample. Larger stride increases receptive field progression and reduces spatial size; different from stride-1 spatial filtering used in preprocessing.
16 Frequency view of Gaussian blur? 🔥 hard
Answer: Gaussian in space ↔ Gaussian in frequency; it attenuates high frequencies smoothly. Helps before subsampling to limit aliasing (Nyquist)—ties back to image basics.
17 Gaussian noise vs salt-and-pepper—filter choice? 📊 medium
Answer: Gaussian noise: linear smoothing (Gaussian blur) or Wiener/BM3D-class methods at higher level. Salt-and-pepper: median or morphological openings/closings.
18 How do derivative filters relate to filtering? 📊 medium
Answer: Finite differences (Sobel/Prewitt) are short convolution kernels approximating gradients—high-pass. Often paired with prior Gaussian smoothing to reduce noise before edge detection.
19 Why normalize blur kernels? ⚡ easy
Answer: So the DC gain is 1—preserves average brightness. Unnormalized Gaussian sums to 1 after discretization normalization; forgetting normalization scales image intensity.
20 OpenCV: GaussianBlur vs filter2D? ⚡ easy
Answer: GaussianBlur builds separable Gaussian internally. filter2D applies arbitrary kernel (correlation-style in OpenCV)—flexible for custom linear filters.

Filtering Cheat Sheet

Linear
  • Convolution / correlation
  • Gaussian low-pass
  • Separability
Nonlinear
  • Median (impulse noise)
  • Bilateral (edge-aware)
  • Morphology (later topic)
CNN tie-in
  • Learned kernels
  • Padding & stride
  • Depthwise convs

💡 Pro tip: Mention separability + complexity when discussing large Gaussian kernels.

Full tutorial track

Go deeper with the matching tutorial chapter and code examples.