November 2023. I had just joined an underwater robotics team, and the vehicle had to follow green arrows. So I wrote forty lines of OpenCV that asked every pixel one question: is your hue between 50 and 70?
It worked beautifully. On my desk.

Three years later I went back to find out exactly how wrong it was, and when.
Water is a filter that thickens with distance
Light travelling through water loses red about twenty times faster than blue. The water also glows back at the camera with its own blue-green haze. A pixel underwater is two things added together:
I = J · e^(−k·d) + B · (1 − e^(−k·d))
what's there what the water adds
J is the object’s real colour, B the veiling light, d the metres of water between lens and object, k a per-channel attenuation. I used pure-water absorption from Pope & Fry (1997), scaled by four to stand in for a real pool. That scale is a knob, not a measurement, and the note says so wherever the number appears.
Sink it yourself. The card below goes through the same model, and the 2023 threshold judges it live. The dots on the curve are not the model: they’re real, the mean red-to-green ratio over 119 frames of the team’s own 2025 footage, per venue.
Loading the diagram. It needs JavaScript; the text around it says the same thing in words.
tools/studies/colour_loss.py, 119 frames); where a dot lands on the model curve is an inference, as if the camera had done nothing to the colour, and is labelled so.Read the venues against the curve and something odd shows up: the final-run footage comes back almost colour-neutral. That doesn’t mean the water there was kinder. It means the camera, or its white balance, was set differently. Two venues, two answers, from the same pipeline, which is why a colour number has to be measured per venue instead of quoted once.
Sinking the card
A synthetic RoboSub-style card (green arrow, orange gate post, sandy floor) goes down in 0.5 m steps. Because the card is synthetic, the true mask is known to the pixel, so every strategy gets an honest score: intersection-over-union against ground truth.

| water path | as-is | gray-world | invert the water |
|---|---|---|---|
| 0 m | 1.000 | 1.000 | 1.000 |
| 2 m | 0.777 | 0.995 | 1.000 |
| 3 m | 0.532 | 0.605 | 0.987 |
| 5 m | 0.000 | 0.015 | 0.621 |
| 10 m | 0.000 | 0.000 | 0.421 |
| below 0.5 at | 3.5 m | 3.5 m | 6.0 m |
Three things I didn’t expect
The first failure is a hallucination, not blindness. At 2 m the orange gate post turns green enough to pass. The detector now reports two arrows. A detector that sees nothing at least tells you so. One that sees the wrong thing points the vehicle at a post with total confidence.
White balance fixes the hallucination but not the drowning. Gray-world removes the fake arrow, then loses the real one at the same depth as before. The haze flattens saturation below the threshold’s floor of 100, and no amount of rebalancing puts saturation back.
Knowing the physics buys depth until the noise collects the bill. If you know the range (a DVL or sonar gives you that on a real vehicle) you can divide the water back out. That works until the red channel is so dim that dividing by it mostly amplifies sensor noise. Then the gate post comes back as speckle.
Water decides when the threshold dies. Engineering only gets to move the depth.
Finishing the 2023 job
The repo now also contains the detector I meant to write: one that finds an arrow, not just green, and says which way it points.
- Shape is a second opinion colour can’t fake. An arrow is solid but notched: its area is 55 to 92 % of its convex hull. The gate post is a rectangle at about 100 %. That single check removes the 2 m hallucination without any white balance.
- The head is the wide end. My first attempt took the point farthest from the centroid as the tip, and got every arrow backwards. The head’s bulk drags the centroid forward, so the tail corners win. Version two looks along the long axis and picks the end that is wider across.


Both frames from github.com/fh1m/green-at-depth, reproducible with fixed seeds.
What it taught, later
The same lesson, learned for real in pools on the Duburi vehicles, is why the team’s vision moved from colour rules to learned detectors trained on underwater footage. It’s also why the paper we later wrote argued that colour is class evidence: the colour shift isn’t only noise to remove; sometimes it’s the signal.
The 2023 script is still in the repo, untouched, next to its original README. Nostalgia is allowed if it comes with a test suite.
