Jonk RVD BSme 97
Jonk RVD BSme 97
Arnold Jonk & Rein van den Boomgaard & Arnold W.M. Smeulders
Faculty of Mathematics, Computer Science, Physics and Astronomy
University of Amsterdam, The Netherlands
fjonk,rein,[email protected]
A line-tracker is presented that is flexible and robust. Linepoints are detected locally in
order to construct a tracker that can be fast and is able to use knowledge about the line to
be tracked. This is especially needed in cases where the line is of poor image quality. An
application is shown in which two trackers are combined into a parallel line-tracker.
1 Introduction
Interpretation of line drawings is largely dependent on the quality of line-recognition, because lines form the building blocks of these types of drawings. Because of its importance, considerable effort has been put in line-recognition. There are two main approaches to line recognition, line-detection and line-tracking. Line-detection is a parallel proces of global-image operations such as segmentation, edge-detection and clustering, in principle using little a priori
information where to find the line. The difficulty here is to assure connectivity in the detected
line-segments (see [Jonk95]). Line-tracking is a sequential process starting from an a priori located point on the line. The difficultu here is reach the end of the line. Line-tracking may use
an adaptive model of the profile, hence provides more information to the line-recognition step.
When lines are of very poor quality global-image techniques are very costly, ineffective or give
rise to a large number of false hits (observe figure 1 for an example). In such a case line trackers
are the preferred method.
Figure 1: Example of a line that is difficult to detect with global image operators. Note that the line on the left is
drawn on the backside of the paper, which explains its vague appearance.
of controlpoints fp~0
given by:
p~1
k
X
i=0
p~iNi m(t)
(1)
where
i t ti+1
Ni 0 = 10 totherwise
(2)
Ni m (t) = t t ;;ti t Ni m;1 (t) + t ti+m+1;;t t Ni1 m;1 (t):
(3)
i+m i
i+m+1 i+1
In these equations m stands for the order of the spline, and k for the number of nodes. In our
line-tracking method, a B-spline is used to describe the line.
zxy :
H (x y) = zzxx
xy zyy
(4)
The direction n(t) is obtained by using the vector corresponding to the eigenvalue of maximum absolute value.
Detection of the centre of the line is now straight forward. Figure 2.b shows our model of
the lines propile, a parabolic shaped profile. This is an effective first-order approximation of
the observed real world profiles.
The parabolic profile (with x the (local) coordinate in the direction n(t)) is defined with the
equation:
2
;w x w
f (x) = h0 (1 ; (x=w) )) otherwise
(5)
z(x w h) = (g f )(x)
z (x w h) = (g f )(x)
z (x w h) = (g f )(x):
0
(6)
00
(7)
00
(8)
00
3 The Line-Tracker
In figure 3 an overview is given of the basic steps of the tracking algorithm. In this figure
the boxes denote steps in the line-tracking algorithm. So, there is an initializing step, a step to
retrieve a list of possible next extensions, etc.
POINT, DIRECTION
Start
SPLINE
STEPSIZE
CURVATURE
find extensions
EVALUATED LINE-POINTS
Select extension
EXTENSION POINT
extend
stop?
terminate
In figure 4.b another approach is presented. Here, the possible new linepoints are sought on
the circle with diameter d, between the intersections of this circle with the circles describing the
maximum admissible curvature p. Using the points on this circle also ensures the length of the
new line-fragment to be shorter with increasing curvature.
d
d
p
p
d
(A)
(B)
Figure 4: The maximally admissable curvature of the line is indicated by a with the circle with diameter p. (a).
Seeking points orthogonal to the extension-direction severely restricts the stepsize. (b). Therefore, possible new
linepoints are sought on the circle with diameter d.
The extension of a spline is calculated by obtaining the derivative-vector (d~) of the spline at
its endpoint. The initial extension is a vector of length p (See figure 5.a). Linepoints are detected
in the circular subimage using the detection-method described in section 2.2. Detection results
in a set of linepoints S (figure 5.b). Now, the list of potential extension-points E is derived
p
Figure 5: Definition of parameters. (a) The center c and stepsize p. (b) The set S of detected linepoints is a subset
of the hatched area. (c) The set E of potential extensionpoints is a subset of the cross-hatched area.
from S by defining
E = fvjv 2 S \ d(v c) p ; pg
with d(v c) the Euclidean distance between points v and c, and
(9)
p the maximum distance between a detected line-point and the circle line. This is visualized in figure 5.(c).
Now, each point in E needs to be evaluated, in order to be able to select the point that is
the most likely extension of the line. Observe figure 6, to appreciate the need for an evaluation
algorithm of potential extension points.
other line
c
tracked line
p1
p0
p2
Figure 6: An evaluation based on evidence in the image is needed to distinguish between both detected linepoints.
The evaluation is done by extending the spline Ln (representing a spline with n nodes) with
each point e 2 E , and then checking the evidence in the image for the lines thus hypothesized.
This done by calculating the minimum squared distance between the extended spline, and the
detected line-points. See for an example figure 7.
p1
p1
p2
p2
Figure 7: The squared difference-function applied to an example. Figure (b) will produce a (much) larger error
than figure (a).
The line tracker needs a stopping condition. Primarily, the tracker will halt if it can not find
an extension point. In addition, the tracker must also be restrained from jumping lines (figure
8.a). This is achieved by imposing a maximum on the allowed value of c(Ln S ). Also, the
line-tracker should halt when the line-structure changes abruptly (figure 8.a). This is tackled
by allowing continuous changes in the parameters of the line: extensions that do not extend the
line with a segment with significantly different contrast and/or width.
Figure 8: (a) the tracked line terminates, but another, similar, line falls within the stepsize. (b) Two different,
connected, lines. The line-tracker should terminate tracking when it reaches the connection.
The tracker can fail in a number of circumstances. When line points remain undetected, for
example because the lines thickness is outside the parameters supplied to the algorithm, or its
profile cannot be approximated by a parabolic shape, the tracker will incorrectly terminate. The
design of the algorithm is such that small gaps can be handled. A gap larger than the stepsize,
however, will still result in termination of the tracker.
Min
for Le Left
for Ri Right
This eval(L+Le,R+Ri)
if This < Min
LeMin Le
RiMin Ri
Min This
endif
if Min =
extend (L,LeMin)
extend (R,RiMin)
LeftStepsize, RightStepsize adjust stepsize(L,R,DefaultStepsize)
endif
while Left = EMPTY .AND. Right = EMPTY
6 1
6
return L,R
P (Bn1 Bn2 ) =
Zn
n;2
(10)
Note that we only need the last three nodes of the spline-descriptions because cubic splines
are used.
Combining these two factors is done by selecting the two potential linepoints of both lines
maximizing the following equation:
max
e1 2E1 e2 2E2
p1
c
p0
p2
backline
B
galley
backline
Figure 11: Extending the B-spline and locating valid backline-points can produce several hypothesis. Using constraints provided by the galley, the correct point is found.
Delta
(A)
(B)
Figure 12: (a). When tracking two curved, parallel lines, a uniform stepsize will cause the tracking to divert. (b)
Calculating the size of the step needed on the inner-track.
4.
stepsize in algorithm
Increments are done until the stopcondition is met. The stopcondition is reached when one
of the lines cannot be extended further. This can happen for example when one of the lines
terminates, or runs out of the image. Additional stopcriteria can be envisioned. For example an
upper bound can be enforced on the divergence of the lines. In the current algorithm, parallelism
is only used as a selection-criterium when multiple extensions are available.
5 Experiments
Using our algorithm, we undertook experiments to test the validity of our approach. It showed
the algorithm succeeds in finding the set of parallel lines except for very specific circumstances.
In figure 13 we present two of the tested situations, and the results obtained by the algorithm. In the presented experiments, two different lines are tracked. One line is drawn on the
backside of the paper, while the other is a thick line drawn on the front. In figure 13.a a difficult
but succesfully tracked situation is shown. Here, at the location the lines diverge (making the
parallel-criterium less effective), the image is of very poor quality due to paper rupture. Line
detection is also hampered by a crossing object. The tracker is, however, still able to detect te
line.
In figure 13.b a failed experiment is shown. Here, the line-detection step fails to find the
line drawn on the backside of the paper. The figure displays (the white dots) detected linepoints
(the center-line of the arrowhead), and the search area (indicated by the grey dots). The tracker
can not operate when no linepoints are detected.
(A)
(B)
Figure 13: Examples of tracked parallel lines. (a) Curved line with a close up of low quality image part. (b)
Example of a tracking error.
match. The stepsize between consequetive matches is typically very small. The advantage of
this method is the (potential) accuracy of the estimated parameters. Very specific structures can
be followed, for example a 3D-ellips. A drawback of the profile matching method is its sensitivity to noise and gaps in the line.
The example images in this paper show lines of very poor quality. Their profiles are not
suited for high precision profile matching, and many gaps in the lines, as well as crossing lines,
can be expected. Experiments showed that in this domain profile matching does not perform
well.
7 Conclusions
A line tracking algorithm was presented. We have shown the usefulness of the line point
detection method in cooperation with our line tracker. The line tracker is designed such that is
robust against line ruptures, and can accurately control the maximal allowed curvature of the
tracked line.
A strong point of this algorithm is its flexibility. This flexibility was demonstrated in an
example, where two line-trackers were combined to form a parallel line-tracker.
References
[Dori93] D. Dori & Y. Liang & I. Chai. Sparse Pixel Recognition of Primitives in Enigineering
Drawings. Machine Vision and Applications, 6,pp69-82, 1993.
[Jonk95] A. Jonk & A. Smeulders. An axiomatic approach to clustering line-segments. ICDAR, 1995.
[Noordmans97] H.J. Noordmans & A.W.M. Smeulders High Accuracy Tracking of 2d/3d
curved line structures by Consecutive Cross-Section Matching. Submitted to Pattern
Recognition Letters, 1997
[Pavlidis87] T. Pavlidis. Algorithm for graphics and image processing. Computer Science
Press, 1987.
[Steger96] C. Steger. Extracting curvilinear structures: A differential geometric approach. In
B. Buxton and R. Cipolla, editors, Fourth European Conference on Computer Vision,
volume 1064 of Lecture notes in computer science, pages 630-641. Springer-Verlag
1996.