digital image processing130.243.105.49/~lilien/dip/lectures/dip_2007_06.pdf · 2007. 3. 23. ·...
TRANSCRIPT
Digital Image Processing
Course IntroductionLecture 1
Digital Image ProcessingPart 6: Colour Image Processing
Achim J. Lilienthal
AASS Learning Systems Lab, Teknik
Room T1216
Course Book Chapter 6
Achim J. Lilienthal
Contents
1. Colour Fundamentals
2. Colour Models
3. Pseudo Color Processing
4. Colour Transformations
5. Smoothing and Sharpening of Colour Images
Achim J. Lilienthal
→ Contents
Colour Fundamentals
Achim J. Lilienthal
Colour Fundamentals1
Why Colour?colour is a powerful descriptor
humans can distinguish colours better than grey levels
Electromagnetic Spectrum
Achim J. Lilienthal
Colour Fundamentals1
Electromagnetic Spectrumvisible for humans: 390 – 790 nm
Achim J. Lilienthal
Colour Fundamentals1
The "Human Camera"rods and cones
mostly rods
onlycones
cone
rod
blind spotno receptors
Achim J. Lilienthal
Colour Fundamentals1
Reflection and Absorptionabsorption
some parts of the energy are absorbed by objects
reflectionreflected light: infra red, red, green, blue
tree water waterwith suspended material
Achim J. Lilienthal
Colour Fundamentals1
The "Human Camera"colours are seen as a combination of primary colours
detectorrods and cones
s( )λ r( )λ
Achim J. Lilienthal
Colour Fundamentals1
Reflection and Absorptionillumination
achromatic: white or uncoloured
chromatic: colour
monochromatic: only one wavelength (laser)
reflectionno colour we perceive consists of only one wavelength (closest is laser)
dominating wavelength gives the "colour tone" (hue)
equal amount of all wave lengths → grey
s( )λ
r( )λ
Achim J. Lilienthal
Colour Fundamentals1
The "Human Camera"colours are seen as a combination of primary colours
detectorrods and cones
s( )λ r( )λ
)(λb
)(λrred-sensitivegreen-sensitiveblue-sensitive
)(λgr(λ), g(λ), b(λ): how cones respond to light of different wave lengths
Achim J. Lilienthal
Colour Fundamentals1
575 nmThe "Human Camera" 535 nm445 nm
Achim J. Lilienthal
Colour Fundamentals1
Colour Characteristicsbrightness
perceived intensity (subjective)
hueassociated with the dominant wavelength
saturationrelative purity of a colour (inversely proportional to the amount of white light mixed in)
chromaticityhue and saturation taken together
Achim J. Lilienthal
→ Contents
Colour Models
Achim J. Lilienthal
Colour Models2
CIE Colour Space, 1931CIE = Commission Internationale de l´Eclairage
based on direct measurements of the human eye
associate each colour with a tristimulus x,y,zx,y,z: amount of primary colors ↔ wave length→ 3D space→ separate brightness and chromaticityspecifies the colourperceived by a standard observer (depends also on the light source)
Achim J. Lilienthal
Colour Models2
CIE Chromaticity (xy) Diagramprojection of the XYZ spacex+y+z=1shows all the chromaticitiesvisible to the average person(gamut of human vision)monochromatic colours (fully saturated) along the edge (spectral locus)less saturated in the "middle"CIE standard white: X=Y=Z(point of equal energy)
Achim J. Lilienthal
Colour Models2
CIE Chromaticity (xy) Diagrameach connection between two points defines colours obtained by additive mixture of these coloursimpossible to produce all colours by mixing three fixed colours:triangle cannot enclose the entire colour regioncolour gamut of RGB monitorsis defined by a triangle
Gamut of the CIE RGB primaries and location on the CIE 1931 xy chromaticity diagram
Achim J. Lilienthal
Colour Models2
Primary Coloursprimary colours of light (emitting sources)
Red, Green, Blue
color monitors
additive mixing green
bluered
yellow cyan
magenta
Achim J. Lilienthal
Colour Models2
Secondary Coloursprimary colours of pigments (reflecting sources)
CMY: Cyan, Yellow, Magenta
printers: CMYK (+ blacK)
subtractive mixinggreen
blue
red
yellow
cyanmagenta
Achim J. Lilienthal
Colour Models2
RGBhardware oriented (monitor)
range [0,1] for each primary colour of light
RGB image = three grey-level images
24 Bits: 16.7 million colours(~350000 we can distinguish)
RGB in three corners
black, white and CMY in the other corners
grey along the diagonal
Achim J. Lilienthal
Colour Models2
safe RGB Colourslikely to be reproduced faithfully independent of the viewer hardware
216 combinations of 0, 51, 102, 153, 204, or 255
safe RGB color cube
Achim J. Lilienthal
Colour Models2
CMY/CMYKhardware oriented (colour printing)
pigment primary colours = secondary colors of light
example: surface with cyan pigment illuminated by white light → no red light is reflected
K (black) added for printing
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡−
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
BGR
YMC
111
Achim J. Lilienthal
Colour Models2
HSIHue, Saturation, Intensity
suitable for description and interpretation
separates intensity and hue
resembles human vision
difficult to display directly (transformation to RGB necessary)
! singularities (hue is undefined if the saturation is zero)
Achim J. Lilienthal
Colour Models2
RGB to HSI
( ) ( )[ ]
( ) ( )( )⎪⎭
⎪⎬
⎫
⎪⎩
⎪⎨
⎧
−−+−
−+−= −
BGBRGR
BRGR
2
1 21
cosθ⎩⎨⎧
>−≤
=GBGB
H if360 if
θθ
( ) ( )[ ]BGRBGR
S ,,min31++
−=
( )BGRI ++=31
Achim J. Lilienthal
Colour Models2
HSI to RGBRG sector
GB sector
BR sector
( )SIB −= 1⎥⎦
⎤⎢⎣
⎡−
+=)60cos(
cos1HHSIR
o ( )BRIG +−= 3
oo 1200 <≤ H
oo 240120 <≤ H
)1( SIR −= ⎥⎦
⎤⎢⎣
⎡−−
+=)180cos()120cos(1
HHSIG
o
o
( )GRIB +−= 3
oo 360240 <≤ H
( )BGIR +−= 3 ( )SIG −= 1 ⎥⎦
⎤⎢⎣
⎡−
−+=
)300cos()240cos(1
HHSIB
o
o
Achim J. Lilienthal
→ Contents
Pseudocolor Image Processing
Achim J. Lilienthal
Pseudocolor Image Processing3
Why Pseudo Colours?humans can distinguish colours better than grey levels
~ 30 grey levels versus ~ 350 000 different colours
display grey level as colour image → easier inspection
the amount of information is not changed!
Achim J. Lilienthal
Pseudocolor Image Processing3
Two Colour Intensity Slicingimage is interpreted as 3D function (x,y,intensity)
assign different colours to each side of the plane
two-color image
color1
color2
Achim J. Lilienthal
Pseudocolor Image Processing3
Example – Lake Mälardalen (1997)
chlorophyll suspended material dissolved organic
Achim J. Lilienthal
Pseudocolor Image Processing3
More General Intensity Slicing3 independent transformations
R = fR(x,y), G = fG(x,y), B = fB(x,y)
fR, fG and fB not necessarily piecewise linear
example: X-ray scanning systems at airportssinusoidal transform functions
Achim J. Lilienthal
Pseudocolor Image Processing3
More General Intensity Slicingcombine several monochrome images
example: multispectral imagemonochrome images from different spectral bands
Achim J. Lilienthal
→ Contents
Colour Transformations
Achim J. Lilienthal
Colour Transformations4
Representationeach pixel interpreted as a vector (r1, ..., rn)
Formulationgeneral vector-based processing
si = Ti (r1, ..., rn)
per-colour-component transformationsi = Ti (ri)
per-colour-component process = vector-based process
• if process is applicable to vectors and scalars ...
• ... and operation is independent of the other components
in
out
in
out
in
out
Achim J. Lilienthal
Colour Transformations4
Representationeach pixel interpreted as a vector (r1, ..., rn)
Achim J. Lilienthal
Colour Transformations4
Representationeach pixel interpreted as a vector (r1, ..., rn)
Achim J. Lilienthal
Colour Transformations4
Intensity Adjustmentg(x,y)=kf(x,y)+m
HSI: s3=k⋅r3
RGB: si=k⋅ri
CMY: si=k⋅ri+(1-k)
! remember to take into account the cost of conversion
contrast
brightness
Achim J. Lilienthal
Colour Transformations4
Colour Complementhues opposite one another (colour negatives)
enhancing details in dark regions
RGB: si = Ti (ri)
HSI: si ≠ Ti (ri)
Achim J. Lilienthal
Colour Transformations4
Colour Slicingto highlight a specific range of coloursto define a mask for further processinghow to define the range of interest ?
hypercube/sphere (centered at a prototypical colour)multiple colour prototypes (ranges of interest)
Achim J. Lilienthal
Colour Transformations4
Tonal Transformationsadjust the brightness and contrast in the image
colours are not changed
tonal transformations normally are selected interactively
Colour Correctionscorrections normally are selected interactively
visual assessment of suitable regionswhite areas (RGB/CMY components should be equal)
skin tones (humans are highly perceptive of skin tones)
! perception of colour is affected by surrounding colours
Achim J. Lilienthal
Colour Transformations4
Tonal Transformationsadjust the brightness and contrast in the image
colours are not changed
tonal transformations normally are selected interactively
colour histogram equalization ?
Colour Correctionscorrections normally are selected interactively
visual assessment of suitable regionswhite areas (RGB/CMY components should be equal)
skin tones (humans are highly perceptive of skin tones)
Achim J. Lilienthal
Colour Transformations4
Histogram Equalisation (HE)how to generalise grey level HE to colour HE?
use HE for intensity in HSI
! applying HE to the colour components independently is not a good idea
original
Achim J. Lilienthal
Colour Transformations4image enhancement by histogram equalization
component by component:hue is not preserved...
Achim J. Lilienthal
Colour Transformations4
Histogram Equalisation (HE)how to generalise grey level HE to colour HE?
use HE for intensity in HSI
! hue is not preserved when applying HE to the colour components independently
histogram equalised I
Achim J. Lilienthal
→ Contents
Smoothing and Sharpeningof Colour Images
Achim J. Lilienthal
Smoothing and Sharpening of Colour Images5
Smoothing (RGB)mean filtering in RGB(neighbourhood: Sxy)
neighbourhood averaging can be done on a per-colour base
( )
( )( )
( )( )
( )( )
⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
∑
∑
∑
∈
∈
∈
xy
xy
xy
Syx
Syx
Syx
yxBK
yxGK
yxRK
yx
,
,
,
,1
,1
,1
,c
RGB: mean 5x5 for R,G,B
Achim J. Lilienthal
Smoothing and Sharpening of Colour Images5
Smoothing (HSI)filter intensity channel only
not identical to RGB smoothing since the average of two colours is a mixture of them (neither of the original colours)
difference
HSI: mean 5x5 for I
Achim J. Lilienthal
Smoothing and Sharpening of Colour Images5
Sharpening (HSI)Laplacian applied to I only
( )[ ]( )( )( )⎥
⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
∇∇∇
=∇yxByxGyxR
yx,,,
,2
2
2
2 c
RGB: Laplacian 5x5 for R,G,B
Achim J. Lilienthal
Smoothing and Sharpening of Colour Images5
Sharpening (RGB)Laplacian can be calculated on a per-colour base
difference
HSI: Laplacian 5x5 for I