Colorblindness and Image Processing*

*More broad than GPUs, despite original title advertisted, applicable to any kind of image processing

Three topics:

  • Why some people are colorblind
    • physical causes, neurology, etc.
  • What colorblind people perceive
    • color theory
  • What can we do
    • linear algebra, math-y bits

 

Skipping code!

Photoreceptors

  • Eyes have two kinds of photoreceptors, rods and cones
  • Cones are what we care about! (We can ignore rods for this topic)
    • Cones are sensitive to different wavelengths of light that differentiate color

Cones

  • Three major types of cones:
    • Cones sensitive to short wavelengths (blue)
    • Cones sensitive to medium wavelengths (green)
    • Cones sensitive to long wavelengths (red)

Colorblindness

  • Color-impaired vision is the result of one type of cone malfunctioning
    • Causes can be either genetic or just physical damage sustained in the course of someone's life
  • The technical terms are based on which kind of cone is malfunctioning:
    • protanopia for Long/Red
    • deuteranoipa for Medium/Green
    • tritanopia for Short/Blue
      • terms are for dichromacy, two working sets and one malfunctioning set

What Colorblind People Perceieve

  • Protanopia and deuteranopia both get called "red-green" colorblindness
    • Wavelengths close
    • Though deuteranopia is the most common, it's the male pattern genetic colorblindness
  • Tritanopia is "blue-yellow" colorblindness

Testing Vision

  • Early tests made by Dr. Shinobu Ishihara, known as Ishihara Plates
    • Dots clustered together, forming numbers or letters or shapes with color contrast
  • Top plate is a "control" plate visible to even people with colorblindness
    • Everyone should see "12"
  • Bottom plate indistinguishable to people with at least deuteranopia, possibly also protanopia
    • ... can someone tell me?

Color Theories and Spaces

  • Trichromatic Theory covers physical view
    • Color composed of three components
      • standard RGB space
      • LMS (description of wavelengths) space
      • CIE XYZ space
  • Opponent Theory covers perception
    • Opposing colors on opposite axes
      • Light/intensity axis
      • Red/Green axis
      • Blue/Yellow axis
        • CIE Lab space

Image Processing

Okay that's cool and all, but we're smart, what can we actually do?

 

  • In image processing, or anything that's a collection of pixels, we can add filters:
    • Simulate colorblind vision
    • Adjust images to 'fix' colorblind vision
    • Both at once!

Math!

  • I find it easiest to think about color geometrically
    • Web colors like #FFFFFF to describe white or #FF0000 to describe red are examples of a color space called standard RGB, or sRGB
    • Think of it like a 3-dimensional space

More Color Spaces

  • Opponent theory
    • CIE Lab space
    • Visualization of colorblindness

Color Space Transforms

Got a good handle on the concept of color spaces?

 

  • Transformations exist to convert from one color space to another
    • That probably sounds more complicated than it is
    • To convert from sRGB space to LMS space (or between spaces in general), just multiply
      • Getting what you need to multiply by is the trickier part, but in practice, it really is just multiplying

Simulating Colorblindness

http://vision.psychol.cam.ac.uk/jdmollon/papers/Dichromatsimulation.pdf

  • Above paper explains math on simulating colorblind vision
  • Basic gist:
    • ​Given a pixel in sRGB,
    • Transform into LMS space
    • Cancel out a cone type's contribution based on desired simulation
      • Protanopia: Cancel out L
      • Deuteranopia: Cancel out M
      • Tritanopia: Cancel out S
    • Transform back into sRGB space for final output pixel

Simulated

Correcting for Colorblind Vision

We can go a step further!

  • Colorblind people have a smaller range of color
  • We can stretch out that range
  • For an input pixel,
    • Simulate colorblindness, get simulated pixel in sRGB (as prior)
    • Subtract: original pixel - simulated pixel = offset
    • Multiply offset by error correction matrix*, multiply by input pixel of choice (original or simulated), get new corrected output pixel

Simulated + Corrected

Colorblindness and Image Processing

By tdhoward

Colorblindness and Image Processing

  • 660