Computer Vision Interview Questions – Core Concepts to Advanced Techniques
Reviewed by Mark Dickie · Last updated
Computer vision is the field of computer science that teaches machines to extract structured information from images and video — identifying objects, estimating depth, tracking motion, and much more. For an interview, you need a firm grip on three layers: the math underpinning images (color spaces, convolutions, spatial frequency), the model architectures that do the heavy lifting (CNNs, transformers, detection heads), and the engineering trade-offs that matter at deployment (latency vs. accuracy, dataset bias, augmentation strategies). Interviewers at all levels probe whether you can move between theory and code, so be ready to sketch an architecture, read a confusion matrix, and explain why a design choice holds — not just what it is.
What does a computer vision interview actually test?
Interviews range from "explain what a convolution does" to "design a real-time defect detection pipeline at 60 fps." The table below maps difficulty to what you should expect on the whiteboard or in code.
| Difficulty | Typical topics | Common question forms |
|---|---|---|
| 1 – Beginner | Pixels, color spaces, basic filters, edge detection | Define, explain, compare |
| 2 – Elementary | CNN building blocks, pooling, basic classification | Trace the forward pass, spot the bug |
| 3 – Intermediate | Object detection (YOLO, Faster R-CNN), segmentation, data augmentation | Design a pipeline, tune a hyperparameter |
| 4 – Advanced | Transformers (ViT, DETR), self-supervised learning, multi-camera geometry | Analyse trade-offs, derive a loss function |
| 5 – Expert | 3D reconstruction, optical flow, real-time system constraints, custom loss design | Open-ended system design, math derivations |
The quiz below spans all five bands, so you'll hit questions that feel easy and ones that expose gaps — both are useful signals.
What core concepts come up in almost every computer vision interview?
These topics appear across difficulty levels because they underpin almost everything else:
- Convolution and receptive field. Know what a kernel computes, how stride and padding change the output size, and what "receptive field" means for deep networks.
- Image representations. RGB vs. grayscale vs. HSV — when and why you'd convert, and what each channel actually encodes.
- Loss functions. Cross-entropy for classification, IoU-based losses (GIoU, DIoU) for detection, dice loss for segmentation. Be ready to compare them, not just name them.
- Precision, recall, and mAP. Mean Average Precision is the standard detection metric; you should be able to sketch the precision-recall curve and say what area under it means.
- Overfitting and augmentation. Random crops, flips, colour jitter, mixup — know which augmentations are safe for which tasks (you wouldn't randomly flip text for OCR).
- Model efficiency basics. Depthwise separable convolutions (MobileNet), quantisation, and pruning come up whenever a role involves edge deployment.
A common weak spot is the gap between "I've used a library" and "I can reason about it." Interviewers notice when a candidate can call torchvision.ops.nms but can't say what non-maximum suppression is actually doing geometrically. The questions in this quiz are written to catch exactly that gap.
Key facts
- Tarmac has 101 Computer Vision interview questions on this topic, 25 of them on this page, at difficulty 1–5 of 5.
- Tarmac last reviewed these Computer Vision interview questions on 31 August 2026.
At a glance
| Questions | 25 shown · 101 in the bank |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, Flashcard, Code output, Design exercise, True / false, Find the bug, Multiple answer, Short answer, Ordering, Fill in the blank |
What you'll review
- color spaces
- image transformations
- convolution pooling
- data augmentation
- segmentation types
- image filtering convolution
- detection metrics
- camera calibration
- corner edge detection
- detection architectures
- keypoint descriptors
- segmentation architectures
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
Computer Vision/image-fundamentals/color-spaces
You load an image with cv2.imread("photo.jpg") and pass the resulting array straight to matplotlib.pyplot.imshow. The photo has a red car, but it renders with a blue car instead. Why?#
Options
Show answer
OpenCV's cv2.imread returns pixel data in BGR channel order rather than RGB, while matplotlib.pyplot.imshow expects RGB — so red and blue visually swap wherever the true color would show red or blue, even though the underlying pixel values are correct. The fix is cv2.cvtColor(img, cv2.COLOR_BGR2RGB) before displaying or passing the array to any RGB-expecting tool. This BGR-vs-RGB mismatch is one of the most common practical gotchas in OpenCV, since nearly every other Python imaging or deep-learning tool assumes RGB.
This is one of the most common practical gotchas in OpenCV: for historical reasons, cv2.imread (and the rest of OpenCV's I/O and drawing functions) represent color images as BGR, not RGB, while essentially every other Python imaging tool — matplotlib, PIL, most deep learning frameworks' preprocessing — expects RGB. The pixel data itself is correct; only the channel order disagrees with what the consumer expects, so red and blue visually swap wherever the true color would show red or blue. The fix is a single cv2.cvtColor(img, cv2.COLOR_BGR2RGB) before handing the array to anything BGR-unaware. imshow performs no image inversion or forced grayscale (b, c, d are invented), and JPEG channel order is fixed by the format, not randomized (b).
Computer Vision/camera-geometry/image-transformations
What does the pinhole camera model describe, and why is it the simplest model for image formation?#
Show answer
It captures an inverted image by allowing only a single ray from each scene point to reach the image plane; there is no lens and thus no focusing mechanism or optical distortion.
The pinhole camera model is the most basic image-formation model: light from a scene passes through a single infinitesimal aperture (the pinhole) and projects onto an image plane, producing an inverted image. Because the aperture is a point, no lens-based focusing, blur, or lens distortion is involved — every scene point maps to exactly one image-plane point along a straight ray.
Computer Vision/cnn-fundamentals/convolution-pooling
A 3×3 input image is convolved with a 2×2 kernel using stride 1 and no padding. Each output element is the element-wise product of the kernel with the corresponding image patch, summed. What does this code print?#
import numpy as np
input_img = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
kernel = np.array([[1, 0],
[0, -1]])
result = np.zeros((2, 2), dtype=int)
for i in range(2):
for j in range(2):
result[i, j] = np.sum(input_img[i:i+2, j:j+2] * kernel)
print(result)Show answer
[[-4 -4]
[-4 -4]]
The kernel [[1,0],[0,-1]] subtracts the bottom-right element of each 2×2 patch from the top-left element. For every patch: (0,0)→1−5=−4, (0,1)→2−6=−4, (1,0)→4−8=−4, (1,1)→5−9=−4. The 2×2 output is all −4.
Computer Vision/cnn-fundamentals/data-augmentation
You are training a CNN for a 10-class image classification task. Your training set contains only 2,000 images per class, and the model is overfitting — training accuracy is 98% but validation accuracy plateaus at 72%. Design a data augmentation pipeline to reduce overfitting. Specify which augmentation techniques you would apply, in what order (if order matters), and which technique you would NOT apply and why. Assume the images are natural photographs (e.g., animals, vehicles) resized to 224×224.#
Show answer
To reduce overfitting on 2,000 images per class, I would build an on-the-fly augmentation pipeline applied to each training image at every epoch. The pipeline would include: (1) random horizontal flip — natural images of animals and vehicles are still semantically valid when mirrored left-to-right, so this teaches the model left-right position invariance; (2) random resized crop to 224×224 — simulates variation in object scale and position, forcing the network to recognize the subject even when partially cropped, which teaches localization tolerance; (3) color jitter (random brightness, contrast, saturation, and slight hue shifts) — helps the model become robust to lighting and camera differences that occur in real-world image capture; (4) random rotation by a small angle (±15°) — adds modest pose variation without making the image unrealistic, teaching rotational invariance within a plausible range. These geometric and photometric transforms can be applied in sequence: I would apply the random crop first, then the horizontal flip, then color jitter, because cropping changes the spatial extent and flip is a spatial operation, while color jitter operates on pixel intensities independently of geometry. The order among these is not critical, but applying color jitter before a crop could waste computation on pixels that get discarded. I would NOT apply vertical flip, because natural photographs of animals, vehicles, and most real-world scenes are not vertically symmetric — an upside-down car does not represent a plausible real-world instance of the 'car' class and would inject label noise. I would also avoid extreme rotations (>45°) for the same reason. The core idea is that augmentation effectively expands the training data distribution: instead of seeing the same 2,000 images repeatedly, the CNN sees a different augmented variant each epoch, which forces it to learn invariant features (e.g., shape, texture, part relationships) rather than memorizing pixel-level patterns specific to the original images. This is a direct countermeasure to the 98% train / 72% validation gap, which signals that the model is fitting idiosyncrasies of the training set rather than generalizable structure.
This design exercise tests foundational knowledge of data augmentation for CNN image classification. The rubric rewards selecting appropriate techniques with per-technique justification, understanding pipeline structure, justifying exclusions, and connecting augmentation to overfitting reduction.
Computer Vision/cnn-fundamentals/data-augmentation
A team is building a CNN-based digit recognizer for handwritten digits (similar to MNIST, 28×28 grayscale, 10 classes 0–9). They have 60,000 training images and want to use data augmentation. Design an augmentation strategy for this specific domain. Identify which augmentations are appropriate, which are inappropriate, and explain your reasoning for each choice in terms of what handwritten digits look like in the real world.#
Show answer
For handwritten digit recognition on 28×28 grayscale images, the augmentation strategy must respect the tight geometric constraints of the digit domain. Appropriate augmentations include: (1) Small elastic deformations — handwritten digits naturally vary in stroke shape, so mild elastic distortion simulates different handwriting styles without changing the digit's identity. (2) Slight rotation (±10–15°) — people write at slightly different angles, but large rotations could make a digit ambiguous. (3) Small random translations via padding + random crop — shifts the digit within the 28×28 frame, teaching the CNN positional invariance. (4) Mild Gaussian noise — simulates scanner or sensor noise. I would explicitly avoid: horizontal flip — flipping a '3' horizontally does not produce a valid '3' and flipping a '2' creates an unrecognizable shape; vertical flip — this is catastrophic because a '6' becomes a '9' and vice versa, directly changing the class label; color jitter — the images are grayscale so hue/saturation adjustments are meaningless and only mild brightness/contrast jitter is relevant. The key domain insight is that unlike natural images (where a flipped car is still a car), digit transforms can change the class identity. Even within the 'safe' augmentations, there are domain-specific risks to manage: small rotations could increase confusion between '6' and '9' since these digits are near-rotations of each other, so I would monitor per-class validation accuracy (or the confusion matrix) after applying rotation and cap rotation magnitude more tightly if I observe degradation on those specific classes. Similarly, elastic deformation could distort a borderline stroke — for instance, bending the loop of a '6' until it resembles a '0' — so deformation strength should be tuned against a held-out validation set rather than chosen arbitrarily. Magnitudes should be kept small: rotations beyond ~15°, large elastic deformations, or aggressive scaling would produce unrealistic digits that do not occur in real handwriting, effectively injecting label noise and hurting generalization. All augmentation must be applied only to the training set — validation and test data remain unaugmented so that reported accuracy reflects true generalization on realistic, unmodified samples.
This exercise tests whether a candidate can reason about data augmentation in a domain-specific way, recognizing that techniques valid for natural images (flips, color jitter) can be inappropriate or even label-changing for handwritten digits, and that even appropriate augmentations carry digit-specific risks (such as 6/9 confusion under rotation) that require concrete mitigations.
Computer Vision/image-segmentation/segmentation-types
A street-scene image has three people standing next to each other. What's the key difference between how semantic segmentation and instance segmentation would label them?#
Options
Show answer
Semantic segmentation labels every pixel with a class (e.g. 'person'), with no distinction between different objects of the same class — three people standing together become one undifferentiated blob of 'person' pixels. Instance segmentation goes further, producing a separate mask per individual object instance, so the same three people come out as three distinct masks even though they share a class and overlap. Mask R-CNN is the standard example: it first detects individual object instances, then predicts a mask within each detected box, which is what gives it per-instance rather than per-class-only output.
Semantic segmentation is a dense per-pixel classification task: every pixel gets a class label ('person', 'road', 'sky'), and every pixel belonging to the same class looks identical in the output regardless of which specific object it belongs to — three overlapping people all just become one connected blob of 'person' pixels. Instance segmentation adds object-level identity on top of that: it produces a separate mask per detected object instance, so the three people come out as three distinct masks even though they're all the same class and standing next to each other. Architectures like Mask R-CNN do this by first detecting individual object instances (like an object detector) and then predicting a segmentation mask within each detected box, rather than segmenting the whole image at once. Neither task is inherently tied to image color mode or resolution (b, c are invented), and the distinction between 'what class' and 'which specific instance' is a real, load-bearing one in both research and interviews (d is false).
Computer Vision/image-fundamentals/image-filtering-convolution
Applying a Gaussian blur to an image before running Canny edge detection on it typically improves the result, by suppressing noise that would otherwise be picked up as spurious edges.#
Options
Show answer
True. A Gaussian blur applied before Canny edge detection typically improves the result, because Canny works by thresholding sharp intensity gradients, and raw sensor noise creates small random gradient spikes that get picked up as spurious edges. Blurring smooths those fluctuations out first, so only the genuine, larger-scale structural boundaries in the scene survive thresholding — which is why Canny's own classic formulation includes Gaussian smoothing as its first stage.
True. Canny edge detection works by finding pixels where intensity changes sharply — computing gradients and thresholding them. Raw sensor noise creates small, random intensity fluctuations that look like sharp local gradients too, so an unblurred image produces a scattering of tiny false edges wherever noise happens to spike. A Gaussian blur smooths those small fluctuations out before the gradient computation runs, so the edges that survive are the genuine, larger-scale structural boundaries in the scene rather than noise. This is exactly why Canny's own classic formulation includes a Gaussian smoothing step as its first stage, and why OpenCV tutorials on edge detection routinely blur first.
Computer Vision/image-fundamentals/color-spaces
A teammate's script loads a photo, draws a bounding box on it with OpenCV, then saves a preview with matplotlib for a report. Reviewers say the preview's colors look wrong — skin tones read blue. Which line is the bug?#
1| import cv2
2| import matplotlib.pyplot as plt
3|
4| img = cv2.imread("person.jpg")
5| cv2.rectangle(img, (30, 40), (200, 260), (0, 255, 0), 2)
6| plt.imshow(img)
7| plt.savefig("preview.png")Options
Show answer
Line 6 — img is still in OpenCV's BGR channel order from cv2.imread, but plt.imshow interprets it as RGB; it needs cv2.cvtColor(img, cv2.COLOR_BGR2RGB) first
cv2.imread and cv2.rectangle both operate in OpenCV's BGR channel order, so after line 5 img is a correctly-drawn image whose pixel data is still BGR. plt.imshow — like nearly every other Python imaging tool — assumes RGB input, so it interprets the blue channel's values as if they were red and vice versa, which is exactly the blue-skin-tone symptom described: the actual red channel gets displayed in blue's position. The fix is img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) before line 6 (drawing with cv2.rectangle can happen on either the BGR or converted array, since the color tuple would just need swapping too, but converting once right before display is simplest). cv2.rectangle accepts a BGR tuple exactly as written, not a hex string (b is invented); cv2.imread reads .jpg files natively — it's one of the most common formats it supports (c is invented); and plt.savefig writes whatever colors imshow is currently displaying, performing no automatic grayscale conversion (d is invented).
Computer Vision/object-detection/detection-metrics
What is intersection-over-union (IoU), and what does an IoU of 0 versus 1 mean?#
Show answer
A measure of how much two bounding boxes (or masks) overlap: the area where they intersect, divided by the total area they cover together (their union). IoU ranges from 0 (no overlap at all) to 1 (the two boxes are identical). It's the standard way to score whether a predicted box is 'close enough' to a ground-truth box — object detection evaluation typically counts a prediction as correct only if its IoU with the matching ground-truth box clears a threshold, commonly 0.5, and it's also the metric non-maximum suppression uses to decide when two predicted boxes describe the same object.
IoU is the shared vocabulary underneath both detection evaluation (mAP) and detection post-processing (NMS), which is why it's foundational rather than a niche metric.
Computer Vision/camera-geometry/camera-calibration
In a standard pinhole camera model used in camera calibration, which of the following quantities are classified as intrinsic parameters (as opposed to extrinsic)? Select all that apply.#
Options
Pick every one that applies.
Show answer
The intrinsic parameters are the focal lengths (fx, fy), the principal point (cx, cy), and lens distortion coefficients (e.g. radial terms k1, k2, k3). These describe the camera's internal imaging geometry and do not change with camera pose. The rotation matrix and translation vector are extrinsic because they depend on the camera's position and orientation in the world.
Intrinsic parameters describe the camera's internal imaging geometry and remain fixed regardless of where the camera is in the world. This includes the focal lengths (fx, fy), the principal point (cx, cy), and lens distortion coefficients such as the radial terms k1, k2, k3. The rotation matrix R and translation vector t relate the world coordinate frame to the camera coordinate frame and vary with camera pose — they are extrinsic, not intrinsic.
Computer Vision/cnn-fundamentals/convolution-pooling
The following Python function is intended to perform 2D max pooling with a given kernel size and stride. It contains exactly one bug. Identify the buggy line.#
import numpy as np
def max_pool2d(x, kernel_size=2, stride=2):
H, W = x.shape
out_H = (H - kernel_size) // stride + 1
out_W = (W - kernel_size) // stride + 1
out = np.zeros((out_H, out_W))
for i in range(out_H):
for j in range(out_W):
region = x[i*stride:i*stride+kernel_size,
j*stride:j*stride+kernel_size]
out[i, j] = np.min(region)
return outShow answer
The bug is on line 12.
Max pooling must select the maximum value within each pooling window. Line 12, out[i, j] = np.min(region), calls np.min(region), which returns the minimum value instead of the maximum. Every other line — output dimension calculation (lines 5–6), window slicing (lines 10–11), and iteration (lines 8–9) — is correct. Changing np.min to np.max on line 12 fixes the function.
Computer Vision/feature-detection-matching/corner-edge-detection
A 3×3 grayscale image patch is convolved with the Sobel-x kernel (shown below) to approximate the horizontal intensity gradient at the center pixel.#
import numpy as np
sobel_x = np.array([[-1, 0, 1],
[-2, 0, 2],
[-1, 0, 1]])
patch = np.array([[10, 10, 50],
[10, 10, 50],
[10, 10, 50]])
result = int(np.sum(sobel_x * patch))
print(result)Show answer
160
The Sobel-x kernel detects vertical edges by differencing the right column from the left column, with the center row weighted twice as heavily. Computing the element-wise product and summing: the left column contributes (-1·10) + (-2·10) + (-1·10) = -40, and the right column contributes (1·50) + (2·50) + (1·50) = 200. The middle column is all zeros in the kernel. So the result is -40 + 200 = 160. This large positive value correctly signals a strong vertical edge (intensity jumps from 10 to 50) in the patch.
Computer Vision/object-detection/detection-metrics
An object detector proposes 12 overlapping bounding boxes for the same physical car, each with its own confidence score. What does non-maximum suppression (NMS) do with them before the detector reports final results?#
Options
Show answer
Non-maximum suppression (NMS) collapses near-duplicate bounding-box detections of the same object down to one: it keeps the highest-confidence box, computes intersection-over-union (IoU) between it and every remaining box, discards any whose IoU exceeds a chosen threshold (judging them to describe the same object), then repeats with the next-highest surviving box. This is why a detector's raw dense output of many overlapping boxes per object turns into one clean detection per object in the final result.
A detector's raw output routinely contains many boxes around the same object, because nearby anchors or regions all fire on it. NMS resolves this by sorting candidate boxes by confidence, keeping the top one, computing IoU between it and every remaining box, discarding any whose IoU exceeds the threshold (they're judged to be describing the same object), and repeating with the next-highest surviving box until none are left. This produces one detection per real object instead of a cluster of near-duplicates. Averaging boxes together (b) would blur a tight prediction with looser ones and ignore confidence entirely; discarding the most confident box (c) inverts the actual logic — high confidence is evidence for keeping a box, not against it; and NMS never changes confidence scores (d) — it only decides which boxes to keep or drop.
Computer Vision/object-detection/detection-architectures
Comparing one-stage detectors (like YOLO or SSD) to two-stage detectors (like Faster R-CNN), which of these are genuine, real architectural distinctions? Select all that apply.#
Options
Pick every one that applies.
Show answer
Two-stage detectors like Faster R-CNN first generate class-agnostic region proposals via a region proposal network, then run a separate classification and box-refinement stage on each proposal; one-stage detectors like YOLO and SSD predict class and box directly from a dense feature grid in a single pass. That extra stage is why one-stage detectors have historically been faster and the default choice for real-time use, while two-stage detectors have historically tended toward higher localization accuracy thanks to dedicated per-proposal refinement — though modern one-stage architectures have narrowed that accuracy gap. Both families train end-to-end with backpropagation, and neither is limited to detecting a single class.
The core architectural split is real: two-stage detectors like Faster R-CNN separate 'where might an object be' (region proposals) from 'what is it, exactly' (per-proposal classification and box refinement), while one-stage detectors like YOLO and SSD collapse both into one dense pass over a feature grid (a). That extra stage costs time, which is why one-stage detectors have historically been the default choice when real-time inference matters (b), and why two-stage detectors have historically tended to edge out one-stage detectors on localization accuracy, since each proposal gets dedicated refinement computation rather than sharing a single dense prediction pass (e) — though modern one-stage architectures have narrowed that gap considerably. Both families train end-to-end with backpropagation; the region proposal network in a two-stage detector is itself a trainable CNN component, not a hand-coded step outside the gradient (c is false). And nothing about a single dense prediction pass limits a one-stage detector to one class — YOLO and SSD both predict a full class distribution per anchor/cell, handling arbitrarily many classes (d is false).
Computer Vision/feature-detection-matching/keypoint-descriptors
In current OpenCV releases, cv2.SIFT_create() is a patent-restricted feature that requires building opencv-contrib with a special non-free flag enabled.#
Options
Show answer
False. cv2.SIFT_create() in current OpenCV releases requires no special non-free build flag — SIFT's original patent expired in March 2020, and OpenCV moved the implementation out of the patent-gated opencv_contrib/xfeatures2d module into the main features2d module starting with the 4.4.0 release. The non-free restriction was real for older OpenCV versions but is stale guidance against any current release.
False, as of current OpenCV. SIFT's original patent expired in March 2020, and OpenCV moved the SIFT implementation out of the patent-gated opencv_contrib/xfeatures2d module and into the main features2d module starting with the 4.4.0 release. Since then, cv2.SIFT_create() is available in the standard opencv-python package with no special non-free build flag required — the restriction this question describes was real, but only for OpenCV releases before 4.4.0. This is a good example of why version-pinning matters for anything patent- or license-adjacent: advice that was correct a few years ago ('SIFT needs the non-free contrib build') is now actively wrong guidance if followed against a current release.
Computer Vision/cnn-fundamentals/data-augmentation
Explain why data augmentation (random flips, rotations, crops, color jitter, etc.) matters for training a computer vision model, and give two concrete augmentations you'd use for a photo classification task.#
Show answer
Labeled image data is expensive to collect and label, so training sets are almost always small relative to the true variation a model will meet in production — different lighting, angles, crops, and minor color shifts of the same underlying object. Without augmentation, a model can overfit to incidental properties of the specific training images (a particular pose, a particular lighting condition) rather than learning the features that actually characterize the class, and it fails to generalize to the same object photographed slightly differently. Randomly perturbing training images — horizontal flips, small rotations, random crops, brightness/contrast/color jitter — synthetically expands the effective diversity of the training set, exposing the model to more of the variation it will see at inference time without requiring any new labels, which reduces overfitting and improves generalization. For a photo classification task, horizontal flips (most everyday objects are still recognizable mirrored) and random crop/resize (making the model robust to the object being off-center or at a different scale) are both standard, low-risk choices.
The mechanism is that labeled training data is finite and augmentation is a cheap way to synthetically expand its effective diversity without collecting or labeling anything new: every augmented copy of an image is a free additional training example that teaches the model the same class label under slightly different conditions. This directly targets overfitting — a model trained only on a narrow slice of poses/lighting/crops can latch onto incidental patterns specific to that slice rather than the actual class-defining features, and augmentation forces it to find features that survive the perturbation. Strong answers name augmentations appropriate to the actual task and domain (flips are fine for most photos but wrong for, say, digit or text recognition, where a flipped '6' becomes a '9' or flipped text becomes unreadable) — that judgment call is itself a signal of real understanding versus rote recall.
Computer Vision/camera-geometry/camera-calibration
In the Brown-Conrady lens distortion model, the radial distortion coefficients are intrinsic to the camera-lens system and are estimated together with focal length, principal point, and skew during standard camera calibration.#
Options
Show answer
True. Radial distortion coefficients are a property of the lens itself, independent of scene or pose, so standard calibration frameworks like Zhang's method treat them as intrinsic parameters and estimate them alongside focal length, principal point, and skew.
Radial (and tangential) distortion coefficients describe a physical property of the lens, not the scene geometry or camera pose. In standard calibration pipelines (e.g., Zhang's method as implemented in OpenCV), they are treated as additional intrinsic parameters and jointly optimized alongside the focal length, principal point, and skew term.
Computer Vision/camera-geometry/camera-calibration
Running a standard checkerboard-based camera calibration (e.g. cv2.calibrateCamera) on a set of images from a single monocular camera, which of these does it actually recover? Select all that apply.#
Options
Pick every one that applies.
Show answer
A standard monocular camera calibration recovers the camera's intrinsic parameters — focal length and principal point, packaged as the 3×3 intrinsic matrix — its lens distortion coefficients (radial and tangential, used to undistort future frames via cv2.undistort), and per-image extrinsic parameters describing the checkerboard's rotation and translation relative to the camera in each calibration shot. It does not recover the true real-world size of an arbitrary unknown object photographed later with no other reference in the scene, since a single monocular image has an inherent scale ambiguity that calibration alone can't resolve, and it doesn't make raw sensor output already distortion-free — undistorting still requires applying the recovered coefficients as a post-processing step.
Standard camera calibration solves for the camera's intrinsic matrix — focal length (fx, fy) and principal point (cx, cy) that describe how the lens projects 3D points onto the 2D sensor (a) — and the lens distortion coefficients that model radial and tangential distortion, which is exactly what lets cv2.undistort correct future frames (b). Because the calibration routine doesn't know the checkerboard's real-world pose in advance, it also solves for per-image extrinsics: the rotation and translation that would place the checkerboard where it actually was relative to the camera in each calibration shot (c). What it does not give you is the real-world size of an arbitrary unknown object later photographed with no other reference — a single monocular image has an inherent scale ambiguity, since an object could be twice as big and twice as far away and produce an identical projection; recovering true physical scale needs either a known reference object in the scene, stereo/multi-view geometry, or a depth sensor, none of which calibration alone provides (d is false). And 'distortion-free with zero post-processing' also isn't what calibration gives you — the distortion coefficients let you correct an image after the fact via cv2.undistort, they don't make the raw sensor output itself already distortion-free (e is false).
Computer Vision/object-detection/detection-metrics
A custom evaluation script computes intersection-over-union (IoU) between predicted and ground-truth boxes. On non-overlapping box pairs it reports impossible negative IoU values. Which line is the bug?#
1| def iou(box_a, box_b):
2| ax1, ay1, ax2, ay2 = box_a
3| bx1, by1, bx2, by2 = box_b
4|
5| inter_x1 = max(ax1, bx1)
6| inter_y1 = max(ay1, by1)
7| inter_x2 = min(ax2, bx2)
8| inter_y2 = min(ay2, by2)
9|
10| inter_width = inter_x2 - inter_x1
11| inter_height = inter_y2 - inter_y1
12| inter_area = inter_width * inter_height
13|
14| area_a = (ax2 - ax1) * (ay2 - ay1)
15| area_b = (bx2 - bx1) * (by2 - by1)
16| union_area = area_a + area_b - inter_area
17|
18| return inter_area / union_areaOptions
Show answer
Lines 10-11 — when the boxes don't overlap, inter_x2 - inter_x1 and/or inter_y2 - inter_y1 come out negative (because min(ax2,bx2) ends up less than max(ax1,bx1)), and that negative width/height isn't clamped to zero before being multiplied into inter_area, so inter_area goes negative and drags the whole IoU below zero
The intersection rectangle's corners are computed correctly (the inner-max/inner-min logic in lines 5-8 is exactly right for finding where two rectangles overlap), but the code never guards against the case where the boxes don't actually overlap at all. When they don't, inter_x2 ends up smaller than inter_x1 (or the y-equivalent), which makes inter_width or inter_height negative — and multiplying two negative-capable values without clamping produces a negative inter_area, which is nonsensical for boxes that share no pixels and should have an intersection of exactly 0. The standard fix is inter_width = max(0, inter_x2 - inter_x1) and the same for height, so a non-overlapping pair correctly yields inter_area = 0 and iou = 0.0 instead of a negative number. Union is correctly computed by adding both box areas and subtracting the intersection once, since otherwise the overlapping region would be double-counted — subtracting it is required, not a bug (b is backwards). The min/max assignment in lines 5-8 is standard and correct for finding a rectangle intersection, not swapped (c). And IoU is defined as intersection over union, not intersection alone — dividing by intersection area alone would always return 1.0 for any overlap, however small, which defeats the entire point of the metric (d is false).
Computer Vision/object-detection/detection-architectures
Order the stages of a two-stage object detector like Faster R-CNN, from an input image to a final list of detections.#
Put these in order
Show answer
A two-stage detector like Faster R-CNN runs a CNN backbone to extract a feature map from the input image, then a region proposal network scans that feature map to propose candidate object regions, then RoI pooling or RoI align extracts a fixed-size feature vector for each proposed region, then a classification and box-regression head predicts a class and refined box for each region, and finally non-maximum suppression removes near-duplicate overlapping detections to leave one box per real object. Each stage consumes the previous stage's output — proposals need the backbone's features, RoI pooling needs actual proposals to pool, and NMS needs a full set of per-region predictions before it has anything to deduplicate.
Each stage's input is the previous stage's output, which is what makes this a pipeline rather than a set of independent steps. The backbone runs first because every later stage operates on its extracted features rather than raw pixels. The RPN needs that feature map to propose 'where an object might be,' since it can't propose regions before there's anything to scan. RoI pooling/align only makes sense once actual proposals exist — it's the operation that turns each variable-sized proposed region into a fixed-size feature vector the classification head can consume. The classification/box-regression head then runs per-region, predicting what each proposal actually is and refining its box. Only after every region has a class and a (possibly overlapping) box does NMS have anything to deduplicate — it's the final cleanup step that turns a dense, redundant set of per-region predictions into the clean, one-box-per-object list the detector actually reports.
Computer Vision/camera-geometry/image-transformations
Place the following stages of the standard pinhole-camera imaging pipeline — from a 3D point in the world to its final pixel location — into the order in which they are applied. The pipeline includes extrinsic transformation, perspective projection, lens distortion, and intrinsic mapping.#
Put these in order
Show answer
The correct order is: (1) apply extrinsic parameters R, t to move the 3D world point into the camera frame; (2) perform perspective division by depth Z to get normalized image-plane coordinates; (3) apply radial/tangential lens distortion in normalized coordinates; (4) multiply by the intrinsic matrix K to produce final pixel coordinates (u, v). Distortion is modeled in the normalized plane before focal-length scaling, so it must come after perspective projection but before the intrinsics.
The standard camera model (e.g., Zhang 2000, OpenCV's projectPoints) proceeds in a fixed order: (1) the extrinsic parameters R and t convert a world point to the camera coordinate frame; (2) perspective division by the depth Z projects the 3D camera-frame point onto the normalized image plane (x = X/Z, y = Y/Z); (3) the lens distortion model — radial (k1, k2, k5…) and tangential (p1, p2) — is applied to these normalized coordinates, because distortion is naturally expressed in the normalized plane before any scaling by focal length; (4) the intrinsic matrix K (focal length, principal point, skew) maps the undistorted normalized coordinates to final pixel values (u, v). Each stage's input is the output of the preceding stage, so the order is strict and universally agreed upon in the camera-calibration literature.
Computer Vision/image-segmentation/segmentation-architectures
A standard CNN classifier repeatedly downsamples its feature maps (via strided convolutions and pooling) as it gets deeper, trading spatial resolution for a larger receptive field and more abstract features. Explain why this is a problem for a semantic segmentation model, which needs to output a class label per input pixel, and how an architecture like U-Net addresses it.#
Show answer
A classifier only needs one label for the whole image, so it's fine to progressively throw away spatial resolution in exchange for a larger receptive field and increasingly abstract, semantically-rich features — by the final layers, the feature map might be a fraction of the input's resolution and that's acceptable because the output is a single vector, not a spatial map. Segmentation needs the opposite: a label for every original pixel, which means the model has to produce output at (or upsampled back to) the input's full resolution. If you only used the deepest, most downsampled features, you'd have the right semantic understanding ('this region is a person') but you'd have lost the precise spatial detail needed to draw an accurate pixel-level boundary — edges get blurry and small objects can disappear entirely. U-Net addresses this with skip connections: it has a symmetric encoder-decoder structure, and at each decoder (upsampling) stage, it concatenates in the feature map from the corresponding encoder (downsampling) stage at the same resolution, before that spatial information was discarded. This lets the decoder combine the deep, semantically strong but spatially coarse features with the shallow, spatially precise but less abstract features from earlier in the network, producing an output that's both correctly classified and sharply localized.
This is a staff-level question because it requires reasoning about why an architectural choice exists, not just naming it. The core tension: classification wants abstraction (throw away spatial detail, keep semantic meaning), segmentation wants both abstraction and precise spatial localization, and a plain deep CNN's downsampling path only optimizes for the former. U-Net's skip connections are the direct fix — they let information that would otherwise be permanently lost at each downsampling step re-enter the decoder at the matching resolution, so the final full-resolution prediction has access to both 'what' (from deep features) and 'where, precisely' (from shallow features carried across the skip connection). A strong answer explicitly connects the downsampling-loses-detail problem to the skip-connection mechanism that restores it, rather than treating them as two unrelated facts about U-Net.
Computer Vision/cnn-fundamentals/convolution-pooling
Consider a stack of three 3×3 convolution layers (all with stride 1 and same padding so spatial resolution is preserved), using dilation rates of 1, 2, and 4 from bottom to top. Using the standard receptive field formula — starting with RF = 1 and updating RF_new = RF_old + (k − 1) · d · jump, where k is kernel size, d is the dilation rate, and jump is the cumulative product of all preceding strides (which remains 1 throughout here since every stride is 1) — the receptive field of the topmost layer's output with respect to the original input image is _____ pixels.#
Show answer
Consider a stack of three 3×3 convolution layers (all with stride 1 and same padding so spatial resolution is preserved), using dilation rates of 1, 2, and 4 from bottom to top. Using the standard receptive field formula — starting with RF = 1 and updating RF_new = RF_old + (k − 1) · d · jump, where k is kernel size, d is the dilation rate, and jump is the cumulative product of all preceding strides (which remains 1 throughout here since every stride is 1) — the receptive field of the topmost layer's output with respect to the original input image is 15 pixels.
Trace the receptive field incrementally. Start: RF = 1, jump = 1. Layer 1 (k=3, d=1, s=1): RF = 1 + (3−1)·1·1 = 3, jump = 1·1 = 1. Layer 2 (k=3, d=2, s=1): RF = 3 + (3−1)·2·1 = 3 + 4 = 7, jump = 1. Layer 3 (k=3, d=4, s=1): RF = 7 + (3−1)·4·1 = 7 + 8 = 15. Because all strides are 1, the cumulative jump factor stays 1, so only the dilation rates drive the incremental growth. The doubling dilation pattern causes the receptive field to grow exponentially with the number of layers — the key motivation behind dilated (atrous) convolutions in architectures like DeepLab, which achieve large context windows without increasing parameter count or sacrificing spatial resolution.
Computer Vision/cnn-fundamentals/convolution-pooling
In a deep CNN with uniform 3×3 kernels and stride 1, the theoretical receptive field grows linearly with depth (2d + 1 pixels for d layers). However, Luo, Li, and Huang (2016) proved that the effective receptive field (ERF) — the actual distribution of influence that input pixels exert on a given output pixel — follows a _____ distribution, and for a network of d layers its characteristic width (standard deviation) grows only as O(_____), far sub-linearly compared to the linearly growing theoretical receptive field. This means stacking more layers alone does not proportionally enlarge the practically useful context region.#
Show answer
In a deep CNN with uniform 3×3 kernels and stride 1, the theoretical receptive field grows linearly with depth (2d + 1 pixels for d layers). However, Luo, Li, and Huang (2016) proved that the effective receptive field (ERF) — the actual distribution of influence that input pixels exert on a given output pixel — follows a Gaussian distribution, and for a network of d layers its characteristic width (standard deviation) grows only as O(√d), far sub-linearly compared to the linearly growing theoretical receptive field. This means stacking more layers alone does not proportionally enlarge the practically useful context region.
Luo et al. (2016, NeurIPS) analyzed the ERF of randomly initialized CNNs and showed that the influence of input pixels on a given output pixel follows a Gaussian (normal) distribution centered at the output's spatial location. The standard deviation of this Gaussian grows as O(√d), where d is the network depth, meaning the ERF — the region that actually matters in practice — grows far more slowly than the theoretical RF (which grows linearly as O(d·w)). Concretely, doubling the depth only increases the ERF width by a factor of √2, not 2. This sub-linear growth motivates techniques like dilated convolutions, global average pooling, skip connections, and self-attention, all of which enlarge the effective context more efficiently than naively stacking more convolutional layers.
Computer Vision/camera-geometry/camera-calibration
In Zhang's planar camera-calibration method, each view of the planar target yields a 3×3 homography H whose first two columns are h₁ and h₂. These columns satisfy two algebraic constraints involving the intrinsic matrix K. State the two constraints (using K, h₁, h₂, and the standard notation for the inverse-image-of-the-absolute-conic matrix ω = K⁻ᵀK⁻¹), and name the geometric entity whose invariance across all views these constraints encode.#
Show answer
The two constraints are: (1) h₁ᵀ ω h₂ = 0 and (2) h₁ᵀ ω h₁ = h₂ᵀ ω h₂, where ω = K⁻ᵀK⁻¹ is the image of the absolute conic (IAC). Each homography provides two equations in the unknown entries of ω (which has five degrees of freedom up to scale). Collecting constraints from three or more views (at least six equations) yields a linear system that solves for ω, and K is then obtained by Cholesky decomposition of ω⁻¹. The invariance being encoded is that the image of the absolute conic is identical across all camera viewpoints, because the absolute conic lies on the plane at infinity and its image depends only on K, not on extrinsic parameters.
In Zhang's method the homography H = [h₁ h₂ h₃] = K[r₁ r₂ t] relates the planar pattern to the image. Because r₁ and r₂ are orthonormal columns of a rotation matrix, we get r₁ᵀr₂ = 0 and ‖r₁‖ = ‖r₂‖. Substituting r₁ = λK⁻¹h₁ and r₂ = λK⁻¹h₂ yields h₁ᵀK⁻ᵀK⁻¹h₂ = 0 and h₁ᵀK⁻ᵀK⁻¹h₁ = h₂ᵀK⁻ᵀK⁻¹h₂. The matrix ω = K⁻ᵀK⁻¹ is the image of the absolute conic (IAC), which is invariant across all views since it depends only on intrinsics. Solving the linear system for ω and then applying Cholesky decomposition to ω⁻¹ recovers K.
Related interview questions
The other 76 questions
This page shows 25 and marks what you pick. That's as far as a page can go. A free account opens the other 76 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 marked answers per 30 days · written feedback on the paid plan