Professional Documents
Culture Documents
014DigitalImageEn
014DigitalImageEn
Václav Hlaváč
region.
Image function f (x, y).
Distance transformation.
Image digitization:
sampling + quantization.
histogram, brightness, contrast,
Distance in the image, neighborhood. sharpness.
Image
2/50
(str
aigh
t lin
e) r
ay
pinhole
three-dimensional
scene image p
lane
Filippo Brunelleschi created a perspective drawing to show his customers how the
Church of Santo Spirito in Florence would look like.
X=[x,y,z]T
Y
u=[u,v]T X
y
x v
u
Z
-u -v
f f
reflected
image plane image plane
or captured by a TV camera.
Let us assume a gray level image for simplicity.
The continuous image function f (x, y). Later, after digitization, a matrix of
The Virgin Mary mosaic from 15,000 Easter Eggs by the Ukrainian artist Oksana
Mas from 2009. The mosaic was exhibited in the St. Sophia cathedral in Kiev
(11th century), where V. Hlaváč took the picture in summer 2010.
Motivation - the voxel of a Lego block shape
9/50
also intensity).
• Sampling selects samples from the continuous image function. The
output is a finite number of are arranged in a discrete raster. The
sample value is “continuous”, i.e. a real number.
• Quantizing divides a real value of the sample into a finite number of
values (also bins). It can be 256 gray-level values for gray-scale image.
(a) (b)
8 f(4,5)
7
6
5
8
y 4 7
3 6
5
2 4
1 3 7 8
2 5 6
4
1 2 3 4 5 6 7 8 y 1
1 2 3
x x
Example of a digital image
a single slice from a X-ray tomograph 13/50
First image scanner, 1957
14/50
R. Kirsch, SEAC and the start of image processing at the National Bureau of
Standards. In: Annals of the history of computing, IEEE, vol. 20 (1998), p 7-13.
Image sampling, example 1
15/50
Euclidean distance
p
DE ((x, y), (h, k)) = (x − h)2 + (y − k)2 .
0 1 2 3 4
0 DE
1 D4
2 D8
4-, 8-, and 6-neighborhoods
24/50
A set consisting of the pixel itself (shown in the middle as a hollow circle, called a
representative pixel or a representative point) and its neighbors of distance 1
shown as filled in black circles.
black ∼ objects
white ∼ background
contiguous pixels.
Region = contiguous set
27/50
The relation ‘x is contiguous to y’ is
• reflexive, x ∼ x,
• symmetric x ∼ y =⇒ y ∼ x and
• transitive (x ∼ y) & (y ∼ z)
=⇒ x ∼ z. Thus it is an equivalence relation.
Any equivalence relation decomposes a set into subsets called classes of
The Region boundary (also border) R is the set of pixels is the set of pixels
boundary.
In a digital image, the boundary has always a finite width. Consequently, it is
Convex set = any two points of it can be connected by a straight line which lies
inside the set.
convex non-convex
the nearest non-zero pixel (one of objects) in the input image. DT assigns
values of 0 to pixels belonging to foreground (objects)
0 0 0 0 0 0 1 0 5 4 4 3 2 1 0 1
0 0 0 0 0 1 0 0 4 3 3 2 1 0 1 2
0 0 0 0 0 1 0 0 3 2 2 2 1 0 1 2
0 0 0 0 0 1 0 0 2 1 1 2 1 0 1 2
0 1 1 0 0 0 1 0 1 0 0 1 2 1 0 1
0 1 0 0 0 0 0 1 1 0 1 2 3 2 1 0
0 1 0 0 0 0 0 0 1 0 1 2 3 3 2 1
0 1 0 0 0 0 0 0 1 0 1 2 3 4 3 2
input image DT result
Distance transform algorithm informally
31/50
The first pass starts from top-left corner of the image and moves row-wise
horizontally left to right. The second pass goes from the bottom-right corner
in the opposite bottom-up manner, right to left.
Top-down Bottom-up
AL AL AL BR
AL p AL p p BR p BR
AL BR BR BR
The effectiveness of the algorithm comes from propagating the values of the
3. Pass through the image row by row, from bottom to top and right to left.
For each neighboring pixel below and to the right (illustrated by the set BR
on the previous slide), assign
F (p) = min F (p), D(p, q) + F (q) .
qBR
Euclidean D4 D8
Quasieucledean distance
34/50
Euclidean quasieuclidean
DT, starfish example, input image
35/50
Input color image of a starfish Starfish converted to gray−scale image Segmented to logical image; 0−object; 1−background
50 50 50
50 100 150 200 250 300 50 100 150 200 250 300 50 100 150 200 250 300
50 50
100 100
150 150
200 200
250 250
300 300
50 100 150 200 250 300 50 100 150 200 250 300
D4 D8
Distance transform, distance DQE (quasi−Euclidean) Distance transform, distance DE (Euclidean)
50 50
100 100
150 150
200 200
250 250
300 300
50 100 150 200 250 300 50 100 150 200 250 300
Quazieuclidean Euclidean
Image properties used in its
assessment/enhancing 37/50
3000
2500
2000
1500
1000
500
edges (in the direction of the maximal intensity gradient) in an image. When
we increase sharpness, we increase the contrast only along/near edges in the
image while leaving image intensity in smooth image areas unchanged.
Towards enhancing a single image
41/50
Let consider a common practical task. Let have only a single captured digital
sensor dynamic range was not high enough, the objects were not
distinguished from the background, etc.
A human influences namely the brightness, contrast, color saturation or
illustrative examples.
Introducing the image used in experiments
42/50
I captured the input color image of three objects on a light green sofa
background. The scene shows deliberately one object (a square cushion) similar
in color to the background and two objects, two plush toys, differing from the
background in color. The first toy has different green color than the sofa and the
second toy is orange.
We begin with gray level images, a conversion
43/50
18000
16000
14000
10000
8000
6000
4000
2000
18000
16000
14000
10000
8000
6000
4000
2000
18000
16000
14000
10000
8000
6000
4000
2000
0.5
18000
16000
14000
10000
8000
6000
4000
2000
18000
16000
14000
10000
8000
6000
4000
2000
18000
16000
14000
10000
8000
6000
4000
2000
1.8
1.6
1.4
0.8
0.6
0.4
0.2
18000
16000
14000
10000
8000
6000
4000
2000
18000
16000
14000
10000
8000
6000
4000
2000
1.6
14000 14000
1.4
12000 12000
1.2
10000 10000
8000 8000
0.8
6000 6000
0.6
4000 4000
0.4
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
10
4 Red component histogram 10
4 Green component histogram 10
4 Blue component histogram
2 2.5 2.5
1.8
1.6 2 2
1.4
0.8 1 1
0.6
0.2
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
1.8 8
1.6
7
1.4
10000 6
1.2
5
4
0.8
5000 3
0.6
2
0.4
0.2 1
0 0 0
0 50 100 150 200 250 0 50 100 150 200 250 0 50 100 150 200 250
Image sharpness illustrated
50/50
Intensity profile along a stright line segment
250
200
50
0
0 20 40 60 80 100 120 140
200
50
0
0 20 40 60 80 100 120 140
200
50
0
0 20 40 60 80 100 120 140
50
100
150
200
250
300
50
100
150
200
250
300
50
100
150
200
250
300
50
100
150
200
250
300
200
Color component intensity in a pixel
150
100
50
0
0 20 40 60 80 100 120 140
200
Color component intensity in a pixel
150
100
50
0
0 20 40 60 80 100 120 140
200
Color component intensity in a pixel
150
100
50
0
0 20 40 60 80 100 120 140