Wednesday, February 9, 2011

Mind Games

In more savage days when we were constantly on the lookout for animals who would like nothing more than to pounce on and eat us, it was really helpful that our mammalian eyes were specially tuned to identify and sharpen shifts in patterns.  Maybe we could spot those lion eyes more readily in a sea of tall grass.  These days, among other things, it serves to confound designers and developers of heat map engines (also dentists).

Yes, You Are Crazy
See the slight darkening of the circles at their edges where they overlap?  Those dark bands are created in your retina/brain and aren’t really there...

Supposedly, those bands at the intersection of the glowing orbs isn't real.  But what is, ultimately?

Weird, right?  The illusion is thought to be caused by lateral inhibition.  When the light enters your eye it hits receptors and those receptors send the message to your brain.  But the receptors that are hit inhibit the firing of the receptors right next door so the result is a kind of artificial sharpening or increase in contrast.
When your eye tracks the gradient of the circle and the regular/expected shift is interrupted by the overlap of the other circle, your eyes send your brain an artificially increased contrast signal.  The result is those phony bologna darkened bands.  The nature of the bands are very similar to the optical illusion known as Mach Bands.

What the Deuce?
So imagine our head scratching when at the beginning of the development of IDV’s heat mapping engine, we saw these confounded dark line artifacts all over our heat maps and no amount of eyedropping could identify an actual dip in luminance.

The esteemed and eclectic Mr. Mach.

Daniel Briggs, our lead heat map developer, first suggested that we were seeing things that weren’t really there and identified them as something akin to Mach Bands, named after eclectic 19th century science philosopher Ernst Mach (the same dude who lent his name to the speed of sound stuff -and, by extension, a safety razor arms race).

The Mitigating Effect of Context
Good news.  It turns out, when you are looking at a heat map in an actual map, the pesky optical illusion isn’t so noticeable...

Stuff in the background blows away the optical illusion.

In the illustrations above you can see some obvious Mach Bands at the intersection of the two luminance blobs that contribute to the creation of a frequency heat map.  The banding is reduced if viewed over a pattern that helps to break up the continuous nature of the radial gradient shift.  And, conveniently, when viewed over a some geographic context the banding pretty much disappears.

Since I don’t care an awful lot about frequency heat maps when they aren’t draped over a base map, I won’t stay up at nights worrying about phone calls regarding dark rings everywhere.  But if we do, there is a perfectly reasonable explanation: it's all in your head.

More on Context -it Matters

Here we have an image of the luminance score that goes into making a heat map.  You can see (or at least think you see) the Mach Bands pretty clearly.

When a color theme is applied to the luminance score and the heat map is generated, you can still totally see those Mach Bands -which is distracting and a real bummer.

But when viewed in an environment that provides some amount of background variance the Mach Bands for the most part die.  The reduction of the illusion is commensurate with the general business of the cartographic context.

The irregularity of the heat map can have a reducing effect as well.  More matrix-oriented heatmap inputs will tend to have more obvious Mach Bands.  When the input phenomena of a heat map are more organic and tend to clump or coagulate (as it is wont to do), the effect is diminished further.  So you can rest peacefully knowing that IDV is out there fretting to this extent over delivering the best possible visualization tools.

1 comment:

  1. There's a bigger problem with your use of a rainbow colour scheme - that causes artificially sharp edges with hue - i.e. you can see a quite sharp yellow band that may not actually be there. There's a discussion of the problem and some solutions at