color & light, digitalization, storage. vision rods work at low light levels and do not see...
TRANSCRIPT
Color & Light, Digitalization, Storage
Vision
• Rods work at low light levels and do not see color– That is, their response depends only on how many photons, not
their wavelength• Cones come in three types (experimentally and genetically proven),
each responds in a different way to frequency distributions
Color receptors
• Each cone type has a different sensitivity curve– Experimentally determined
in a variety of ways• For instance, the L-cone
responds most strongly to red light
• “Response” in your eye means nerve cell firings
• How you interpret those firings is not so simple
Trichromacy means…
400 500 600 700
400 500 600 700
Spectrum
3 Primaries
Color Matching:People think these two spectra look
the same (metamers or monomers)
Representing color:If you want people to “see” the continuous spectrum, you can just show the three
primaries
The RGB Color Matching Functions
Normal Daylight#
Pho
tons
Wavelength (nm)400 500 600 700
• Note the hump at short wavelengths - the sky is blue• Other bumps came from solar emission spectra and
atmospheric adsorption
Tungsten Lightbulb
• Most light sources are not anywhere near white• It is a major research effort to develop light sources
with particular properties
# P
hoto
ns
Wavelength (nm)400 500 600 700
Red Paint
• Red paint absorbs green and blue wavelengths, and reflects red wavelengths, resulting in you seeing a red appearance
# P
hoto
ns
Wavelength (nm)400 500 600 700
Digital Images• Computers work with discrete pieces of information• How do we digitize a continuous image?
– Break the continuous space into small areas, pixels– Use a single value for each pixel - the pixel value (no color, yet)– No longer continuous in space or intensity
• This process is fraught with danger, as we shall see
Continuous
Discrete
Pixels: Picture Elements
Perceptual Issues
• Humans can discriminate about ½ a minute of arc– At fovea, so only in center of view, 20/20 vision– At 1m, about 0.2mm (“Dot Pitch” of monitors)– Limits the required number of pixels
• Humans can discriminate about 8 bits of intensity– “Just Noticeable Difference” experiments– Limits the required depth for typical dynamic ranges– Actually, it’s 9 bits, but 8 is far more convenient
• BUT, while perception can guide resolution requirements for display, when manipulating images much higher resolution may be required
129 128 125
Dynamic Range
• Image depth refers to the number of bits available, but not how those bits map onto intensities
• We can use those bits to represent a large range at low resolution, or a small range at high resolution
• Common display devices can only show a limited dynamic range, so typically we fix the range at that of the display device and choose high resolution
All possibleintensities
Low
ran
ge, h
igh
res
Hig
h ra
nge,
low
res
Color Perception
• How your brain interprets nerve impulses from your cones is an open area of study, and deeply mysterious
• Colors may be perceived differently:– Affected by other nearby colors– Affected by adaptation to previous views– Affected by “state of mind”
• Experiment:– Subject views a colored surface through a hole in a sheet, so
that the color looks like a film in space– Investigator controls for nearby colors, and state of mind
The Same Color?
The Same Color?
Going from RGB to XYZ
• These are linear color spaces, related by a linear transformation
• Match each primary, for example:
• Substitute and equate terms:
bBgGrRzZyYxXE
ZzYyXxR rrr
b
g
r
zzz
yyy
xxx
z
y
x
bgr
bgr
bgr
Standard RGB↔XYZ
b
g
r
z
y
x
9505.01192.00193.0
0721.07151.02126.0
1805.03576.04124.0
z
y
x
b
g
r
0570.12040.00556.0
0416.08760.19692.0
4986.05374.12410.3
• Note that each matrix is the inverse of the other• Recall, Y encodes brightness, so the matrix tells us how to go from
RGB to grey
Gamuts
• Gamut: The range of colors that can be represented or reproduced
• Plot the matching coordinates for each primary. eg R, G, B
• Region contained in triangle (3 primaries) is gamut
• Really, it’s a 3D thing, with the color cube distorted and embedded in the XYZ gamut
x
y XYZ Gamut
RGB GamutG
R
B
The Simplest File
class Image {unsigned int width;unsigned int height;unsigned char *data;
}
3r,g,b
0r
0r,g,b 1r,g,b 2r,g,b
4r,g,b 5r,g,b
8r,g,b7r,g,b6r,g,b
0g 0b 1g1r 1b 2r 2g 2b 3r 3g
Indexed Color
Color Table0
1
2
3
4
5
6
7
4 3 0 2
1 7 4 5
3 7 6 5
2 2 1 1
Pixel Data Image