Computer Vision (CV) — CIE-3 Complete 30/30 Exam Guide
Exam Overview:
Complete Computer Vision CIE-3 revision guide combining every important theory derivation, comparison table, and solved numerical (Pinhole Camera Model & Intrinsic Matrix K, RANSAC Homography, Lucas-Kanade Optical Flow, Morphological Image Processing E/D/O/C, Eigenfaces PCA, Viola-Jones, YOLO + NMS & IoU, HOG+SVM vs YOLO, and Precision & Recall).
Master Checklist of Important CV Questions
- Pinhole Camera Model & Perspective Projection -> Intrinsic Camera Matrix K Derivation & Parameter Significance (7M) + Intrinsic vs Extrinsic Parameters (2M)
- RANSAC Algorithm for Homography Estimation Between 2 Images (7M)
- Lucas-Kanade Optical Flow Method (4a) & Object Tracking Across Frames + 2 Error Situations (4b) (7M)
- Morphological Image Processing Operations (Erosion, Dilation, Opening, Closing) + Step-by-Step Binary Matrix Numericals (5M / 7M)
- Eigenfaces Approach for Face Recognition using PCA (7M)
- Viola-Jones Face Detection Algorithm (Haar-like Features, Integral Image, AdaBoost, Cascade Classifier) (7M)
- YOLO Object Detection + Non-Maximum Suppression (NMS) & IoU Solved Numericals (3 Exact Class Variants) (7M)
- Comparison: HOG + SVM vs YOLO (Computational Performance & Hardware) (7M) + Haar Cascade vs YOLO Inference Latency (2 Reasons) (2M)
- Precision & Recall (Part-A 2M Formula & Solved Numericals) (2M)
1. Pinhole Camera Model, Perspective Projection & Intrinsic Matrix K (7M + 2M)
A. Neat Pinhole Camera Diagram
3D World / Camera Point P(X, Y, Z) * /| / | / | Y Image Plane / | (z = f) / | | / | | p(x,y)/ | ---------+-------*-------+-------------------> Optical Axis (Z) y | | /| O(0,0,0) = Optical Center / Pinhole | | / | |<--f-->| |<-------------- Z ----------------->| (Placing the virtual image plane in front of the pinhole at z = +f produces an upright projection; a physical back plane at z = -f flips the image upside down.)
B. Derivation of Perspective Projection & Intrinsic Matrix K
-
Perspective Projection Equations (Metric Image Coordinates in mm):
Consider a 3D point in camera coordinatesX_c = (X, Y, Z)^Tprojected through the pinholeO(0,0,0)onto the image plane at depthz = f(focal length).
By similar triangles:-
x / f = X / Z==>x = f × (X / Z) -
y / f = Y / Z==>y = f × (Y / Z)
-
-
Metric Image Plane (x, y) -> Pixel Coordinates (u, v):
- Digital sensors sample the plane with pixel densities
m_x(pixels/mm along x) andm_y(pixels/mm along y). - Pixel coordinates start at the top-left corner while the optical axis intersects the sensor at the principal point
(c_x, c_y). - Including optional axis skew
s:u = (f × m_x) × (X / Z) + s × (Y / Z) + c_x = f_x × (X / Z) + s × (Y / Z) + c_x-
v = (f × m_y) × (Y / Z) + c_y = f_y × (Y / Z) + c_ywheref_x = f × m_xandf_y = f × m_yare focal lengths in pixel units.
- Digital sensors sample the plane with pixel densities
Homogeneous Matrix Form (Intrinsic Matrix K):
Multiply both sides by depthZ:
[ u ] [ f_x s c_x ] [ X ] Z × [ v ] = [ 0 f_y c_y ] [ Y ] = K × X_c [ 1 ] [ 0 0 1 ] [ Z ] So the 3×3 Intrinsic Camera Matrix K is:
[ f_x s c_x ] K = [ 0 f_y c_y ] [ 0 0 1 ] (Full world-to-pixel camera projection with Extrinsics [R | t]: λ × x_tilde = K [R | t] X_world_tilde.)
C. Significance of Each Parameter in K
| Parameter | Meaning & Significance |
|---|---|
f_x, f_y | Focal lengths in pixels (f × m_x, f × m_y). Control image magnification / zoom along x and y; ratio f_y / f_x defines pixel aspect ratio. |
c_x, c_y (or o_x, o_y) | Principal point offset (in pixels). Exact pixel location where the optical axis strikes the image sensor (typically near image center (W/2, H/2)). |
s | Skew coefficient (f_x × cot θ). Encodes non-orthogonality between pixel axes (s = 0 for normal rectangular pixels). |
Row [0 0 1] | Enables homogeneous projective representation and perspective division (u = u_tilde / Z, v = v_tilde / Z). |
D. Intrinsic vs Extrinsic Camera Parameters (2M Quick Answer)
| Feature | Intrinsic Parameters (K) | Extrinsic Parameters ([R | t]) |
| :--- | :--- | :--- |
| Definition | Internal optical & sensor geometry of the camera. | External 3D pose (orientation & position) relative to the world frame. |
| DOF / Components | 5 DOF: f_x, f_y, c_x, c_y, s (3×3 upper-triangular K). | 6 DOF: 3×3 Rotation R (3 angles) + 3×1 Translation t (3 shifts). |
| Changes with camera motion? | No (stays constant unless lens zoom/focus changes). | Yes (changes whenever camera rotates or translates). |
2. RANSAC Algorithm for Homography Estimation Between 2 Images (7M)
Problem Context
A feature matcher finds putative correspondences {(p_i, p'_i)} between Image 1 and Image 2 linked by a 3×3 planar Homography matrix H (p'_i ~ H × p_i). Real matches contain both inliers (true matches) and outliers (mismatches). Standard Least Squares gets ruined by outliers, whereas RANSAC (RANdom SAmple Consensus) finds H robustly even with >50% outliers.
Minimal Sample Size
- A 3×3 homography
His defined up to scale -> 8 Degrees of Freedom (DOF). - Each 2D point correspondence gives 2 linear equations -> minimum sample size
s = 4non-collinear correspondences.
Step-by-Step RANSAC Algorithm
- Loop for
Niterations:- Step 1 (Random Sampling): Randomly pick
s = 4correspondence pairs (with no 3 collinear). - Step 2 (Model Estimation): Compute candidate
Hvia Direct Linear Transform (DLT) (A h = 0solved via SVD). - Step 3 (Inlier Evaluation / Consensus Set):
- Project every point
p_ifrom Image 1 into Image 2:p'_hat_i = H × p_i(normalized). - Compute reprojection distance
d_i = || p'_i - p'_hat_i ||_2. - If
d_i < t(error threshold, e.g., 2–3 px), mark(p_i, p'_i)as an inlier; else outlier. - Count inliers
|S_k|in consensus setS_k.
- Project every point
- Step 4 (Track Best Model): Keep
H_bestandS_besthaving the maximum inlier count.
- Step 1 (Random Sampling): Randomly pick
- Iteration Count Formula:
N = log(1 - p) / log(1 - (1 - e)^s)wherep ≈ 0.99(desired success probability),e= outlier ratio,s = 4. - Step 5 (Refinement): Discard all outliers and re-estimate final
Husing all inliers inS_bestvia least squares / non-linear optimization.
Advantages: Tolerates large fractions of outliers (>50%); essential for panorama stitching & planar object matching.
Limitations: Randomized (slightly non-deterministic); requires tuning threshold t and iteration count N.
3. Lucas-Kanade Optical Flow (4a) & Object Tracking + 2 Error Situations (4b) (7M)
Part (4a): Lucas-Kanade Optical Flow Method
- Brightness Constancy Assumption:
I(x, y, t) = I(x + Δx, y + Δy, t + Δt) - Optical Flow Constraint Equation (1st-Order Taylor Series): Expanding linearly and dividing by
Δt(u = dx/dt,v = dy/dt):I_x × u + I_y × v + I_t = 0whereI_x, I_yare spatial intensity gradients andI_tis the temporal derivative. - Aperture Problem: A single pixel provides 1 equation with 2 unknowns
(u, v)— underdetermined! - Spatial Coherence Assumption (Lucas-Kanade Solution): Assume all pixels inside a small
w × wlocal window (e.g., 3×3 or 5×5,n = w²pixels) around the feature share the same constant velocity(u, v), yielding an overdetermined systemA v = b. - Least-Squares Normal Equations Solution:
[ u ] -1 [ Σ I_x² Σ I_x I_y ] -1 [ -Σ I_x I_t ] [ v ] = (A^T × A)^ A^T b = [ Σ I_x I_y Σ I_y² ] × [ -Σ I_y I_t ] Condition: The 2×2 structure tensor A^T A must be invertible — both eigenvalues λ_1, λ_2 must be large, meaning Lucas-Kanade works best at corners (Shi-Tomasi / Harris keypoints), not flat regions or edges.
Part (4b): Object Tracking Across Frames & 2 Situations Causing Tracking Error
How Estimated Motion Vectors Track an Object Across Frames:
- Detect strong corner keypoints
{p_1^(t), ..., p_K^(t)}inside the object region in framet. - Estimate sparse optical flow
(u_i, v_i)for each point between framestandt+1. - Update feature locations:
p_i^(t+1) = p_i^(t) + (u_i, v_i). - Aggregate object displacements (mean/median/RANSAC) to shift the bounding box cleanly into frame
t+1and repeat continuously across frames.
Situations That Cause Tracking Error (Write any 2 clearly):
- Large / Fast Object Motion: Breaks the small-displacement Taylor approximation; if the object jumps beyond the local window size between frames, tracking fails (mitigated using Pyramidal LK).
- Occlusion (Partial or Full): Another object covering the target or the target exiting the frame causes tracked points to attach to the occluder, producing false flow vectors and drift.
- Sudden Illumination / Shadow Changes: Violates brightness constancy (
I(x,y,t) ≠ I(x+u,y+v,t+1)), generating spuriousI_tderivatives. - Low-Texture / Edge Regions (Aperture Problem): In flat regions or straight edges,
A^T Abecomes nearly singular, yielding noisy/unreliable motion vectors.
4. Morphological Image Processing Operations & Solved Matrix Numericals (5M / 7M)
Class Mnemonics:
- Opening =
EDO(Erosion -> Dilation = Opening):A o B = (A - B) (+) B- Closing =
DEC(Dilation -> Erosion = Closing):A • B = (A (+) B) - B
A. Core Definitions & Pixel Rules
| Operation | Formula | Binary Pixel Rule (0/1) | Effect on Foreground |
|---|---|---|---|
Erosion (A - B) | `{ z \ | (B)_z ⊆ A }` | 1 iff ALL 1s of B FIT inside 1s of A (MIN in window). |
Dilation (A (+) B) | `{ z \ | (B_hat)_z ∩ A ≠ ∅ }` | 1 if AT LEAST ONE 1 of reflected B_hat HITS a 1 in A (MAX in window). |
Opening (EDO) | (A - B) (+) B | Erosion followed by Dilation. | Smooths contours, removes isolated noise & thin protrusions, breaks narrow bridges while preserving main object size. |
Closing (DEC) | (A (+) B) - B | Dilation followed by Erosion. | Smooths contours, fills small interior holes & bridges narrow gaps while preserving main object size. |
B. Class Slide Worked Numericals
Slide Example 1: Erosion (9 × 12 matrix A, 3 × 1 vertical SE B = [1, (1), 1]^T)
Only row 4 has 1 above, at, and below simultaneously, so only the middle row survives:
Input A (9x12) Output Erosion (A - B) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 ===> 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Slide Example 2: Dilation (9 × 12 matrix A, 5-pixel anti-diagonal SE B)
Dilation expands the rectangle diagonally outward by 2 steps in top-right and bottom-left directions:
Output Dilation (A (+) B) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 C. Complete 4-Part Morphological Numerical (a–d)
Consider a 6 × 7 zero-padded binary image A and a 3 × 3 all-ones square Structuring Element S centered at [1]:
Input Image A (6x7, 15 foreground pixels) Structuring Element S (3x3) 0 0 0 0 0 0 0 1 1 1 0 1 1 1 1 1 0 1 [1] 1 0 1 1 1 0 1 0 <- 1-pixel hole at (2,4) 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 <- isolated noise pixel at (5,1) (a) Erosion (A - S) and Dilation (A (+) S):
Erosion (A - S) [1 pixel] Dilation (A (+) S) [38 pixels] 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 (b) Opening (A o S = (A - S) (+) S) and Closing (A • S = (A (+) S) - S):
Opening (A o S) [9 pixels] Closing (A • S) [16 pixels] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (c) Comparison of the 4 Results & Effect on Foreground Region:
- Erosion: Shrinks the foreground down to
(2, 2), deleting the isolated noise pixel and thin loop around(2, 4). - Dilation: Expands foreground outward by 1 pixel, filling the hole
(2, 4)and enlarging both the noise pixel and main object. - Opening: Removes isolated noise
(5, 1)and thin loop walls, restoring the main3 × 3foreground core back to its exact size. - Closing: Fills the internal hole
(2, 4)while preserving the outer region size (with(4, 1)bridging across the 1-row gap toward(5, 1)during dilation before border erosion prunes(5, 1)).
(d) Suitable Applications:
- Opening: Removing foreground salt noise / thin boundary spurs in binary images (e.g., fingerprint enhancement or pre-OCR cleanup).
- Closing: Filling internal holes and bridging broken character strokes (e.g., repairing broken license-plate / OCR text or medical lesion masks).
5. Eigenfaces Approach for Face Recognition Using PCA (7M)
(Remember: **Face Detection* locates faces in an image; Face Recognition identifies whose face it is.)*
Core Idea: Compare faces in a compact low-dimensional PCA subspace instead of 100 × 100 = 10,000 raw pixels per image.
Step-by-Step Eigenfaces Algorithm
- Collect & Preprocess Faces: Gather
Maligned grayscale training face images, each resized toN × N(e.g.,100 × 100). - Vectorize: Flatten each face into a column vector
Γ_iof sizeN² × 1. - Compute Mean Face (
Ψ):Ψ = (1 / M) × Σ Γ_i. - Mean-Center: Subtract the mean face from each vector (
Φ_i = Γ_i - Ψ) and form matrixA = [Φ_1, Φ_2, ..., Φ_M](N² × M). - Covariance Matrix & Turk–Pentland Trick:
- Full covariance
C = (1/M) A A^T(N² × N²) is huge (10,000 × 10,000). - Instead solve eigenvectors
v_iof the smallerM × MmatrixL = A^T A, then recover eigenfaces viau_i = A v_i(unit-normalized).
- Full covariance
- Select Top
KEigenfaces: Sort by descending eigenvalues (λ_1 >= λ_2 >= ... >= λ_K) and keep topKeigenvectorsU = [u_1, ..., u_K]. - Project Training Faces: Compute each person's
K-D weight vectorΩ_i = U^T (Γ_i - Ψ). - Recognition (Testing): Given test image
Γ_new, computeΩ_new = U^T (Γ_new - Ψ)and find minimum Euclidean distanced_i = || Ω_new - Ω_i ||_2. Ifmin d_i < θ, output identityi*; else unknown.
6. Viola-Jones Face Detection Algorithm (7M)
Built on 4 pillars for real-time CPU face detection:
-
Haar-Like Features: Rectangular brightness-difference templates:
Feature Value = Σ(White Rectangle Pixels) - Σ(Black Rectangle Pixels)- Two-rectangle: Eye sockets (dark) vs forehead/upper cheeks (bright).
- Three-rectangle: Bright nose bridge flanked by darker eyes.
- Four-rectangle: Diagonal facial intensity patterns.
Integral Image (
O(1)Fast Lookup):
ii(x, y) = Σ_{x'<=x, y'<=y} i(x', y')
(0,0) -----------------+----------+ | A | B | | (1)| (2)| +--------------------+----------+ | C | D | | (3)| (4)| +--------------------+----------+ Sum inside rectangle D takes just 4 array lookups: Sum(D) = ii(4) - ii(2) - ii(3) + ii(1).
AdaBoost Feature Selection: Selects the most discriminative Haar weak classifiers from
~160,000+candidates, increases weights on misclassified training samples, and combines them into a weighted strong classifier.Cascade Classifier: Evaluates stages sequentially from simplest to deepest:
[1000 Windows] ---> [Stage 1: Simple Haar] --pass(300)--> [Stage 2] --pass(100)--> [Stage 3] ---> [30 Faces] | | | Reject 700 Reject 200 Reject 70 Non-face regions fail early stages and are discarded immediately, delivering real-time CPU performance without a GPU (limitations: weaker on side profiles, occlusions, and poor lighting).
7. YOLO Object Detection + Non-Maximum Suppression (NMS) & IoU Numericals (7M)
YOLO Pipeline & Formulas
- Divides image into an
S × Sgrid and runs a single CNN forward pass predicting bounding boxes(x, y, w, h), class scores, and confidence. - Confidence Thresholding: Discard boxes with
confidence < threshold(e.g.,0.5). - Non-Maximum Suppression (NMS): Per class, retain highest-confidence box and suppress same-class boxes overlapping with
IoU > threshold. - Formulas:
- Intersection box:
x_min = max(x1_min, x2_min),y_min = max(y1_min, y2_min),x_max = min(x1_max, x2_max),y_max = min(y1_max, y2_max) Intersection = max(0, x_max - x_min) × max(0, y_max - y_min)Union = A1 + A2 - IntersectionIoU = Intersection / Union
- Intersection box:
Problem 1 — Class Notebook & Slide P1 (Highest Chance!)
Conf threshold = 0.5, NMS IoU threshold = 0.5:
| Detection | Class | Confidence | Box (x_min, y_min, x_max, y_max) |
|---|---|---|---|
D1 | Person | 0.91 | (100, 50, 200, 250) |
D2 | Person | 0.84 | (110, 60, 205, 255) |
D3 | Car | 0.78 | (300, 150, 500, 300) |
D4 | Person | 0.43 | (320, 60, 380, 200) |
- i. Confidence Thresholding:
D4(0.43 < 0.5) is discarded. (D1, D2, D3retained.) - ii. IoU(
D1, D2):- Intersection box:
(110, 60, 200, 250)->w = 90,h = 190-> Intersection =17,100 -
A1 = (200-100)(250-50) = 100 × 200 = 20,000;A2 = (205-110)(255-60) = 95 × 195 = 18,525 - Union
= 20,000 + 18,525 - 17,100 = 21,425 - IoU
= 17,100 / 21,425 = 0.7981(79.81%)
- Intersection box:
- iii. NMS Result:
0.7981 > 0.5->D2suppressed,D1(0.91) retained (andD3Caris retained separately). - iv. Why IoU Is Used Differently in NMS vs Detection Evaluation:
- In NMS: Compares two predicted boxes of the same class (
IoU(D1, D2)) during inference; high IoU (> thresh) suppresses the lower-confidence duplicate. - In Evaluation (mAP / P / R): Compares a predicted box against Ground Truth (
IoU(Pred, GT)); high IoU (>= thresh) counts as a True Positive (TP), otherwise False Positive (FP).
- In NMS: Compares two predicted boxes of the same class (
Problem 2 — Variant 2 (problems.pdf Page 4)
D1 (Person, 0.93, (80, 40, 180, 200)), D2 (Person, 0.86, (90, 50, 185, 205)), D3 (Car, 0.79, (250, 100, 400, 220)), D4 (Person, 0.46, (300, 60, 390, 190)):
- i.
D4(0.46 < 0.5) discarded. - ii. Intersection
(90, 50, 180, 200)->90 × 150 = 13,500;A1 = 16,000,A2 = 14,725; Union= 17,225; IoU =13,500 / 17,225 = 0.7837(78.37%). - iii.
0.7837 > 0.5->D2suppressed,D1retained (D3retained separately).
Problem 3 — Variant 3 (problems.pdf Page 5)
D1 (Person, 0.88, (40, 60, 160, 220)), D2 (Person, 0.76, (55, 75, 155, 215)), D3 (Car, 0.82, (220, 100, 380, 250)), D4 (Person, 0.49, (45, 65, 150, 210)):
- i.
D4(0.49 < 0.5) discarded. - ii. Intersection
(55, 75, 155, 215)->100 × 140 = 14,000(D2sits completely insideD1);A1 = 19,200,A2 = 14,000; Union= 19,200; IoU =14,000 / 19,200 = 0.7292(72.92%). - iii.
0.7292 > 0.5->D2suppressed,D1retained (D3retained separately).
8. HOG + SVM vs YOLO (7M) & Haar Cascade vs YOLO Latency (2M)
A. Comparison: HOG + SVM vs YOLO (Computational Performance & Hardware)
| Feature | HOG + SVM | YOLO |
|---|---|---|
| Approach | Traditional CV (hand-crafted gradients + classical ML) | Deep Learning (end-to-end CNN) |
| Feature Extraction | Histogram of Oriented Gradients (8×8 cells, block norm) | Multi-layer learned CNN features |
| Detection Method | Multi-scale sliding window + pyramid | Single network forward pass |
| Speed / Complexity | Slower for full-image multi-scale scans; scales linearly with windows | Very fast real-time inference (30–100+ FPS on GPU) |
| Hardware Needs | Runs easily on ordinary CPUs, low RAM, no GPU needed | Requires GPU / NPU for real-time CNN convolutions; higher VRAM/power |
| Multi-Class Scaling | Typically single-class (e.g., pedestrians) | Natively predicts many classes simultaneously |
| Accuracy | Degrades in clutter/occlusion/lighting shifts | Much higher accuracy in complex scenes |
B. Haar Cascade vs YOLO — Inference Latency & 2 Reasons (2M)
- Lower Latency (on CPU / Lightweight Devices): Haar Cascade (Viola-Jones) achieves lower inference latency for single-class frontal face detection on standard CPUs.
- 2 Reasons:
- O(1) Integral Image Evaluation: Computes rectangular Haar features with just 4 array lookups, avoiding millions of deep CNN MAC operations.
- Early Cascade Rejection: Early tiny stages reject 70–90%+ of background windows immediately instead of running a full neural network forward pass across the image. (Note: On a GPU for full-scene multi-class detection, YOLO achieves lower latency because one parallel GPU pass detects all classes at once.)
9. Precision & Recall (Part-A 2M Formula & Numerical)
-
Precision = TP / (TP + FP)(out of all predicted positives/detections, how many were right?) -
Recall = TP / (TP + FN)(out of all actual ground-truth objects, how many were found?) - (Optional
F1-Score = 2 × Precision × Recall / (Precision + Recall))
Quick Worked Numerical 1 (Confusion Matrix Counts):
Given TP = 40, FP = 10, FN = 5:
-
Precision = 40 / (40 + 10) = 40 / 50 = 0.80(80%) -
Recall = 40 / (40 + 5) = 40 / 45 = 0.8889(88.89%)
Quick Worked Numerical 2 (Object Detection Scene):
10 ground-truth cars exist; YOLO predicts 8 boxes where 6 are correct (IoU >= 0.5) and 2 are false alarms (TP = 6, FP = 2, FN = 4):
-
Precision = 6 / (6 + 2) = 0.75(75%) -
Recall = 6 / (6 + 4) = 0.60(60%)


