Image-Based 2D PCD for Morphological Analysis of Tendrils-Like Structure
83
The first step consists of a pre-processing stage, that includes the image
resizing (300×380 pixels), distortion correction and binarization. Then, we apply
a classic segmentation method (Otsu’s thresholding) to identify the tendril part,
and we fill the holes to find the largest region of interest (ROI). We can now
extract the skeleton while preserving the topology structure in the ROI.
The points extracted from the skeleton cannot be directly used for the curvature fitting due to the possible presence of branches, holes, unordered regions
and sharp corners, which prevent from understanding the correct sorting direction. We already proposed a sorting skeletonization algorithm to address most
of the mentioned issues [22]. Here we address the specific issue introduced by
the presence of sharp corners. An example of this condition is shown in Fig. 2a
and Fig. 2b.
In the following sections, we describe in details each of the successive steps,
starting from the weighted sorting algorithm, then we explain how to realize
the discrete curvature estimation, the automatic selection of segments, and the
shape fitting using the clothoid spirals.
2.1 Weighted Sorting Skeletonization
To define the shape direction from the unordered skeleton points obtained from
the pre-processing phase, in [22] we proposed the CollectNeighboringPoints
algorithm based on the Moving Least Squares Method (MLSM). The algorithm
starts from a randomly chosen starting point (p s , yellow circled point in Fig. 2c)
in the skeleton and it first orders the points in one direction (red arrow), then
in the other one (blue arrow). For each point of the skeleton (as in the case of
p t shown in Fig. 2c), it fits a line L : y = ax + b (blue solid line in Fig. 2d) over
the N neighboring points p i = (x i , y i ), i ∈ [1, N] collected within a local circular
area of radius R.
The sorting direction is determined based on a two-object classifier, where
each class represents one of the two possible directions. The classification is
achieved by performing the cross product of the vectors of the neighboring points
over the direction vector of the fitting line L. This operation is iterated until
reaching both ends of the skeleton with all points sorted and collected.
Figure 2d shows the classification of the points into two regions (cyan and
magenta areas in figure) separated by a yellow dash-dotted line. The results
(Fig. 2e) show that without using weights, a portion of the points in the skeleton
remains uncollected (white line above the critical point p t , Fig. 2e top view).
This is because the classifier identifies all the candidate points p i as belonging to
the same class of the current point p t . As a consequence, we cannot determine
the next point to be sorted, p t is treated as an end-point of the skeleton, and
then the sorting loop ends.
To solve the problem, we introduced tuning weights, w i , for each neighbouring
point, p i , within the radius, R, assigned according to the ratio of the Euclidean
distance, r = ||p i − p t ||
2 , as follows:
w i = e
−r
2 /R
2
.
(1)
83
The first step consists of a pre-processing stage, that includes the image
resizing (300×380 pixels), distortion correction and binarization. Then, we apply
a classic segmentation method (Otsu’s thresholding) to identify the tendril part,
and we fill the holes to find the largest region of interest (ROI). We can now
extract the skeleton while preserving the topology structure in the ROI.
The points extracted from the skeleton cannot be directly used for the curvature fitting due to the possible presence of branches, holes, unordered regions
and sharp corners, which prevent from understanding the correct sorting direction. We already proposed a sorting skeletonization algorithm to address most
of the mentioned issues [22]. Here we address the specific issue introduced by
the presence of sharp corners. An example of this condition is shown in Fig. 2a
and Fig. 2b.
In the following sections, we describe in details each of the successive steps,
starting from the weighted sorting algorithm, then we explain how to realize
the discrete curvature estimation, the automatic selection of segments, and the
shape fitting using the clothoid spirals.
2.1 Weighted Sorting Skeletonization
To define the shape direction from the unordered skeleton points obtained from
the pre-processing phase, in [22] we proposed the CollectNeighboringPoints
algorithm based on the Moving Least Squares Method (MLSM). The algorithm
starts from a randomly chosen starting point (p s , yellow circled point in Fig. 2c)
in the skeleton and it first orders the points in one direction (red arrow), then
in the other one (blue arrow). For each point of the skeleton (as in the case of
p t shown in Fig. 2c), it fits a line L : y = ax + b (blue solid line in Fig. 2d) over
the N neighboring points p i = (x i , y i ), i ∈ [1, N] collected within a local circular
area of radius R.
The sorting direction is determined based on a two-object classifier, where
each class represents one of the two possible directions. The classification is
achieved by performing the cross product of the vectors of the neighboring points
over the direction vector of the fitting line L. This operation is iterated until
reaching both ends of the skeleton with all points sorted and collected.
Figure 2d shows the classification of the points into two regions (cyan and
magenta areas in figure) separated by a yellow dash-dotted line. The results
(Fig. 2e) show that without using weights, a portion of the points in the skeleton
remains uncollected (white line above the critical point p t , Fig. 2e top view).
This is because the classifier identifies all the candidate points p i as belonging to
the same class of the current point p t . As a consequence, we cannot determine
the next point to be sorted, p t is treated as an end-point of the skeleton, and
then the sorting loop ends.
To solve the problem, we introduced tuning weights, w i , for each neighbouring
point, p i , within the radius, R, assigned according to the ratio of the Euclidean
distance, r = ||p i − p t ||
2 , as follows:
w i = e
−r
2 /R
2
.
(1)
