Computer Vision Interview 20 essential Q&A Updated 2026
OpenCV

OpenCV: 20 Essential Q&A

The de facto CV library—core types, I/O, processing primitives, and deployment tips.

~10 min read 20 questions Beginner
cv2MatcontoursVideoCapture
1 What is OpenCV? ⚡ easy
Answer: Open-source computer vision library with C++ core and Python/Java bindings—image I/O, filters, geometry, features, ML/DNN hooks.
2 What is a Mat? 📊 medium
Answer: Dense n-dimensional array—stores pixels with type (8UC3, etc.), refcounted; ROI shares data unless copy() used.
3 imread flags? ⚡ easy
Answer: IMREAD_COLOR, GRAYSCALE, UNCHANGED—default BGR color; watch alpha and 16-bit paths for medical/raw imagery.
4 Why BGR? 📊 medium
Answer: Historical—matplotlib expects RGB; convert with cvtColor before display in Python notebooks.
img = cv2.imread("x.jpg"); gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
5 resize interpolation? 📊 medium
Answer: INTER_LINEAR default; INTER_AREA for downscale; INTER_CUBIC/LANCZOS4 for quality upsampling—trade speed vs sharpness.
6 Drawing functions? ⚡ easy
Answer: line, rectangle, circle, putText—modify image in-place; anti-aliased variants available.
7 GaussianBlur? 📊 medium
Answer: Separable kernel smoothing—reduce noise before edge detect; kernel size should be odd.
8 Canny steps? 📊 medium
Answer: Gradient + hysteresis thresholds—good thin edges; sensitive to blur and threshold tuning.
9 findContours? 📊 medium
Answer: Expects binary mask; returns boundary curves—CHAIN_APPROX_SIMPLE compresses polygons; use for shape analysis.
10 Morphology? ⚡ easy
Answer: erode/dilate/open/close with structuring element—clean masks, separate blobs, fill holes.
11 VideoCapture? 📊 medium
Answer: Read camera or file; check isOpened(); codec fourcc for VideoWriter—platform quirks on macOS/Windows.
12 Python vs C++? 📊 medium
Answer: Same algorithms; Python faster to prototype; C++ for embedded latency—NumPy array can wrap Mat zero-copy in some flows.
13 dnn module? 📊 medium
Answer: Read ONNX/Caffe/TF frozen graphs—blobFromImage, setInput, forward—good for deployment without full DL framework.
14 calib3d snapshot? 🔥 hard
Answer: calibrateCamera, undistort, stereoRectify—pinhole + distortion model for AR and measurement.
15 ROI pitfalls? 📊 medium
Answer: Slicing shares memory—mutations affect parent Mat; clone for independent crop.
16 Performance? 📊 medium
Answer: Avoid Python loops on pixels; use vectorized OpenCV; optional IPP/TBB builds; profile hot paths.
17 UMat / OpenCL? 🔥 hard
Answer: Transparent OpenCL offload when T-API enabled—mixed pipelines need careful sync with Mat.
18 Why build from source? ⚡ easy
Answer: Enable nonfree (SIFT/SURF in older builds), CUDA, custom flags—wheels on PyPI are convenient but fixed options.
19 License? ⚡ easy
Answer: Apache 2.0 (4.5+)—older versions mixed; check contrib modules and patent notes for algorithms.
20 Alternatives? 📊 medium
Answer: scikit-image, Pillow (limited CV), VTK, vendor SDKs—OpenCV remains default for classical CV education and tooling.

OpenCV Cheat Sheet

Core
  • Mat / BGR
Ops
  • Filter / edge
  • Contours
Ship
  • dnn / Video

💡 Pro tip: BGR in OpenCV; ROI shares memory until copy.

Full tutorial track

Go deeper with the matching tutorial chapter and code examples.