Digital Image Processing: Some Special Techniques
Digital Image Processing: Some Special Techniques
Digital Image Processing: Some Special Techniques
01/29/16
Dithering
Dithering, also called Halftoning or Color
Reduction, is the process of rendering an
image on a display device with fewer colors
than are in the image. (Mateus Pins and
Hermann Hild)
The number of different colors in an image or
on a device is used called its Color Resolution.
01/29/16
Dithering
If the display device has a higher spatial resolution
than the image that you are trying to reproduce, it can
show a very good image even if its color resolution is
less. This is what we will call 'dithering' and is the
subject of this work.
Dithering is a one-way operation.
Once an image has been dithered, although it may look like
a good reproduction of the original, information is
permanently lost.
Many image processing functions fail on dithered images.
01/29/16
Dithering
01/29/16
Dithering
Grey-scale and colour simulation
Dithering on a screen or printer is analogous
to the half-toning techniques used in the print
industry.
A CRT can be considered to be a complex
colour dithering device with variable colour
intensity.
01/29/16
Dithering
Grey-scale and colour simulation
We need to display colour and grey-scale
images on output devices that have a lower
information-carrying capacity.
Cheap printers are bi-level or CMYK - clearly
we need to add colours/intensities to
approximate an image.
01/29/16
Dithering Methods
(Digital Halftoning)
Threshold dithering
ordered dither
stochastic dither
dot diffusion
....
01/29/16
Error diffusion
dithering
Floyd-Steinberg
Burkes
Stucki
Sierra
Jarvis, Judice and Ninke
Stevenson and Arce
Color printing
every
10
01/29/16
11
01/29/16
12
Threshold Dithering
every pixel is compared to a threshold t:
pt a
p>t b
t can be:
equal
01/29/16
13
threshold values
result
14
Principle of Dithering
Available values a, b
Missing value x between a and b shall
besimulated by mixing a-pixels and b-pixels
01/29/16
15
Principle of Dithering
01/29/16
16
17
01/29/16
18
Threshold Matrix
Distances between interval borders are equal,
therefore it suffices to define the sequence of the
pixel values in the matrix:
instead of
only
19
threshold matrix
20
threshold values
result
01/29/16
21
01/29/16
22
23
24
01/29/16
25
01/29/16
26
Stochastic Dithering?
Use of random numbers as threshold
values
expectation
27
28
29
Floyd-Steinberg
Distribution Weighting
Current
scan line of
image
Next scan
line of
image
01/29/16
Current 3/8
Pixel
error
3/8
error
1/4
error
30
Dithering
Some drawbacks
A dithered image is an image with less information in
it than the original.
Resolution and apparent colour content are a tradeoff, particularly with thermal wax transfer printers etc.
Accurate conversion between original images and
dithered images is generally one-way.
Some dithering methods cause ugly banding on some
images. Careful choice of dithering methods can
minimise this problem.
01/29/16
31
01/29/16
32
threshold values
result
33
Serpentine Method
Artificial stripes can be reduced drastically
byprocessing the scanlines in serpentine order
34
Colour Systems
Colour in the environment
Diffuse reflection of white light gives an object
its colour.
Perception of colour is, therefore, dependent
upon lighting.
Specular reflection has the colour content of
the light source - what is the colour of a mirror?
Colour is an everyday experience.
01/29/16
35
Colour Systems
Colour in the environment
Colour can be measured in terms of the
frequency or wavelength of electromagnetic
radiation (light).
Some light sources have a narrow band of
frequencies, eg lasers, but this is rare.
Incandescent lighting has a broad range of
frequencies.
Sodium lamps have two bright frequencies.
01/29/16
36
Colour Systems
Measuring Colour
Violet
400
Yellow
580 600
Orange
Red
650
700
720
37
Colour Systems
Colour Matching
The eye cannot discern between a colour made
of a single wavelength and a visually identical
colour made of a mixture of wavelengths.
This allows monitors (RGB) and magazines
(CMYK) to show the same pictures.
The eye is very sensitive to colour and can
distinguish between approximately 300 000
different shades of colour.
01/29/16
38
Colour Systems
Colour Matching
For practical purposes, the physical description of colour is abandoned in favour of a more
natural way of describing what we see.
Any colour shade can be matched by mixing
three monochromatic primary colours, by
definition.
Colour matching is an important problem for
commercial users of print and video.
01/29/16
39
Colour Systems
Primary Colours
In the real world we do not have pure, singlewavelength colour sources to add - this means
that some colour shades are impossible to
match.
A way of specifying colours in a sensible way
was developed by the CIE (Comission
Internationale de LEclairage) in 1931.
The CIE chromaticity diagram is widely used.
01/29/16
40
Colour Systems
The CIE Chromaticity Diagram
Green
Yellow
Cyan
White
Blue
01/29/16
Red
Magenta
41
Colour Systems
The RGB colour cube
A system with three
independent variables
can be represented by a
three-dimensional
position.
The RGB colour cube
represents all of the
colours that an RGB
monitor can create, in a
non-normalized form.
01/29/16
Yellow
Green
Cyan
White
(Greys)
Black
Blue
Red
Magenta
42
Colour Systems
The RGB colour cube
A system with three
independent variables
can be represented by a Cyan
three-dimensional
position.
The RGB colour cube
represents all of the
Blue
colours that an RGB
monitor can create, in a
non-normalized form.
01/29/16
Green
Yellow
White
Red
Magenta
43
Colour Systems
The HSV model
Hue, Saturation, Value is a
more intuitive model.
Value is brightness,
constant value hexagons
lie parallel to the top
surface.
Grey shades run up the
vertical axis, black at the
bottom and white at the
top.
01/29/16
V=1
Magenta 300
Blue 240
Red 0
V=0
44
Colour Systems
The HLS model
The Hue, Lightness, Saturation
L=1
model was developed by
Tektronix.
HLS is similar to HSV but with a Green 120
double cone.
Yellow 180
This and other models are
Red 240
combinations of the CIE, RGB
and HSV models.
Translations are always possible.
01/29/16
Cyan 60
Blue 0
Magenta 300
L=0
45
References
http://www.efg2.com/Lab/Library/
ImageProcessing /DHALF.TXT - dither.txt
everything you ever wanted to know about
dithering!
Computer Graphics, (C version) by D. Hearn and
P. Baker:
Section
46
01/29/16
47
Thinning
im bin
im bn trong
48
Thinning
01/29/16
49
Thinning
Thinning phi tha cc tnh cht c bn sau:
i
01/29/16
50
T tng c bn:
01/29/16
51
Quy tc 1
01/29/16
52
Quy tc 2:
Pixel p c xa nu ch s m (counting
index hay crossing index - CI) ca n bng 1.
nh ngha: Ch s m l s ng r t pixel
ang xt.
01/29/16
53
1
p
01/29/16
CI=1
1
p
CI=0
CI=2
CI=2
CI=3
1
1
p
1
CI=4
54
Quy tc 3:
5
01/29/16
55
Quy tc 4:
5
01/29/16
56