Color Space Conversion: YCbCr to RGB
The YCbCr color space separates luminance (Y) from chrominance (Cb, Cr). Conversion to RGB is a linear transformation defined by the following matrix:
R = Y + 1.402 * (Cr - 128)
G = Y - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128)
B = Y + 1.772 * (Cb - 128)
Alternatively, using the matrix form:
[ Y ] [ 0.299 0.587 0.114 ] [ R ]
[Cb] = [-0.1687 -0.3313 0.5 ] [ G ]
[Cr] [ 0.5 -0.4187 -0.0813] [ B ]
Illumination Compensation
The perceived brightness is a logarithmic function of incident light intensity. A common compensation model is:
g(x,y) = 255 * (ln(f(x,y) - B) / (ln(E) - ln(B))) for B <= f(x,y) <= E g(x,y) = 0 for f(x,y) < B g(x,y) = 255 for f(x,y) > E
Where B and E are dynamically determined from the histogram:
- Compute the normalized histogram Pr(rk) = nk / N.
- Compute the cumulative sum Sk = sum(Pr(rk)).
- Find the gray level where Sk first exceeds 5% (with sufficient pixel count mk > 100) and set B to that level.
- Find the gray level where Sk first exceeds 95% (with mk > 100) and set E to that level.
Algorithm flow:
Input Image Output Image
| ^
v |
RGB -> YCbCr YCbCr -> RGB
| ^
v |
Histogram Equalization -> Adaptive Non-linear Transform
Evaluation Metrics for Multi-Object Tracking
Multi-object tracking (MOT) evaluation metrics:
- MOTA: Multiple Object Tracking Accuracy – combines false positives, false negatives, and identity switches.
- IDF1: Ratio of correctly identified detections over the average number of ground-truth and computed detections.
- FP: False Positives.
- FN: False Negatives.
- MT: Mostly tracked trajectories (tracked for more than 80% of lifespan).
- ML: Mostly lost trajectories (tracked for less than 20% of lifespan).
- IDS: Number of identity switches.
- FM: Number of fragmentations (track breaks).
Feature Matching Algorithms
SIFT (Scale-Invariant Feature Transform)
Steps:
- Scale-space extrema detection
- Keypoint localiztaion
- Orientation assignment
- Keypoint descriptor generation
Limitation: High computational cost, poor real-time performance.
SURF (Speeded-Up Robust Features)
Advantage: Faster than SIFT due to integral images and Hessian-based detection.
BRIEF (Binary Robust Independent Elementary Features)
Steps:
- Compute binary descriptors by comparing pixel intensities around keypoints.
- Match descriptors using Hamming distance (XOR operation).
- Use indexing and clustering to accelerate matching.
FAST (Features from Accelerated Segment Test)
Detects corners by comparing a pixel with a circle of surrounding pixels. A threshold controls the number of features.
Perceptual Hashing (pHash)
Process:
- Reduce image to 8x8 pixels (64 pixels) to discard high-frequency details.
- Convert to grayscale (64 levels).
- Compute the average gray value.
- Compare each pixel to the average: set to 1 if greater, 0 otherwise.
- Form a 64-bit hash (the fingerprint).
- Compare images using Hamming distance: distance < 5 indicates similarity.