• A grey-level image may be seen as a topographic relief,
where the grey level of a pixel is interpreted as its altitude in the relief.
• A drop of water falling on a topographic relief flows along a
path to finally reach a local minimum.
• Intuitively, the watershed of a relief correspond to the
limits of the adjacent catchment basins of the drops of water.
Watershed transform
Watershed of the gradient
Watershed of the gradient (relief)
Relief of the gradient
Gradient image
Cardiac MRI image
Binary image objects can be described by a unit width skeleton. The skeleton is placed in the medial region of the object, has the same topology, and allows the evaluation of the spatial dimensions as well as of the orientation of the object and its subsets. Skeletonizing (or thinning) usually consists of two main steps:
1. Distance transform 2. Detection of the skeletal points
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 4 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
Skeletonization
Skeleton by distance transforms
Maxima of distance transform
Distance Transform
Skeleton
Reconstruction: the original object can be reconstructed by given knowledge of the skeleton subsets Si(F), the SE K, and i:
Examples of skeleton: 0
( ( ) )n
i ii
F S F r K
The Distance Transform on Curved Space (DTOCS)
Distance Transform on Curved Space (DTOCS)• Calculates minimal distances between 2 points along a curved
surface• Calculates minimal distances between areas and areas/points
on curved surface• Uses a 3x3 calculation kernel with different metrics:
• Chessboard• City block
• Is a gray-level extension to the Rosenfeldt-Pfaltz-Lay algorithm (which
calculates a distance transform for binary images)• Presented by Toivanen and Vepsäläinen in 1991 and 1993.• Applications:
• Texture feature extraction and classification (e.g. paper roughness) (Kuparinen and Toivanen 2006, 2007)
• Shortest distance calculations (Ikonen and Toivanen 2006)• Image compression
Weighted Distance Transform on Curved Space (WDTOCS)• Calculates minimal distances between 2 points along a curved
surface• Calculates minimal distances between areas and areas/points
on curved surface• Uses a 3x3 calculation kernel with different metrics:
• Chessboard• City block
• Measures the differences between adjacent pixels by their Euclidean
distance + (1 or 1,4 for the xy-surface displacement)• Presented by Toivanen and Vepsäläinen in 1991 and 1993.• Applications:
• Texture feature extraction and classification (e.g. paper roughness) (Kuparinen and Toivanen 2006, 2007)
• Shortest distance calculations (Ikonen and Toivanen 2006)• Image compression
Definition of theDistance TransformOn Curved Space(DTOCS)
pne pn pne
pw pc pe
psw ps pse
The 3x3 kernel used in DTOCS algorithm
pne pn pne
pw pc pe
psw ps pse
The 3x3 kernel used in DTOCS algorithm
The Distance Transform on Curved Space (DTOCS)
Original image Distance image after forward pass
Distance image after backward pass
Distance image after 2nd iteration
(= forward+backward pass second time)
Original Lena image521 x 521 x 8 bits
Curves in which DTOCS distance > binary distance
Control points chosen along the curves
(a) LWC (b) SC (c) Cardboard
(d) LWC (e) SC (f) Cardboard
Shortest route calculation with Route DTOCS.
Original image
a
b
a
b
Shortest route between a and b
Fig. 2. a) Original image, b) distance from source point, c) distance from destination point, d) sum of distance images, e) route by DTOCS, f) route by WDTOCS.
Original labyrinth
Shortest routes by DTOCS
Original labyrinth
Shortest routes by DTOCS
Fig. 3. a) Shortest routes from corner to corner of an ”eggbox” surface, b) 3D-visualization of the routes on the surface a)
a) b)
x
f(x)
x
f(x)
Quantization Thresholding
Original image Constant addition
Negative image
Addition + contrast strecthing
Histogram equalization
Original image Range compression
Addition + contrast strecthing
Original image Contrast
stretching to [0, 128]
Histogram equalization
Filtering is an image processing operation where the value of a pixel depends on the values of its neighboring pixels.
Filtering
f x w xi ii
1
9
Each of the pixels are processed separately with a predefined window (or template, or mask)
Filtering is an image processing operation where the value of a pixel depends on the values of its neighboring pixels.
Filtering
Weighted sum of the pixels inside the window is calculated using the weights given by a mask, see Figure 2.12.
The result of the sum replaces the original value in the processed image:
w1
w4
w7
w2
w5
w8
w3
w6
w9
Figure 2.12: General mask for filtering with a 3 x 3 window.
In the case of border pixels, the part of the mask lying outside of the image is assumed to have the same pixel values as that of the border pixels, see Figure 2.13.
Note that the filtering is a parallel operation, i.e. the neighboring values used in the calculations are always taken from the original image, not from the processed image.
Figure 2.13: Example of filtering operation in the case of border pixel.
Low-pass filtering (or averaging filtering, or smoothing) reduces the high frequency components (or noise) in the image by averaging the pixel values over a small region (block). see Figure 2.14.
This reduces noise and makes the image generally smoother, especially near the edges. The level of smoothing can be changed by increasing the size of the window, see Figure 2.15.
-1
-1
-1
-1
8
-1
-1
-1
-1
1/9 1/9 1/9
1/9 1/9 1/9
1/9 1/9 1/9
Figure 2.14: Masks for low-pass (left) and high-pass filters (right).
High-pass filtering is the opposite operation to low-pass filtering.
The low frequency components are eliminated and only the high frequency components in the image are retained.
The operation can be applied in image enhancement by adding the result of the filtering to the original image.
This is known as sharpening.
It enhances the pixels near edges and makes it easier to observe details in the image, see Figure 2.16.
The use of negative weights in the mask may result in negative values, thus the pixel values must be scaled back to [0, 255].
Original image "airplane" (5125128)Smoothed by 3 x 3 averaging filter Smoothed by 5 x 5 averaging filter
Smoothed by 7 x 7 averaging filter Smoothed by 15 x 15 averaging filter
The End