0% found this document useful (0 votes)
19 views38 pages

07 Colour

Uploaded by

pantkizip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views38 pages

07 Colour

Uploaded by

pantkizip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COL7(6)83: Digital Image Analysis

7. Colour Image
Processing
What is colour?
Light intensity is not a scalar
but depends on wavelength:
spectral power distribution

Eye has 3 types of cone cells

• Long, medium, short (LMS)


• Brain receives only cone responses

Spectral distributions that produce same


LMS response (“metamers”) are
indistinguishable to human visual system

Note: Perceived colour is not determined


by LMS response alone! The brain does
a lot more complex processing…
R = 0.95
G = 0.72
B = 0.71

R = 0.39
G = 0.38
B = 0.38
R = 0.92
G = 0.82
B = 0.89
Any* colour sensation in the eye can be
reproduced by a linear combination of 3
coloured lights (primaries)

l l l l

[s]
1 2 3
m = X m1 + Y m2 + Z m3
s1 s2 s3 Wright-Guild colour matching experiments

Intensities of primaries = tristimulus values X, Y, Z (could be negative for very intense colours!)
• Luminance: total intensity received by human eye
• Brightness: subjective perception of luminance
• Chromaticity: quality of colour independent of
intensity

Trichromatic coef cients:


X Y Z
x= y= z=
X+Y+Z X+Y+Z X+Y+Z
Note x + y + z = 1
fi
Chromaticity diagram
Colour blindness
Reduced or no functionality in one
(or more) of the three types of cones

→ Don’t rely only on colour to


convey information!

Normal vision Deuteranopia Tritanopia


Colour models
• Colour model: abstract coordinate system for describing colours as tuples of numbers
• Colour space: colour model + speci c mapping to absolute colorimetric quantities

Example:

• RGB colour model:


Create colours by adding X% red, Y% green, Z% blue

• sRGB colour space:


Chromaticities of red/green/blue primaries,
screen and ambient luminance levels,
gamma transformation function, …

Set of representable colours = gamut


fi
RGB colour model
Additive model: colour is formed by
superposition of red, green, blue lights

Grayscale = equal intensity in R, G, B

Typically 8 bits per channel:


“24-bit colour”

RGB image = 2D array of vectors

= vector of 2D arrays
Blue

Green

Red
CMY(K) colour model
Subtractive model: colour is formed by removing
light of different wavelengths, e.g. printer inks

Primaries: cyan (absorbs red), magenta


(absorbs green), yellow (absorbs blue)

Absorption is nonlinear!
Approximate conversion from RGB:

C=1−R M=1−G Y=1−B

In practice, absorption is imperfect: C = M = Y = 1 doesn’t give pure black


Include black K = min(C, M, Y) and compensate the rest, C ← (C − K)/(1 − K) etc.
Hue and saturation

Colours with different hues

Brightness

Colour = intensity/brightness & chromaticity

Saturation Chromaticity = hue & saturation

Different colours
with the same hue
Colour cube, constant-hue slice

Constant-hue slices
Various polar coordinate systems for colour:
HSL (hue, saturation, lightness), HSV (value), HSI (intensity)

We will only consider HSI

• Intensity I = (R + G + B)/3
• Hue H = angle around intensity axis
• Saturation S ≈ relative distance from intensity axis

H, S depend only on relative proportions R/(R + G + B), etc.

Warning: H changes discontinuously at red (0° 360°)


Device-independent colour spaces
CIE XYZ

• De ned based on data from Wright-Guild colour matching


experiments

CIELAB (L*a*b*)

• More perceptually uniform: distances in L*a*b* coordinates are


proportional to perceived changes in colour
1.0

sRGB 0.8

0.6

sRGB
• Standard colour space for images on the web 0.4

0.2

• Speci es gamma transformation: R ≈ Rlinear1/2.2, etc. 0.0


0.0 0.2 0.4 0.6 0.8 1.0
Linear
fi
fi
Processing colour images
Human viewers can distinguish thousands of colours but only tens of gray levels

Pseudocolour image processing: map pixel values of non-colour images (intensity /


multispectral) to colour values for visualization

For intensity images (1 channel):

• Piecewise constant: highlight known intensity range(s) of interest


• Continuous function (e.g. linear interpolation): colormap

For multispectral images (>3 channels):

• Assign R, G, B to one component each (or linear combination of input components)


Saturated pixels highlighted
Infrared Red Green Blue

True colour Pseudocolour


(R, G, B) (IR, G, B)
Processing full-colour images
Simplest approach: per-component
transformations si = Ti(ri)

Example: scaling intensities

si = kri

Example: negative of a colour image

si = 1 − ri

Maps each colour to its complementary


colour (180° across in hue)
Chromaticity can be affected even if transformation is monotonically increasing!

R = 0.97 R = 0.90 R = 0.73


G = 0.79 G = 0.50 G = 0.13
B = 0.46 B = 0.10 B = 0.00

γ = 1/3 γ=1 γ=3


Tone and colour corrections
Tone correction: adjust brightness and contrast (analogous to intensity transformations
of grayscale images)

• Same transformation to all RGB components


• Or, transformation only to I component of HSI

Colour correction: adjust chromaticity (relative ratios of components)


Photo under warm light Gamma transformation with different γR, γG, γB
S × 0.5 Original S × 1.5
Histogram processing of colour images

0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250

Process each component’s histogram independently…

…or convert to HSI and process only histogram of I component?


Histogram equalization
on R, G, B components
Histogram equalization
on I component of HSI
Histogram equalization
on I component of HSI,
then S component scaled by 3
Spatial filtering
Linear spatial lters are equivalent in vector form or per-component:


g(x, y) = w(s, t) f(x − s, y − t)
s,t

g1(x, y) ∑s,t w(s, t) f1(x − s, y − t)


g2(x, y) = ∑s,t w(s, t) f2(x − s, y − t)
g3(x, y) ∑s,t w(s, t) f3(x − s, y − t)

Not true for nonlinear lters e.g. median, bilateral


fi
fi
Original Gaussian lter
fi
Original Excessive high-boost ltering
→ colour halos
fi
Homework
1. Read DIP Ch. 6.1–6.6

2.

You might also like