Professional Documents
Culture Documents
Subjects
• Gray level transforms (contrast, brightness).
• Image histograms (intensity distribution).
• Histogram equalization (normalized intensity distribution).
• Image arithmetic (addition, and subtraction)
Local neighborhood 4/47
Relationships between pixels
Two pixels (or objects) are 8-, 4-, or m-connected if a 8-, 4-, or
m-path can be drawn between them.
Local neighborhood 6/47
Why is this important?
z z z
and zi the underlying pixel values
4 5 6
z 7 z 8 z 9
w w w
7 8
6
= wT z = hw, zi
P
R= i=1...9 wi zi
• ... is a scalar product!
• The global operation is convolution
of the image and the kernel, f ∗ w
Spatial filtering 10/47
Nonlinear filters
z 4 z z 5 6
1-D convolution
a
X
g(x) = w(x) ? f (x) = w(s)f (x − s)
s=−a
Calculus:
Changes are described by partial derivatives in images.
∂f (x, y)
≈ f (x + 1, y) − f (x, y) = f (x, y) ? [1, −1]
∂x
∂f (x, y)
≈ (f (x + 1, y) − f (x − 1, y))/2 = f (x, y) ? [1, 0, −1]/2
∂x
Edge detection, the Sobel operator 20/47
Calculating magnitude and direction
Irwin Sobel
Sobel, I., Feldman,G., ”A 3x3 Isotropic Gradient Operator for
Image Processing”, presented at a talk at the Stanford Artificial
Project in 1968.
Edge detection, the Sobel operator 23/47
∂2f
= f (x + 1) − 2f (x) + f (x − 1)
∂x2
∂2f ∂2f
∇2 f = +
∂x2 ∂y 2
∇2 f = [f (x + 1, y) + f (x − 1, y) + f (x, y + 1) + f (x, y − 1)] − 4f (x, y
0 1 0 1 1 1
1 −4 1 1 −8 1
0 1 0 1 1 1
4n 8n
Highpass filtering 25/47
Median
For a set of pixels zi in an image neighborhood, the median value c
minimizes the sum of absolute differences. The 2-norm, || · ||,
allows this functional to be used to compute the median value
when zi is a vector-valued set (e.g. RGB images).
X
θ(c) = ||zi − c||
i
Local Histogram Equalization 38/47
Local histogram equalization
• Download competition.zip
• Design method to restore noisy image
• Compare with ground truth using MSE1 excluding 4 px border
• Email team name and file restore.m2 to anders@cb.uu.se
• Open until Sun 2013-03-03, highscore list, 100 SEK price
1
MSE = “mean squared error”
2
called as newim = restore(im) or restore
Review Questions 46/47