1 1.1 Thinning Algorithm: Machine Vision Thinning Algorithms Page 1 of 14
1 1.1 Thinning Algorithm: Machine Vision Thinning Algorithms Page 1 of 14
Like other morphological operators, thinning operators take two pieces of data
as input. One is the input image, which maybe either binary or greyscale. The
other is the structuring element, which determines the precise details of the
effect of the operator on the image [5].
Morphology uses ‘Set Theory’ as the foundation for many functions. The
simplest functions to implement are ‘Dilation’ and ‘Erosion’. Dilation in 1D is
defined as:
Image enhancement
Image restoration (i.e. removing scratches from digital film)
Edge detection
Texture analysis
Noise reduction
Each point in the structuring element may have a value. In the simplest
structuring elements used with binary images for operations such as erosion,
the elements only have one value, conveniently represented as a one. More
complicated elements, such as those used with thinning or greyscale
morphological operations may have other pixel values.
In the structure element 1’s are represented as the foreground pixels and 0’s
are represented as the background pixels. The Blanks are indicated as “don’t
care”.
2.1 General
Thinning algorithms can be divided into two broad classes namely iterative and
non-iterative. Although non-iterative algorithms can be faster than iterative
algorithms they do not always produce accurate results.
The Connectivity number is a measure of how many objects are connected with
a particular pixel. The following is the equation to calculate Connectivity
number.
Where: Nk is the colour of the eight neighbours of the pixel analyzed. N 0 is the
center pixel. N1 is the colour value of the pixel to the right of the central pixel
and the rest are numbered in counter clockwise order around the center.
S = {1, 3, 5, 7}
Figure 2.1
a) Connectivity number = 0.
b) Connectivity number = 1.
Figure 2.2
1. Find a pixel location (i, j) where the pixels in the image match those in
template T1. With this template all pixels along the top of the image are
removed moving from left to right and from top to bottom.
2. If the central pixel is not an endpoint, and has connectivity number = 1, then
mark this pixel for deletion.
T2 will match pixels on the left side of the object, moving from bottom to top
and from left to right. T3 will select pixels along the bottom of the image and
move from right to left and from bottom to top. T4 locates pixels on the right
side of the object, moving from top to bottom and right to left.
Figure 2.3
This skeletonization algorithm is a parallel method that means the new value
obtained only depend on the previous iteration value. It is fast and simple to be
implemented. This algorithm is made by two sub-iterations. In the fist one, a
pixel I (i , j) is deleted if the following conditions are satisfied [3]:
At the end, pixels satisfying these conditions will be deleted. If at the end of
either sub-iteration there are no pixels to be deleted, then the algorithm stops.
Figure 2.4 shows some examples of the thinning process using the Zhang-
Suen Algorithm
Approach
It is possible to state for some black nodes whether they belong to the skeleton
or not by examining the kind of their four edges. For example, when there are
four incoming edges to a node, the node certainly belongs to the skeleton; it
represents a local maximum in this case, and therefore lies in the middle of the
object. Unfortunately the nodes found by this method do not building a sound
skeleton; the connectivity is not preserved. This is called a pre-skeleton.
Further step is necessary construct the skeleton [6].
(1) Label all nodes with their minimal distance to an edge of the object.
(2) Detects all nodes of the pre-skeleton.
(3) Find the remaining skeleton nodes to preserve connectivity.
The segmented URT, its central path, and its cross--sectional profile at the
three landmarks (vocal cords, caudal border of the cricoid cartilage, and cranial
border of the sternum) and at the narrowest position (top); the line chart
(bottom).
Figure 3.2
Figure 3.3
Unravelling the colon is a new method to visualize the entire inner surface of
the colon without the need for navigation. This is a minimally invasive technique
that can be used for colorectal polyps and cancer detection. Dr. Palágyi has
proposed an algorithm for unravelling the colon which is to digitally straighten
and then flatten using reconstructed spiral/helical computer tomograph (CT)
images. Comparing to virtual colonoscopy where polyps may be hidden from
view behind the folds, the unravelled colon is more suitable for polyp detection,
because the entire inner surface is displayed at one view.
Figure 3.4
The segmented volume of a part of the artificial phantom with two polyps (top)
and the same part of the phantom after unravelling (bottom).
The segmented volume of a part of the cadavric phantom with polyps (top) and
the unravelled colon (bottom).
The Stentiford method tends to produce lines that follow curves very well,
resulting in vectors that most accurately reflect the original image. The Zhang -
Suen method tends to be better at extracting straight lines from a raster, so
may result in more desirable vectors from an original image which comprises
mainly straight lines [8].
Finally, since sometimes, when thinning is complete, there are still pixels that
could be deleted (principal among these are pixels that form a staircase). It is
possible to use Holt’s staircase removal algorithm, which allows half of the
pixels in a staircase to be removed without affecting the shape of
connectedness of the overall object by applying a template-matching technique.
The following (figure 4.1) shows the thinned image resulting from the
application of a hybrid implementation based on the merging of the above
algorithms in the following order: Stentiford’s pre-processing scheme feeding
images into Zhang-Suen’s basic algorithm, with Holt’s staircase removal
algorithm as a post-processor [2].
Figure 4.1
Figure 4.2