Professional Documents
Culture Documents
Recap
Derivatives of Images
Emboss Effect
Summary
Exercises
Recap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 2 3 4 5
note:
j
Representation of Digital Images (II)
Images as Arrays
note:
pixel neighborhoods
I in image processing, one often considers the
4-neighborhood and the 8-neighborhood of a
pixel p
p p
4-neighborhood 8-neighborhood
Representation of Digital Images (II)
Images as Arrays
pixel neighborhoods
I generally, the spatial distance between two pixels p and q
with coordinates (ip , jp ) and (iq , jq ) is measured using the
Euclidean distance between their coordinates
q
d(p, q) =
(ip , jp ) − (iq , jq )
= (ip − iq )2 + (jp − jq )2
Representation of Digital Images (II)
Images as Arrays
pixel neighborhoods
I for the pixels q in the 4-neighborhood of p, the Euclidean
distance between p and q amounts to
d(p, q) = 1
Representation of Digital Images (II)
Images as Arrays
pixel neighborhoods
I for the pixels q in the 4-neighborhood of p, the Euclidean
distance between p and q amounts to
d(p, q) = 1
Question:
I can’t we consider or define a distance that would
avoid such “strange behavior”?
Representation of Digital Images (II)
Images as Arrays
Question:
I can’t we consider or define a distance that would
avoid such “strange behavior”?
Answer:
I yes, we can! (more on this later!)
I but we rather shouldn’t (more on this later!)
Representation of Digital Images (II)
Images as Arrays
Question:
I why does image processing resorts to pixel arrays where
some immediate neighbors are closer than others?
Question:
I why does image processing resorts to pixel arrays where
some immediate neighbors are closer than others?
Answer:
I no, in principle, there are many possibilities to achieve this!
Representation of Digital Images (II)
Images as Arrays
tessellation / tiling
I a tessellation is a collection of planar figures that cover
the entire plane without overlaps and gaps
I examples:
Representation of Digital Images (II)
Images as Arrays
tessellation / tiling
I interesting tessellations have certain symmetry properties,
they are periodic or a-periodic, . . .
tessellation / tiling
I interesting tessellations have certain symmetry properties,
they are periodic or a-periodic, . . .
Question:
I then why are these not used in digital photography?
Representation of Digital Images (II)
curSubSection
Answer:
I the reason why these are usually neglected in
digital imaging is of rather technical nature!
Representation of Digital Images (II)
curSubSection
Answer:
I the reason why these are usually neglected in
digital imaging is of rather technical nature!
Answer:
I the reason why these are usually neglected in
digital imaging is of rather technical nature!
note:
example
50
45
40
35
30
25
20
15
150 10
5
0 5 10 15 20 25 0
30 35 40 45 50
Representation of Digital Images (II)
Images as Functions
note:
color images
I in a color image, discrete coordinates are mapped to
certain color values which are represented
by triples
of numbers taken from the set 0, . . . , 255
Question:
I what do we gain from raising the level of abstraction?
Representation of Digital Images (II)
Images as Functions
Question:
I what do we gain from raising the level of abstraction?
Answer:
I if we are dealing with mathematical functions, we may
apply the whole toolbox of mathematical techniques
which have been developed over centuries
I we can apply functions or operators to images, i.e. we
can compute with images
Representation of Digital Images (II)
Images as Functions
Question:
I what do we gain from raising the level of abstraction?
Answer:
I if we are dealing with mathematical functions, we may
apply the whole toolbox of mathematical techniques
which have been developed over centuries
I we can apply functions or operators to images, i.e. we
can compute with images
I f (x) is differentiable in x if
d
f+0 (x) = f−0 (x) = f 0 (x) = f (x)
dx
Derivatives of Images
example
I derivatives from above and from below of f (x) = x2 x=2
16 16 16 16
12 12 12 12
8 8 8 8
f+0 : 4 4 4 ... 4
0 0 0 0
-2 0 2 4 -2 0 2 4 -2 0 2 4 -2 0 2 4
12 12 12 12
8 8 8
8
f−0 : 4
4 4 ... 4
0 0 0
0 -2 0 2 4 -2 0 2 4 -2 0 2 4
-2 0 2 4
note:
example
I derivatives from above and from below of f [i] = i2 i=2
16 16
12 12
8 8
4 4
0 0
0 1 2 3 4 0 1 2 3 4
∆+ f [2] ∆− f [2]
Derivatives of Images
“compromise”
I when computing the derivative of a discrete function,
consider information from below and from above:
∆f [i] = f [i + 1] − f [i − 1]
Derivatives of Images
example
I discrete derivative of f [i] = i2 i=2
16
12
0
0 1 2 3 4
∆f [2]
Derivatives of Images
gradient
I the gradient of a multivariate continuous function
f (x1 , x2 , . . . , xn ) is the vector of partial derivatives of f
∂f
∂x1
∇f (x1 , . . . , xn ) = ...
∂f
∂xn
Derivatives of Images
gradient
I the gradient of a multivariate continuous function
f (x1 , x2 , . . . , xn ) is the vector of partial derivatives of f
∂f
∂x1
∇f (x1 , . . . , xn ) = ...
∂f
∂xn
note:
∇ : (Rn → R) → (Rn → Rn )
Derivatives of Images
note:
∇ : (Rn → R) → (Rn → Rn )
note:
∇ : (Rn → R) → (Rn → Rn )
note:
∇ : (Rn → R) → (Rn → Rn )
gradient
I ∇g[i, j] is a discrete, vector valued function, i.e. a discrete
vector field
Derivatives of Images
gradient
I ∇g[i, j] is a discrete, vector valued function, i.e. a discrete
vector field
I for
visualization,
one usually considers only the norm
∇g[i, j]
of ∇g[i, j], where
q
q
2
∇g[i, j]
= ∇g[i, j], ∇g[i, j] = ∇g[i, j]
Derivatives of Images
gradient
I ∇g[i, j] is a discrete, vector valued function, i.e. a discrete
vector field
I for
visualization,
one usually considers only the norm
∇g[i, j]
of ∇g[i, j], where
q
q
2
∇g[i, j]
= ∇g[i, j], ∇g[i, j] = ∇g[i, j]
gradient
I ∇g[i, j] is a discrete, vector valued function, i.e. a discrete
vector field
I for
visualization,
one usually considers only the norm
∇g[i, j]
of ∇g[i, j], where
q
q
2
∇g[i, j]
= ∇g[i, j], ∇g[i, j] = ∇g[i, j]
I sometimes,
one only plots those coordinates (i, j), where
∇g[i, j]
assumes a local maximum
Derivatives of Images
example
g[i, j] ∆x g[i, j]
∆y g[i, j]
∇g[i, j]
Derivatives of Images
example
450
400
350
300
250
200
150
100
50
Question:
I what is this good for?
Derivatives of Images
Question:
I what is this good for?
Answer:
I it detects edges!
Derivatives of Images
Question:
I what is this good for?
Answer:
I it detects edges!
Question:
I what is this good for?
Derivatives of Images
Question:
I what is this good for?
Answer:
I it detects edges!
Question:
I what is this good for?
Answer:
I we will study numerous applications of this later
I for now, let’s consider an example from artistic
image processing
Emboss Effect
idea
I transform an input image such that it looks like a
copper engraving or etching
Emboss Effect
idea
I transform an input image such that it looks like a
copper engraving or etching
approach
I similar to the computation of derivatives
I transform image g into g̃ using
g̃[i, j] = 128 + g[i + 1, j + 1] − g[i − 1, j − 1]
Emboss Effect
examples
Summary