Color Constancy and Illuminant Estimation
Exploring the color constancy problem, implementing illuminant color estimation techniques, and evaluating image correction quality using both angular and RMS error metrics.
Color Constancy and Illuminant Estimation
Overview
A. Understanding the Color Constancy Problem
1. Illuminant Estimation for macbeth_syl Image
- Selected a white patch and computed the average RGB value: [238, 220, 250]
- Normalized to max value 250 using a scaling factor
2. Illuminant Estimation for macbeth_solux Image
- Repeated the same process
- Resulting RGB value: [132, 159, 250]
3. Angular Error Between Light Sources
- Computed angular error using normalized dot product:
- Result: 13.84°
4. Image Remapping Under Canonical Light
- Used diagonal model to map original blueish image to canonical lighting
- Compared original, corrected, and canonical images
- Observed that corrected image visually approximates the canonical, with small discrepancies in brightness
5. RMS Error of Chromaticity Coordinates
- Filtered out dark pixels (R+G+B < 10)
- Computed chromaticity (r, g) and Euclidean distance for RMS error
- Results:
- Original vs Canonical: 0.1149
- Corrected vs Canonical: 0.0475
6. MaxRGB Algorithm for Remaining Scenes
- Estimated light color using MaxRGB:
- apples2: [182, 228, 250], angular error: 9.80°
- ball: [153, 177, 250], angular error: 3.57°
- blocks1: [250, 242, 209], angular error: 19.95°
- Manually excluded artifact regions to improve estimate in
ball
scene
7. Final Image Triplet Display and RMS Report
- Generated corrected images and computed RMS error for each:
- apples: 0.0608
- ball: 0.0494
- blocks: 0.0984
- RMS error rankings match angular error rankings, confirming consistency
8. Comparison with Gray-World Method
- Computed gray-world estimates and angular errors:
- apples: [49, 78, 250], error: 19.62°
- ball: [129, 167, 250], error: 1.39°
- blocks: [250, 154, 180], error: 23.43°
- RMS errors:
- apples: 0.1382
- ball: 0.0554
- blocks: 0.1514
- MaxRGB outperformed gray-world overall, despite an anomaly in
ball
scene where gray-world had lower angular error but higher RMS
Conclusion
This assignment implemented two methods of light estimation (MaxRGB and Gray-World), applied them to real images using the diagonal model, and evaluated their accuracy using angular and RMS error. The results support MaxRGB as a more consistent performer on this dataset, though scene-specific anomalies reveal the complexity of color constancy in practice.
This post is licensed under CC BY 4.0 by the author.