程序代写代做代考 PowerPoint Presentation

PowerPoint Presentation

8. Colour & Perception

Dr. Hamish Carr

COMP 5812M: Foundations of Modelling & Rendering
Terminology
Light is a physical phenomenon
Photons of varying wavelength
A spectral distribution
Colour is a perceptual phenomenon
How the human eye interprets it
Based on the rods and cones in the eye
What you learned in school is simplified

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Types of Light Source
Sunlight (aka white light)
Black-body radiation at c. 6000℃
Incandescent Bulb (Tungsten)
Black-body radiation at c. 2500℃
Fluorescent Lamp (Mercury)
Stimulated emission with phosphorescence
LED
Direct stimulated emission

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering

Spectral Distribution
“White” light

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
A Fluorescent Lamp
Note the spikes (impulses)
Phosphors chosen so that result looks white
i.e. perceptually close to sunlight

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
LED Lights
LEDs are light-emitting diodes
Close to mono-spectral
i.e. output only one wavelength

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
The Retina
A patchwork of light-sensitive cells
Rods: low light conditions (B/W)
Cones: ordinary conditions (colour)

Cones
Rods

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Photopic & Scotopic Vision
Photopic vision uses the cones
Scotopic (night) vision uses the rods
And their efficiency is different
Scotopic vision has trouble with red

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Cones & Colour
Three types of cones
Respond to different wavelengths
Integrate over a range of wavelengths

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Luminous Efficiency
The eye works best with greenish light
Other wavelengths fall off in response
So blue cones are overall weak

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Luminance
Perceived brightness
Integrate total energy over all wavelengths

Notice we’ve now included human response
So this is based on perceptual studies
Averages over a population

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Tri-stimulus Theory
Mix R, G & B to get any colour desired
Human can’t tell the difference
But you need negative red light to do it

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Adaptation
The eyes use slow chemical reactions
But they adapt to the light level
So their response is (mostly) logarithmic
But too much light washes an image out
Even in the areas where it’s dark

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Just Noticeable Difference
Humans can just spot a 1% difference
at least in the range that displays use
So we need about 100 logarithmic levels
And 256 values is enough most of the time
Hence our 8-bit RGB values
But they’re not uniform
So we use gamma correction

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Radiance to Pixel Value
OpenGL/PPM use a simple model:
0-255 / 0.0 – 1.0 in each colour channel
Human vision isn’t like this
We see a wide range of intensity
Closer to 0.0 – 1,000,000
But it’s logarithmic in nature
And we have to adjust for it

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Gamma encoding
Assume we have
radiance r
min & max possible r
Δr = (max – min) / 1.0
Then we compute

With γ = 2.2 (to match the human eye)

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Gamma Examples
(subject to monitor gamma, &c.)
Compute in float
Use gamma to convert to integers

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Colour Blindness
About 8-10% of men, 1% of women
Most common is red-green
only one cone for both red & green
Yellow-blue also occurs
And some people only have one type of cone
Remember to design for colour blindness
NEVER rely only on colour

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering

Black
Green
RGB Colour Cube
Yellow
Red
Magenta
Blue
Cyan

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
XYZ Colour Space
By the CIE (Commission Internationale d’Eclairage)
Every visible colour uses positive coords

Visible
Colours
RGB
Cube

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
RGB to XYZ

Just a matrix transformation
Converts between different colour systems

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
CIE Chromaticity Diagram
Project colour space to plane X + Y + Z = 1
Pure colours appear along the edge

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
sRGB Gamut
Set of colours possible with standard RGB (sRGB)
Convex hull of positions on the diagram
Each device has a gamut
Used to calibrate colour perception
Still a major problem

X
Y
Z

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
YUV Colour Space
Early TV was a monochrome signal
Measured total intensity Y of light
Axis from black to white
Colour TV is backward compatible
Y component is still transmitted
Components U,V were added

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
HSV Colour Space
The colour wheel
H – hue
S – saturation
V – value
(or B – brightness)

Hue
(angle)

Saturation
(radius)

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Choosing Colours
How do we get “yellow”?
start with the rainbow: R O Y G B I V
mix R & G to get Y
Or look at the colour wheel
Or just play with RGB until we get it right

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Additive Colour
These models assume light is added
Colour is the sum of components
Suitable for combining light sources
But this isn’t the only way of doing it
Go back to the physics again

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Colour Absorption
Objects are coloured by pigments
that absorb certain colours of light
E.g. chlorophyll in leaves
absorbs almost all red / blue light
but reflects green light
so output light is green

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Subtractive Colour
For pigments, we subtract colour
Blue + Yellow = Green
blue reflects some green as well
so does yellow
green is only colour reflected by both
We learned this colour model in school

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
CMYK model
Printers use CMYK
Cyan removes red
Magenta removes green
Yellow removes blue
Black removes everything

Cyan
Magenta
Blue
Red
Yellow
Green
White

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Tone Perception
Cones don’t act separately
Retina combines signals from cones
Perception is affected by context
Which set of squares is lighter?

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Simultaneous Contrast
Tone perception also occurs in colour
Which greys are the same here?

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering
Colour Interpolation
Interpolating nearby colours works well
Interpolating distant colours usually fails
So films are starting to add wavelengths
Known as spectral rendering
Will we end up with ROYGBIV devices?
Time will tell
In the meantime, assume RGB

COMP 5812M: Foundations of Modelling & Rendering

COMP 5812M: Foundations of Modelling & Rendering

weight[1] = ~s · ~q/a
weight[2] = direction(R) · ~r/a
weight[0] = 1� weight[1]� weight[2]
r

0
=


(r ⇤�r)1/�


⇤ 255.0

2