To isolate the boundaries of the log the following
procedure have been analyzed:
Hough method;
line-by-line image scanning method;
method of consecutive line selection.
2.1 Hough Method
In the context of the problem it is accepted that the
edge of the log could be approximated with sufficient
accuracy by a straight line or a piecewise linear
function. One of the most effective methods of
finding the straight lines on the image is Hough
transform (Fig. 1). This method is implemented with
the following guidelines (
Forsyth, Ponce, 2003):
Reducing the influence of the insignificant points.
Recommendation to reduce the influence of the noise
component is taken into account at the stage of log’s
edge detection by the gradient operator. Under the
assumption that the edges of logs orient mostly
vertically, Sobel operator with a mask "East" +
"West" was applied to accent boundaries. The result
of the edge detector implementation to the binary
image are shown on Fig. 1b.
Selection of the grid array. The choice of a large
grid pitch leads to the situation when the weight can
be mistakenly allocated to the cell which corresponds
to a number of different lines, and at small grid pitch
the weights of the points lying on the same line can be
in different cells. Based on the problem specification
and the existing image database the performance of
Hough method was analyzed at the different values of
grid pitch and threshold. The quality of the log edge
detection assessed visually. The best result was
achieved when the grid pitch value is 4 pixels, grid
pitch angle is π/18 and the threshold is 200.
The result of the algorithm implementation is
presented on the Fig. 1d.
Since the actual boundaries of the log may be
warped due to the knots, bark and trunk bend the
edges obtained by the edge detector are very noisy. It
was found that the Hough transformation is very
sensitive to the influence of distortion, which leads to
an erroneous allocation and even skipping edges or
finding several closely spaced lines with small
deviation angle (Fig. 1c). Furthermore, the quality of
the lines detection is also reduced in the case of the
log inclination.
2.2 Line-by-line Image Scanning
Method
To overcome the drawbacks of the Hough method, an
algorithm for log boundaries isolation through line-
by-line image scanning was developed. Assuming
that the target object is extended and rectilinear and
has vertical orientation, for each line of binary image
the search of x
_r
x
_l
points relating to the right and the
left boundary of the object respectively is
implemented. The search begins on conditions that
the weight of white dots corresponding to the width of
the observed object at the current line exceeds a
predetermined threshold. When the first required
point x
_i
is found its coordinates are stored in the
stack, and the analysis of a set of points x
_i+1
... x
_i+n
is
carried out. If they all belong to the front-stage object,
it is concluded that the observed object is a log, and
the point x
_i
- its boundary point for this line.
Otherwise, the stack is cleared and the boundary
search continues. As a result, after passing through all
lines of the image two sets M
_r
and M
_l
containing the
points of the right and left boundary of the log
respectively will be received:
=
,…,
;
=
л
,…,
л
(2)
where m - the number of lines in the image satisfying
the threshold condition by number of white dots.
The obtained set of points M
_r
and M
_l
describing log
boundaries may contain not only the points of the log
edges, but include elements of the sets belonging to
the edges of other objects, for example, bark or knots,
distorting the shape of the log. The following
approximation methods were used to exclude these
elements:
least-squares method;
algorithm LOWESS.
The essence of the ordinary least-squares method
(OLS) is to find the coefficients of the linear
dependence when (3) has the smallest value.
(
,
)
=(
−(
+))
(3)
where (
,
) are coordinates of the points of the set
M
_r
or M
_l
,
This model can be extended to the case of
polynomial approximation of higher power (k> 1).
Fig. 2a shows the selection of a third-power curve (k
= 3) for the one boundary of the log.
The evident advantage of the OLS method is low
computational complexity which means small
runtime. However, the method is quite sensitive to the
great single spikes associated with errors in the
identification and capturing of the data points. As is
known, the OLS algorithm based on the assumption
of independence and normality of the data
distribution.
ICINCO2015-12thInternationalConferenceonInformaticsinControl,AutomationandRobotics
358