How We Turned a Smartphone Camera into a Lab-Grade Spectrophotometer
Published: November 3, 2026 · Author: Barbaros Köklü · 7 min read
1. The Problem: Why Were We Bound to $2,000 Benchtop Devices?
For decades, pool operators, aquarium hobbyists, water treatment specialists, and field chemists faced the same frustrating dilemma: eyeball printed color swatch boxes on the bottle ("Is that 7.2 or 7.6?") or invest thousands of dollars into heavy benchtop photometers.
Smartphone sensors have achieved 48-megapixel resolution and incredible dynamic range, yet standard camera apps fail on wet chemical test strips. The root cause is optical physics:
- Specular Wet Glare: Submerged strips form a microscopic water meniscus that acts like a mirror, reflecting ambient light directly into the lens.
- Ambient Lighting Bias (Kelvin Shift): Warm tungsten light (2700K) vs bright daylight (6500K) produces completely different raw RGB values on the exact same dye.
- Sensor Spectral Disparity: Sony, Samsung, and OmniVision camera sensors employ distinct Bayer color filter arrays with varying transmissivity.
2. The Optical Breakthrough: 3-Second 24 FPS Temporal Median Fusion
Every existing mobile test strip app relies on a single photo snapshot. In a single frame, a glare spot saturates pixels to pure white (RGB 255, 255, 255). No computer vision algorithm can hallucinate the true pigment underneath.
StripVision solved this using handheld motion geometry and temporal statistics:
// MATHEMATICAL TEMPORAL MEDIAN MODEL
While holding the phone steady over the strip, human hand tremor introduces microscopic micro-angle shifts. Over a 3-second 24 FPS video burst, the mirror reflection on the liquid dome constantly travels across coordinates while the absorbed chemical dye remains stationary. For each $(x, y)$ coordinate across frames $[I_1, I_2, \dots, I_N]$:
I_{clean}(x, y) = \text{median}\{ I_k(x, y) \}_{k=1}^N
Taking the median instead of the average mathematically discards outlier reflection bursts, isolating 100% pure pigment color directly in RAM.
3. Published Color Science: Cheung 2004 CIE Lab Normalization
Once specular reflection is eradicated, the next hurdle is eliminating illuminant bias. Reading a strip in a dimly lit bathroom yields reddish-yellow shifts compared to high noon sun.
StripVision implements the academic gold standard in colorimetry, Cheung et al. 2004 ("A model for transforming camera RGB into device-independent CIE Lab space"), compiled natively in C++ / Swift:
- Raw camera RGB coordinates are projected into device-independent $L^*a^*b^*$ color space using a 3rd-order non-linear polynomial matrix.
- In-scene illumination vectors are calculated using the kit's reference scale and white plastic substrate.
- Residual color difference is maintained at $\Delta E94 < 1.2$—virtually imperceptible to the human eye.
- Outcome: Whether measured under tungsten bulbs or overcast skies, chemical concentrations match down to the milligram.
4. Decimal Precision: Ending Swatch Guesswork with Continuous Curves
Standard bottle charts present step-wise color patches: 6.8, 7.2, 7.8, 8.4. When your sample sits at 7.42, users are forced to guess between two shades.
StripVision's digital colorimetry engine works across continuous physical wavelengths:
- Every reagent features a calibrated chemical reaction curve (sigmoid / polynomial absorbance mapping).
- Measured $L^*a^*b^*$ coordinates are projected onto this continuous manifold.
- The system avoids step approximations, reporting exact decimal values: 7.24 pH, 3.5 ppm Free Chlorine, and 115 ppm Total Alkalinity.
5. Multi-Pad Architecture: 9 Parameters in a Single 3-Second Scan
Modern water safety requires evaluating interconnected parameters. Free Chlorine, Total Chlorine, Alkalinity, Cyanuric Acid (CYA), Total Hardness, and Bromine dictate chemical equilibrium via the Langelier Saturation Index (LSI).
StripVision's multi-pad spatial segmentation isolates up to 9 reagent pads simultaneously. Each chemical pad's reaction kinetics are tracked independently, producing a clinical water diagnostic report within 3 seconds.
Your Phone is Now a Lab Instrument.
Zero proprietary hardware. Zero calibration cards. 10 free scans every month on iOS and Android.