# Syntactic curve detection by lindayy

VIEWS: 16 PAGES: 14

• pg 1
```									                                                                                               117

Chapter 8

Syntactic curve detection

8.1   Introduction

This chapter presents an algorithm for detecting curves in images by deﬁning a pattern
language and estimating a model for it. The algorithm uses entropic chunking to identify
the pixels that belong to the individual curves in an image. It then applies an alternat-
ing algorithm to update the detected curves, using a curve model that simply comprises
smoothness and continuity constraints like those used by the snakes described in Chapter
5. The main advantages of this algorithm over snakes are that it does not require any
initialisation, and it performs a type of model selection by ﬁnding the number of curves
in the image in an unsupervised fashion.

For the purpose of illustrating how curves can be detected, it is assumed that that
original image has already been passed through an edge detector, and that the image data
used as input to the syntactic model is binary. That is, pixels are labelled as being part
of an edge or not. Edge images of this kind will usually be contaminated by noise that
may be random in nature (for example, speckle noise), locally correlated (for example,
noise caused by lens distortions) or caused by occlusion. The method for detecting curves
described in this chapter can handle each of these types of noise.

Section 8.2 deﬁnes the discrete spatial pattern language used to detect curves in images.

The UpWrite is described in Section 8.3. The UpWrite determines which pixels com-
prise the individual curves in an image, and thereby learns compositional relationships.
This makes it an example of an S-UpWrite. The S-UpWrite is performed by entropic
chunking. Since curves can be simply approximated by a sequence of line segments, the
natural choice of sub-pattern is a line segment. Because the pattern language is a discrete
spatial language, the sub-patterns are n2 -patterns. Section 8.3.1 describes an algorithm
described by Alder and McLaughlin [6, 150, 151], called the Spot algorithm, for extract-
ing the n2 -patterns in the image and estimating models for them. The sequential Spot
algorithm uses the simplifying assumption that curves are smoothly continuous to simul-
taneously extract and order the n2 -patterns.
118                                                        Chapter 8. Syntactic curve detection

As outlined in Chapter 6 and discussed in Chapter 7, the choice of representation for
the n2 -patterns is an important step in the entropic chunking algorithm. In the case of
curve detection, the line segments that form the n2 -patterns must be represented in a
way that can be used to estimate a causal sub-pattern model. Section 8.3.2 describes
a transformation-based representation where the transformation from a predecessor line
segment lk−1 to its successor lk , written (lk |lk−1 ), is represented as a group action of the
special Euclidean group SE(2) of rotations and translations in the R2 [164], so that

g = (∆r, ∆t)T

where ∆r is the angle of rotation of lk from lk−1 and ∆t ∈ R2 is the translation of lk
from lk−1 . The transformation-based representation is invariant to rotation, scaling and
translation in the plane. Section 8.3.3 describes how it is used to estimate a local model
and perform entropic chunking of pixels into curves.

The use of a transformation-based representation and the estimation of a local model
of order n2 means that if one or more n2 -patterns are missing, they can be predicted
using their predecessors and the local model. Prediction can then be incorporated into
entropic chunking to produce a predictive chunking algorithm that is used in situations
where part of a curve is occluded or aﬀected by local noise. This is an important property
of the syntactic approach and a desirable property for a curve representation. Section
8.3.4 describes predictive chunking for detecting curves.

Finally, Section 8.4 presents an alternating algorithm for detecting curves that iter-
atively updates the n2 -patterns and measurement models using an algorithm similar to
the algorithm described in Section 3.4 in Chapter 3. The algorithm alternately extracts
n2 -patterns at diﬀerent scales, and then updates the measurement models using the n2 -
pattern models, giving an alternating algorithm that ﬁlters spatially varying noise.

The material in this chapter applies and extends previous work by Alder [6], McLaugh-
lin [151] and most recently, Hill [101].

8.2   A pattern language for curve detection

This section deﬁnes a pattern language for detecting curves in images. The level 0 substrate
is taken to be N × N, so that the level 0 pattern language is a discrete spatial language.

The measurable alphabet is the set {0, 1} with its power set and the counting measure.
The observed data Y form a binary image, taking value one if they are labeled as an edge
and zero otherwise. The location of a pixel in the image is a template of order one, and
higher order templates are sets of pixel locations. For convenience, Y is indexed such that
each pixel is denoted by y = (y0 , y1 )T ∈ R2 for i = 1, ..., N , where y0 speciﬁes the location
of a pixel in the x direction and y1 speciﬁes its location in the y direction.
8.3. The UpWrite: pixels to curves                                                            119

Level 1: curves
S−UpWrite
Level 0: pixels

Figure 8.1: A pattern language for curves.

The patterns in the language are the individual curves in the image, each mapping
a template comprised of a set of pixels. Figure 8.1 shows the hierarchy of the pattern
language.

8.3      The UpWrite: pixels to curves

Inference of a model for this pattern language involves determining which templates (of
a given order) are mapped by the individual patterns in an image (or equivalently, iden-
tifying which pixels comprise which curves). This involves the learning of compositional
relationships and is thus an example of a S-UpWrite. The S-UpWrite is performed by
entropic chunking.

As described in Section 6.4.1, for a given scale, the steps required for entropic chunking
are:

1. Extract the n-patterns.

2. Choose a suitable representation for the n-patterns.

3. Use the partial order of the substrate to order the n-patterns into predecessor -
successor pairs (θT , θT ) where T ≤ T .

4. Estimate a local model order n for the pattern language comprised of conditional
models p (θT |θT ) for successors1 θT of θT .

5. Calculate the entropy of the conditional models, and threshold.

These steps are elaborated in Subsections 8.3.1 – 8.3.3. Subsection 8.3.4 describes an
extension to entropic chunking, called predictive entropic chunking. Predictive entropic
chunking uses the estimated local model to predict missing n2 -patterns given their prede-
cessors. It is useful when a curve is corrupted by local noise or small occlusions.
1
Or neighbours in a noncausal pattern language.
120                                                                 Chapter 8. Syntactic curve detection

8.3.1        Extracting sub-patterns

The ﬁrst step required for entropic chunking is to centre a template of order n over each
pixel location. The n2 -patterns then comprise the values taken by pixels (zero or one)
within the template. In practice, it is not necessary to centre an n2 -pattern on each pixel
location. It is suﬃcient to ﬁnd a covering set of templates T = {Tm : m = 1, ..., M },
where each Tm is of order n such that for each y ∈ Y mapped by a pattern from the
pattern language, there exists at least one Tm such that y ∈ Tm . The corresponding set
of sub-patterns {θT : T ∈ T } is called a covering set of sub-patterns for the data Y .

The Spot Algorithm [6, 150, 151] can be used to ﬁnd a covering set of sub-patterns for
the data Y at a given scale n. First note that since only those y ∈ Y that take values of
one are of interest, the data Y can be constrained to include only those pixel locations.
Then, the Spot Algorithm applies the following steps:

1. Select any yi ∈ Y .

2. Centre a template T of order n on yi and tag all elements of Y that lie within T as
forming a subset Y of Y .

3. Store n2 -pattern θT → Y (or a suitable representation of it).

4. Remove the subset Y from Y .

5. Iterate steps 2-4 until there are no more points in Y .

Since curves can be approximated by a sequence of short line segments, the natural
choice of representation for an n2 -pattern is a line segment. As discussed in Section 3.4,
a line segment l can be modelled using a bivariate Gaussian p (l) ∼ N (µ, Σ) ﬁtted to the
pixels in the template that take value one2 .

Once a line segment has been extracted, if it forms part of a curve, it is expected that
another line segment will begin near each of its ends. This can be incorporated into the
Spot Algorithm at Step 1, by selecting the next template centre yi sequentially: set the
centre yi to be one of the end points of the line segment that has already been extracted.
If there is no data in the template T centered on yi , set it to be the other end point
of the line segment. If there is again no data, yi can then be selected randomly rather
than sequentially. The resulting sequential Spot Algorithm traces forward and backwards
along a curve until its ends are reached, before randomly moving to another curve in the
image. It has the advantage of ordering the line segments as they are extracted, so that
the predecessor and successor of each is easily identiﬁed.
2
If the pixel values consist of edge intensities instead of binary values, then the model can be ﬁtted
using the intensities to weight the pixels in the estimation.
8.3. The UpWrite: pixels to curves                                                                                                                                                                                                      121

q
qqq                                                                                                         q
q
qq
qqqqqqq
qqqqqqq
qqqqqqq
qqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq                                                                                                     qqqqqqq
qqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqq
qq
qq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqqq
qqqqqqqqq
qqqqqqqq
qqqqqqqqqq
qq
q                                                                                                  qqq q
qqqqq
qqqqq
qqqq                                                                                                       qqqqq
qqq q
qqqq
qqqqq       qq
qq
qqq
qq
qq
qq
qqq
qq                                                                                              qqqqq
qqqqq
qqqq
qqqqq
qqqqq
qqqq
qq
q
qq
qq
qq
qqq                                                                                      qqqqq
qqqq
qqqqq
qqqqq
qqqq
qqqqq
q
qq
qq
qq
q
qqq
q
qq
qqq
qqq                                                                                           qqqq
qqqq
qqqqq
qqqqq
qqqqq
q
qqq
qq
qq
qqq                                                                                     qqqq
qqqqq
qqqq
qqqqq
qqqqq
q
qq
qq
q
qq
q
qqq
qq
q
qqq
qq
qqq
qqq                                                                                       qqqqq
qqqq
qqqq
qqqq
qq                    qqq
qqqq
q
qqq
qqq
qq
qq                                                                                qqqqq
qq
qqqq
qqqq
qqqq
qq
qq
qq
qq
qqqq
qqq
qq
qqq
qq                                                                                   qqqq
qqqq
qqqq
qqqq
qqqq
qqq
qqq
qqqq
qqq
qq                                                                             qqqq
qqqq
qqqq
qqqq
qqqq
q
qq
qq
q
qq
qqqq
qq
qq
qq
qqq
qqq                                                                                qqqq
qqqq
qqqq
qqqqq
qqqqq
qq
qqqqq
qqqq
qq                                                                         qqqq
qqqq
qqqq
qqqqq
qqqqq
qq
q
qq
qq
q
qqq
qqqq
q
qq
qqq
qqq
qqqq
q
qqqq
qqqq
qqqqq
qqqqq
qqq q
qqq
qq
qqq
qqq
qqqq                                                                     qqqq
qqqq
qqqqq
qqq q
qqqqq
q
qq
qq
qq
q
qqqq
qq
qqq
qqqq
q                                                                        qqqqq
qqqqq
qqqq
qqqq
qqqq
qqq
qqqq
q
qq
q
qqq
qqqq                                                                 qqqqq
qqqqq
qqqq
qqqq
qqqq
q
qq
qq
qq
q
qqqq
qqqq
qq
qq
qqqq
qqqq                                                                     qqqq
qqq
qqqq
qqq
qqqq
qqqq
qq
qqq
qqqq
q
qq
qqqq
qqqq                                                              qqq
qqqq
qqqq
qqqq
qqq
qqqq
qq
q
qq
qq
q
qqq
qq
qqq
qqq
qqq
q
q                                                                 qqqq
qqqq
qqq                                           qq
qqqq
qqqq
qqq                                                          qqqq
qqqq
qqq                         qq
q
qq
qq
q
qqqq
qqqq
qqq
qq
q
q
qqqq
qqqq
qqqqq
qqqq
qqqqq
qqqq
q
qqq
q
qq
qqq
qqq
qqqq                                                     qqqqq
qqqq
qqqq
qqqq
qqqq
qqqqq
q
qq
qq
qq
q
qqq
qq
qqq
qqq
qqqq                                                         qqqqq
qqqq
qqqqq
qqqqqq
qqqqqq
q
qqqq
qqq
qq
qq
qqq
qqq                                                   qqqqq
qqqq
qqqqq
qqqqq
qqqqqq
qqqqqq
qq
q
qq
q
qq
qqqq
qqqqq
q
q q
qqqq
qqqq
qqqq
q
qqqqq
qqqqqq
qqqqqq
qqqqqq
qqqq
qqq
qqqqq
qqqq                                            qqqqqq
qqqqqq
qqqqq                               qq
q
qq
qq
q
qqqq
qqqqq
qqqq
qqq
q
qqq
qqqq
qqqqq
qqqqqq
qqqqqq
qqqqq
qqqq
q
qqqq
qqqq
q
q q
qqqq                                         qqqq
qqqq q
qqqqqq
qqqqq
qqqqq
qqqqqq
q
qq
qq
qq
q
qqqqq
qqqqq
qqq
qq q
qqqqq                                        qqqq
qqqq
qqqq
qqqqq
qqqq
qqqq
q
qqqq
qqqqq
qqq
qqq
qqqqq
qqqqq                                    qqqq
qqqq
qqqq
qqqq
qqqqq
qqqq
q
qq
qq
q
qq
qqqq q
qqqqqq
qq
qqqqqq
qqqqqqq                                 qqqqq
qqqq
qqqqq
qqqqqq
qqqqqq
qqqqqq
qq q
qqqqq
qqqq q
qq
qqqqqq
qqqqqqq
qqqqqq                           qqqqq
qqqqq
qqqq
qqqqqq
qqqqqq
qqqqqq
qq
q
q
q
q
qq
q
q
qq
qqqqqq
qqqqqq
qqqq
qq qq
q
qqqqqqq
qqqqqqqq                   qqqqqqqq
qqqqqqqqq
qqqqqqqq                                                                                 qqqqqq
qqqqqqq
qqqq
qq qq
q
qqqqqq                   qqqqqqqq
qqqqqqqq
qqqqqqqqq                                          qq
qq
qqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqq qqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqq
qqqqq qqqqqqqqqqqqqqq
qqqqq                   qq
qqqqqqqq q
qqqqqqqq q
qqqqqqqq q                                                                                     qqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqqqq
qqqqq                q
qqqqqqqq q
qqqqqqqq
qq
qqqqqqqq q
qqqqq qqqqqqqqqqqqqqqqqqq
qqqqq qqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqq
q
qq
q
q
q
qq
q
q
qq
qqqqqqqqqqqqqqqqq
qqqq qqqqqqqqqqq
qqqq
qqqqqqqqqqqqqqqqq qq
qqqqqqqqqqqqqqqq                                                                                                   qqqq qqqqqqqqqqq
qqqq
qqqqqqqqqqqqqqqqq qq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq                                                   qq
qq
qq
qq
qqqqqqqqqqqqq
qqqqqqqqqq qqq
qqqqqqqqqq qq
qq
q
qq                                                                                                      qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqqq                                                     qq
q
qq
q
qq
qqq
qq
q
qqq
qqq
qqq
q                                                                                                                                                                   qq
q
qq
q
qq
qqq
qqq
qq                                                                                                                                                                   qq
qq
qq
qq
qq
qq
q
qqq
qq
qqq
q                                                                                                                                                                 q
qq
qq
q
qq
qq
qqq
qq
qqq
qqqqq                                                                                                                                                               qq
q
qq
q
qq
qq
qqq
qqq                                                                                                                                                               qq
q
qq
q
qq
qq
qqq
qq
qq
qq q
q                                                                                                                                                             qq
q
qq
q
qq
qq
qq
qq
qq q                                                                                                                                                            qq
q
qq
q
qq
qq
qq
qqq
qq
qq                                                                                                                                                             q
qq
qq
q
qq
qq
qqq
qq
qq
qq q                                                                                                                                                          qq
q
qq
q
qq
qq
qq
qqq
qq
qqq                                                                                                                                                          q
qq
qq
q
qq
qq
qq
qqq
qq                                                                                                                                                         q
qq
qq
q
qq
qq
qq
qq
qq
qqq
q                                                                                                                                                        qq
q
qq
q
qq
qq
qqqq
qq
qqq q                                                                                                                                                      qq
q
qq
q
qq
qq
qqq
qq
qq                                                                                                                                                       q
qq
qq
q
qq
qq
qq q
q
qq
qq q                                                                                                                                                   qq
qq
q
q
qq
qq
qq
qq
qq
qq
q
qq
q
qq
q
q
qq
qq
qq
qqq
qq
qqq                                                                                                                                                   q
qq
q
q
q
qq
qq
qq
qq
qq                                                                                                                                                   q
qq
q
q
q
qq
qq
qq
qqq
q
qq
qq                                                                                                                                                   q
qq
q
q
q
qq
qq
qqqq
qq
qq                                                                                                                                                 q
q
qq
q
q
qq
q
qq
q
q
qq                                                                                                                                                 q
qq
q
q
q
qq
qq
qq
qq
qq                                                                                                                                                qq
q
q
q
q
qq
qq
qq
qq
qq
qq
qq

(a) Abutting curves.                                                                                                (b) Joined curves.

qq
qq
qqqqqq
qqqqqq
qqqqqq                                                                                                            qq
qq
qqqqqqq
qqqqqqqq
qqqqqqq                                                                                                       qqqqqqq
qqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqq
qqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qq
qq qqqq
qq qqqq
qqqqqqqqq                                                                                                       qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qq
q                                                                                               qqqqq
qqqqq
qqqq
qq
qq q
qqq                                                                                                           qqq q
qqqqq
qqqq
qqqqq
qqq
qq
qq
qq
qqq
qq                                                                                           qqqqq
qqqq
qqqqq
qqqq
qqqqq
qq
q
qq
qqq
qq
qq                                                                                      qqqqq
qqqqq
qqqq
qqqq
qqqq
qqqqq
qq
q
qqq
qqq
qqq
q
qqqq
qqqq
qq
q
qqqqq
qqqqq
qqqqq
q
qqq
qq
qqq
qq                                                                                      qqq
qqq
qqqq
qqq
qqq
qqq
qq
qq
q
q
qqq
qqq
qqq                                                                                    qqqqq
qqqq
q qq
q qq
q                        qqq
qqq
qq
qq
qqq
qqqq
q                                                                                   qqq
q
qq
qq
qq
qqqq
qqq
qq
qqq
qq                                                                                qqqq
q qq
qqqq
qqqq
qqqq
qqqq
qqq
qqqqq
qqqq
qqq                                                                              qq q
q   qq
qq
qqq qq
qqq qqqq
qqqq
qq
qq
qqq
qqq                                                                             qqqq
qqqq
qqqq
qqqqq
qqqqq
qq
qqqqq
qqq
qq                                                                          qqqq qq
qqq qq
qqqq qq q
q
qq
qqqq
qqq
q
qqq
qq
qqqq
qqqq
qqq q
qqq q
qqqqq
qqqqq
qqq
qqq
q
q
qq
qq
qq                                                                      qqqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqqq
qq qqq
qqq
qqq
qqqqqqqq
qqqqqqqqq
qqqq
qq
q
qqqq
qqqq
qqq                                                                   qqqqq
qqqqq
qqqq
qqqq
qqqq
qq
qq
qqq
qq
qq                                                                    qqqqq qqqq
qqqqq qqqq
qqqq
qqqq qqq
qqqq
qqqq
qqqq
qq
qq
qqqq
qqqq                                                                 qqqq
qqq
qqqq
qqq
qqqq
qqqq
qqq
qq
qq
qq
qqq
qqq
qq                                                                    qqq
qqqq
qqqq
qqq
qqqq
qqqq
qqqq
q
qqq
qqq
qq
qqq                                                               qqq
qqq
qqq
qq
qq
qq q
qqq
qqq
qqq                                                              qqqq
qqqq
qqq
qqqqq
qq
qqq
qqqq
qq
qq
q                                             qq
qqq
qqq
q
qqqq
qqq
qqqq
qqq                                                          qqqqq
qqqq
qq
qqqq
q
qqqqq
qqqq
qqqq
qqq
qqq
qq
qqq
qqqq                                                                                                         qqq
qq
qq
qqq
qqqq
qq                                                         qqqq
qqqqq
q qqqqq
q qqqq
qqqqq
qqqq
qqqq
qqqq
q
q q
q
qqqq                                     q                                                                qqqqqqqqq
qqqqqq qq
qqqqqqq
qqqqqqqq
q
q qqq q
qqqqqqqq                                 qqq
qqqq
qqq        qqqqq
q qqqq
qqqqqq
qqqqqq
q qqq
q qqq q
qqqq
qqqq
qqqqq
qqq
q                                  q
qq
qqq
q
qq                                                                    qqqqqqqq
qqqqqqqq
qqqqqqqqq
q qqqqqqq
q
qqqq q
qqqq
qq
q
qq
qqqqq      qqqqqq
qqqqqq
qqqqqqq qq qqq
qqqqqqq qqqqqq
qqqqqqq qqqqqqq
qq q
qqqq
qqq
qqqqq
qqq
qq                              qqqq
qqqq
qqqq
qqq
qqq
qq                                                                      q qqqqqq q
qqq
qqqqqqqqq
qq
qqqqqqq
qq
qqqqqqq                          qqqqqqq qqqq
qqqqqqq qq
qqqqqqqqqqqq
qqqqqqqqqqqq
qqqqqqqqqqqq
qqqqqqqqqqq
qq
qq
qq
qqq
q                         qqqqqq
qqqqqq
qqqqqq
qqq
qqq
qqqq                                                                               qqqqqq
qqqq
qqqqq
qq
qqqqqqq
qqqqqq
qqqqqq                   qqqqqqqqqqqq
qqqq qqqqqqq
qqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq                                                                                                          qqq
q
q
qq
qqq
qqq
qqqq
qqqqq
qqqqq
qqqqqq
qqqq
qqq
qq qqqqqqqqqqqqqqqqqqq
qqqq q
qqqq
qqqq
qq qqqqqqqqqqqqqqqqqqq
qq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqq
qqqqqqqq
qqqq
qqqq
qqqqqqqq
qqqqq               q
qqqq
qqq
qqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqq
qq
q
qq
qqqqqqqqqqqqqqqqqq
qq qqqqqqqqqqqqqqqq
qq
qqqqqqqqqqqqqqqqq
qqqqqq
qqqq
qqqqqqqqqqqqqqqqqqq
q
qqqqqqqqqqqqqqq qq
qqqqqqqqqqq
q qqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq

(c) Partially occluded curve.                                                                                                       (d) Noisy curve.

Figure 8.2: The results of the sequential Spot Algorithm.
122                                                                Chapter 8. Syntactic curve detection

Figure 8.2 shows the results of applying the sequential Spot Algorithm to some simple
curves. In it, each n2 -pattern representation (µ, Σ) is represented by the ellipse drawn at
a distance of two standard deviations from the mean of its Gaussian model. That is, by
the set
y ∈ R2 :     (y − µT )T Σ−1 (y − µT ) = 2
T

Each ellipse has axes whose directions are given by eigenvectors of Σ and whose lengths
are given by the eigenvalues of Σ. As discussed in Section 3.4, the major axis of the ellipse
is the line segment that forms the n2 -pattern. The minor axis provides information about
the how far the data in the template diverge from the line segment.

The output from the sequential Spot Algorithm is an ordered sequence of n2 -patterns
that traces through the curves in an image. While the sequential algorithm can be used to
mark the ends of some curves (those identiﬁable because there is no data that continues
the curve), determining ends of curves in all cases is not trivial. The ends of a curve may
occur where one object occludes another, resulting in abutting curves like those in Figure
8.2(a), or where the shape of the curve changes abruptly as in Figure 8.2(b). When part
of a curve is occluded or partially missing as in Figure 8.2(c), it may appear to end but in
fact continues elsewhere in the image. There may also be complications caused by locally
correlated noise, such as the irregularities seen in Figure 8.2(d). The next section describes
how entropic chunking can be used to ﬁnd the ends of the curves in each of these cases.

8.3.2         Sub-pattern representations

Let lk−1 and lk be consecutive line segments corresponding to n2 -patterns from a curve.3 .

Because the templates underlying two consecutive line segments lk−1 and lk have the
same scale, lk−1 and lk will have approximately equal lengths. Therefore, a predecessor line
segment lk−1 can be transformed into its successor lk by simply translating and rotating
it in R2 .

Let ∆r be the angle of rotation of lk from lk−1 and let ∆t = (∆tx , ∆ty ) be the trans-
lation of lk from lk−1 . Then the SE(2) group action that transforms lk−1 into lk is given
by
g = (∆r, ∆tx , ∆ty )T .

This gives a transformation-based representation of (lk |lk−1 ) that is a point in R3 . This
type of representation enables the estimation of the local model of order n2 required for
entropic chunking.
3
This notation will be used from here on to distinguish line segments lk from the more general sub-
pattern notation θTk
8.3. The UpWrite: pixels to curves                                                                                          123

−15   −10   −5   0    5   10   15

0.6
0.4
0.2
rotation

0.0
−0.2
−0.4
15
10
5

tx
0
−5
−10
−15

20
10
ty

0
−10
−20
−0.4   −0.2   0.0   0.2   0.4   0.6                                       −20   −10   0    10   20

Figure 8.3: Pairwise scatterplots showing the rotation and translation (tx is translation
in the x direction and ty is translation in the y direction).

8.3.3         Estimation of the local model and chunking

A local model can be estimated by one of three methods. First, if a suitable training
sample is available it can be used to estimate the local model. An artiﬁcial sample, called
CURVES, has been generated for this purpose. It contains 100 artiﬁcially generated
images, each of which contains a single curve randomly placed in the image. The curves
have been constrained to look smoothly continuous to the human eye by modelling each
as a 2d cubic polynomial.

Using n = 12, a covering set of line segments for the data in each image from the
CURVES training sample was found by applying the sequential Spot Algorithm. The
transformation-based representations were calculated for each of the predecessor-successor
124                                                         Chapter 8. Syntactic curve detection

pairs. The scatterplot matrix is shown in Figure 8.3. It shows that the rotation between a
predecessor and its successor is generally small, and that the successor is translated away
from the predecessor by a distance approximately equal to n. The local model p (g) was
assumed Gaussian and its estimated parameters were

            
−0.003
                             
0.006   0.024     0.077
        
µ =  −10.614 and Σ =  0.024           38.308   −7.382 ,
                                 
        
−2.424                   0.077 −7.382 124.181

where the rotation is expressed in radians.

Second, if no training set is available then the local model of order n2 can be estimated
in an on-line fashion as the sequential Spot Algorithm is applied. After four line segments
have been extracted, initial values of the parameters µ and Σ of the local model can be
estimated. As more line segments are estimated, these values can be updated. If the
transformation-based representation g for a new line segment lies outside of D standard
deviations from the mean of the local model; that is

d=       (g − µ)T Σ−1 (g − µ) > D,

then g is deemed an outlier and is not used to update the local model. The value d is
called the Mahalanobis distace. Taking D = 3 ensures that the set will contain 99% of the
data used to estimate the model.

The same criterion is applied to determine when the line segments have high entropy:
the transformation-based representations of line segments that have a high Mahalanobis
distance from the local model will have high entropy, so entropic chunking can be per-
formed by simply thresholding the Mahalanobis distance as the sequential Spot Algorithm
is applied.

The third method approximates the entropic chunking algorithm. Entropic chunk-
ing of line segments into curves can be easily performed in practice, by simply applying
thresholds to the translation and rotation components of the representation. This gives
an approximation to entropic chunking that can be performed without requiring the full
estimation of the local model. The results are shown in Figure 8.4.

8.3.4   Predictive chunking

As can be seen in Figure 8.4, entropic chunking can fail when curves intersect, when part
of a curve has been occluded, or if the curve is corrupted by local noise, since one or more
ellipses may be aﬀected.
8.3. The UpWrite: pixels to curves                                                                                                                                                                                                   125

qq
qq                                                                                                        qq
qq
qqqqqqq
qqqqqqq
qqqqqqq
qqqqq
qqqqq
qqqqqq
qqqqqqqq
qqqqqqqq                                                                                                   qqqqqqq
qqqqqqq
qqqqqqq
qqqqqq
qqqqqq
qqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqqq
qqqqqqqq
qqqqqqqqqq
qq
q                                                                                                qqqq
qqqqq
qqqqq
qqqq
qqqqq
qqqq                                                                                                       qqqq
qqqqq
qqqqq
qqqqq
qqqq
qqqq
q
q
qq
q
q
qq
qqq
qq
qq
qq
qq
q                                                                                             qqqqq
qqqqq
qqqq
qqqq
qqqqq
qqqqq
qq
q
qqq
qq
qq
qq
qq
q                                                                                      qqqq
qqqqq
qqqqq
qqqq
qqqqq
qqqqq
q
q
qq
q
qq
q
q
q
qq
qqq
qq
qqq
qqq
qqq
qqq
qq                                                                                      qqqqq
qqqqq
qqqq                   qqq
qqq
qq                                                                                 qqqqq
qqqqq
qqqq            qq
q
q
qqq
qqq
qqq
qqq
qq
qq
qqq
qqq
qqqqq
qqqq
qqqq
qqq
qqq
qqq
q
qqqq
qqq                                                                              qqqqq
qqq
qqq
qq
qqqq
qqqq
qq
q
q
q
q
qq
qqqq
qqq
qq
qq
qqq                                                                                  qqqq
qqqq
qqqq
qqqq
qqqq
qqqq
qqq
qqqqq
qq
qqq
qqqq                                                                           qqqq
qqqq
qqqq
qqqq
qqqq
qqqq
q
qq
q
q
q
qq
qq
qqqq
q
qqq
qqq                                                                              qqqq
qqqq
qqqq
qqqqq
qqqqq
qqqq
qq
qqq
qq
q
qqqq
qqq
qqq                                                                      qqqq
qqqq
qqqq
qqqqq
qqqqq
qqqq
q
q
qq
q
qq
q
q
q
qq
qqq
qqq
qq
qq
q
qqqq
qqqq                                                                          qqqq
qqqqq
qqqqq                                 qqq
qqqq
qq
qq
q
qqq                                                                   qqqq
qqqqq
qqqqq                     q
q
qq
qqq
qq
q
qqqq
qq
qqqq                                                                     qqqqq
qqqqq
qqqq
qqqq
qqqq
qqqq
qqqq
qqqq
qqq
qq
q                                                               qqqqq
qqqq
qqqqq
qqqq
qqqq
qqqq
q
q
qq
q
q
qq
qq
qqq
qqqq
qqqq
qqqq                                                                  qqqq
qqq
qqqq
qqqq
qqq
qqqq
qqqq
qq
qq
qqq
qqqq
qqqq
qqqq                                                           qqq
qqqq
qqqq
qqqq
qqqq
qqq
q
qq
q
q
qq
q
q
q
qq
qqq
qqq
qq
qq
q
qqq
qqq                                                              q qq
q
qqqq
qqqq                                            qqq
qqq
qq
qq
q
qqq                                                        qqqq
qqqq
qqqq                           q
q
qq
qqq
qq
q
qqqq
qq
qqqq                                                         qqqq
qqqqq
qqqq
qqqq
qqqq
qqqqq
qqq
qqqq
qqq
qq
q                                                    qqqq
qqqq
qqqqq
qqqq
qqqqq
qqqq
q
q
qq
q
q
qq
qqq
qqq
qq
qqq
qqqq                                                      qqqqq
qqqq
qqqqq
qqqqqq
qqqqq
qq
qqqq
qqq
qqq
qq                                                qqqq
qqqqq
qqqqq
qqqqqq
qqqqqq
q
q
qq
q
q
qq
qq
qqqqq
qqqq
qq
q
qqqq                                                  qqqq q
qqqqqq
qqqqqq
qqqqqq
qqq
qqqq
qqqq
qq
q
qq
qqqqq
qqqq                                            qqqqq
qqqq q
qqqqq
qqqqqq
qqqq                                 q
qq
q
q
q
qq
qqqq
qqqq
qqq
qq
qqqq
qqqqq
qqqq                                            qqqqqq
qqqqq
qqqqqq
qqqqq
qqqqqq
qqqqq                                                              qqq
qqq
qq
qqqq
qqqqq                                     qqqqqq
qqqqqq
qqqqq
qqqqqq
qqqqq
q
qq
q
q
q
qq
qqq
qqqqq
qqqqq
qqqqq
qq                                       qqqq
qqqq
qqqq
qqqq
qqqqq
qqqq
qqqqq
qqqq
qqq
qqqqq
qqqqq
qq
qqqqq                                 qqqq
qqqq
qqqq
qqqq
qqqq
qqqqq
q
qq
q
qq
q
q
qqqqqq
qqqqqq
qqq
qqq q
qq
qqqqqq
qqqqqq
qqqqqqq                             qqqqqq
qqqqqq
qqqqqq
qqqq
qqq
qqq                                                                       qqqqqq
qqqqqq
qqqqqq
qqqqqqq
qq
qqq q
qqq
qqqqqq                          qqqqq
qqqqq
qqqq
qqqqqq
qqqqq
qqqqq
q
q
qq
q
qq
q
q
q
qq
qqqq
qqqqqqqq
qqqqqqqq
qqqqq
qqqqqqqq
qqqq                 qqqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqqq
q
qqqqqqqqqqq
qqqqqqqqqqq                                                                                     qqqq
qqqq
qqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq                qqqqqqqq
qqqqqqqq
qqqqqqqqq
q
qqqqqqqqqq
q
qqqqqqqqqqq
qqqqqqqqqq
qq
q
q
q
q
qq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqq                                                                                          qqqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq                                                 q
q
qq
qq
q
q
q
q
qq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqq qq
qqqqqqqqqq q
qqqqqqqqqqqqqqqq                                                                                                  qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq                                                      q
q
qq
q
q
qq
qq
qq
q
qqq
qq
qqq
qqq                                                                                                                                                                    q
qq
q
q
q
qq
qq
qqq
qq
qqq                                                                                                                                                                   q
qq
q
q
q
qq
qq
qq
qqq
q
qq
qq
qqq                                                                                                                                                                  q
qq
q
q
q
qq
qq
qqqq
qqqq                                                                                                                                                               qq
q
q
q
q
qq
qqq
qq
qqq
qqq
qqq                                                                                                                                                                q
qq
q
q
q
qq
qq q
q
qq
qq
qq                                                                                                                                                               q
qq
q
q
q
qq
qq
qq
qq
qq
qq                                                                                                                                                              q
q
qq
q
q
qq
qq
qq
qq
qq
qqq                                                                                                                                                             q
qq
q
q
q
qq
qq
qqq
qq
qq
qq q                                                                                                                                                          qq
q
q
q
q
qq
qq
qq
qq
qq
qqqq                                                                                                                                                         qq
q
q
q
q
qq
qq
qqq
qq
qq                                                                                                                                                           q
qq
q
q
q
qq
qq
qqq
q
qq
qq q                                                                                                                                                       qq
q
q
q
q
qq
qq
qqqq
qq
qq                                                                                                                                                        q
q
qq
q
q
qq
qq
qq
qqq
qqq
qq                                                                                                                                                        q
q
qq
q
q
qq
qq
qqqq
qq
qqq
q                                                                                                                                                     qq
qq
q
qq
qq
qq
qq
qq                                                                                                                                                     qq
qq
q
qq
qq
q
q
qq
qq
qq
qq
qq
qqq                                                                                                                                                    q
qq
qq
q
qq
qq
qq
qq
qq                                                                                                                                                    q
qq
qq
q
qq
qq
q
qqq
q
qq
qq
qq                                                                                                                                                  qq
q
qq
q
qq
qq
qq
qq
qq
qq                                                                                                                                                  q
qq
qq
q
qq
qq
qq
q
qq                                                                                                                                                 q
qq
qq
q
qq
qq
qq
q
q
qq                                                                                                                                                 q
qq
qq
q
qq
qq
qq
qq
qq                                                                                                                                                 qq
qq
qq
qq
qq
qq

(a) Abutting curves.                                                                                               (b) Joined curves.

qq
qq                                                                                                           qq
qq
qqqqqq
qqqqqq
qqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqq
qqqqqq
qqqqqq                                                                                                     qqqqqqq
qqqqqqq
qqqqqqq
qqqqq
qqqqqqq
qqqqqqqq
qqqqq q
qqqqq
qqqqqqqq
qqqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qq
q                                                                                              qqqq
qq
qqqqq
qqqqq
qq
qq                                                                                                        qqqqq
qqqq
qqqq
qqqq
qqq
qqqqq
qq
qq
qq
qqq
q
qq                                                                                           qqqqq
qqqqq
qqqq
q
qqqqq
qq
qq
qqqqq
qqqq
qq
q
qq
qqq
qq
qq                                                                                      qqqq
qqqqq
qqqqq
qqqq
qqqq
qqqqq
qqq
qqq
qq
qqq
qqq
qqq
qq                                                                                      qqqq
qqqqq
qqqqq
qq
q
qqq
qq
qqq                                                                                   qqq
qqqq
qq q
qqq
qqq
qqq
qqq
qqq
qq
qqq
qqqqq
qqqq
qqqq
qqqq
qqq                     qqq
qqq
q
qqq
qqq
qqqq                                                                                  q
q
qq
qqq
qq
qq
qqqq
qqq
qq
qqq
qq                                                                              qqqq
qqqq
qqqq
q
qqqq
qqqq
qqqq
q                          qqq
qqq
qq
qqqq
qqq
qq
qq
qqq                                                                           q   qq
qq
qq qq
qqq qqqq
qqq qq
qq
q
qqq
qqqq
qq
qqq
qqq
qqq
q                                                                         qqqqq
qqqqq
qqqq                                qqq
qqq                                                                      qqqqqqq
qqqqqqqq
qqqqqqq
qqq
qqqq
qqqq
qq
qqq
qqq
qqqq
qqqqq
qqqqq
qqq                                   qq
qqq
qq
qq
qq
qq                                                                       qqqq qq
qqqq qq
q q
qqqq qq
qqqqqqqq
qqqqqqqqq
qqqqqqqqq
q
qqqq
q
qqq
qq
qq
qqqq                                                                   qqqqq
qqqq
qqqqq
qqqq
qqqq
qqqq
qq
qq
qqq
qq
qq                                                                   qqqqq qqqq
qqqqq qqqq
qqqq qqq
qqqq qqq
qqqq
qqqq
qq
qqq
qqqq
qqqq
qqqq                                                              qqqq
qqq
qqqq
qqqq
qqq
qqqq
qq
qq
qqq
qq
qqq
qq
qq
qqq
qqq                                                                 qqqq
qqqq
qqq
qqqq
qqq
qqqq
qqq
qqq
qq
qqqq
qq
qqq                                                            qq
qq
qq
q
qqq
qqq
q                                           qqq
qqq
qq
qq
qqq                                                             qqqq
qq
qqqq
qqqq
qq
q
qqq
qqqq
qqqq
qq                                                           qq
q                                            qqq
qqq
qq
qqq
qqq
qq                                                            qqqq
qqqq
qqqqq
qqqq
qqqqq
qqqq
qqq
qqq
qq
qqq
qqqq                                                                                                       qqq
qq
qq
qqq
qqqq
qqq                                                        qqqq
qqqqq
qqqqqq
q qqq q
q
qqqqq
qqqq
qqqq
qq
qq                                       q                                                                  q
qqqqqqqqq
qqqqqq qq
qqqqqq q
qq                                       qqq
qq
qq
qq        q qqqq
qqqqqq
qqqqq
qqqqqq
qqqqqq
qqq
qqq
qqqq
qqqq
qqq
qqqq
qqqqq                                  qq
q                                                                     q qqqqq
q qqqqqq
qqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
q qqqqq                               qqqq
qqqq
qqqq
qqqqq
qqqqq      qqqqqq
qqqqq
qqqqqq
qqqqq
qqqqqqq qqqqq
qqqqqqq qqqqqqq
qqq
qqqqq
qqqq
qqq
qqq
qqq
qqq
qq
qq
qq                                                                   qqqqqqqqq
qqqqqqqqq
qqqqq
qqqqqqqqq                            qqqqqq
qqqqqqqqqqqq
qqqqqqq qq q
qqqqqqqqqqqq
qqqqqqqqqqqq
qq
qq
qq
qqq
q
qq                            qqqqq
qqqq
qqqqq
qq
qqqqqq
qqq
qq
qqqqqq
qqqqqq
qqqqqqq
qqqqq
qqq
qqq
q
qqqqqq
qqqqqq
qqqqqqq
qqqqqq                    qqqqqqqqqqqq
qq q qqqqqqq
qqq qqqqqq
qqqq qqqqqqq
qqq       qqq
qqqqq
qqqqqq
qqqqq
qqqqqq
qqqq
qqqq
qqqqqqqq
qqqqqqqqq
qqqqqqqq                                                                                       qqq
qqqqqq                 qq
qq
qqq
qq
q
qqq
qq qqqqqqqqqqqqqqqqqqq
qqqq q
qqqq
qqqq
qq qqqqqqqqqqqqqqqqqqq
qq
qqqqqqqqqqqqqqqqqqqqq
qqqqq
qqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq             qqq
qqqq
qqqqqqqqqqqqqqqqq
qqq         qqq
qq
q
qq
qqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq qqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqq
q
q
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
q qqqqqqqqqqqq
qq                                                                                                            qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqqq

(c) Partially occluded curve.                                                                                                       (d) Noisy curve.

Figure 8.4: Curve detection by approximate entropic chunking with the curves shown in
diﬀerent colours.
126                                                                                                                                                                 Chapter 8. Syntactic curve detection

qqqqqq
qqqqqqq
qqqqqqq
qq
qq                                                                                                                      qqqqqq
qqqqqq
qqqqqq
qq
qq
qqqqqqqq
qqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qqqqq
qqqqq
qqqq                                                                                                                          qqqqqqqq
qqqqqqqq
qqqqqqqqq
q
qqqq
qqqqq
qqqqq
q
q
qq
qq                                                                                               qqqq
qqqq
qqqqq                                       qq
qq
q                                                                                 qqqq
qqqq
qqqqq
qq
qq
qqq
q
qq
qqq
qqq
qqq
qq                                                                                           qqqqq
qqqqq
qqqq
qqqq
qqqq
qqqqq                                         qqq
qq
qq
qq
q
qqq                                                                             qqqq
qqqqq
qqqqq
qqqq
qqqq
qqqqq
qq
qqq
qqq
qqq
qqq                                                                                        qqqqq
qqqq
qqqqq
qqqqq
qqqq
qqqq
qqq
qq
qqq
qqq
qqq                                                                         qqqqq
qqqq
qqqqq
qqqq
qqqqq
qqq
qqq
qqq
qq
q
qqq
qqqq
q                                                                                     qqqq
qqqq
qqqq
qqq
qqq
qqq
qqq                                                                    qqqq
qqqq
qqqq
qqqq
qqq
qqqq
qq
qqq
q
qqq
qqqq
qqqq
qqqq
qqqq
qqqq
q
qqq
qq
qqq
qqqq
q
qqq                                                                  qqqq
qqqq
qqqq
qqqq
q
qqqq
q
qqq
qqq
qq
qq
qqqq
qqq                                                                            qqqqq
qqqq
qqqqq
qqqq
qqqqq
qqqqq
qqq
qq
qqqq
qqqq
qq
qqq                                                              qqqq
qqqqq
qqqqq
qqqqq
qqqqq
qq
qqq
qqq
qqqq
q                                                                       qqqqq
qqqqq
qqqqq                                                          qqq
qq
qqqq
qqqq                                                        qqqqq
qqq
qqqqq
qq
qqq
qqqqq
qqqq
qqqq
qq
qqqq
qq
qqqq
qqqq
qqqq
qqqq
qqq
qqqq
q
qqq
qq
qqq
qqqq
q
qqqq                                                     qq
qqqq
q qqq
qqqq
q
qqqq
qqqq
qqqq
qqqq
qq
qq
qqq                                                                 qqqq
qqq
qqqq
qqqq
qqqq
qqq
qqqq
qqqq
qq
qq
qqqq
qq
qqqq                                                 qqqq
qqqq
qqq
qqq
qqq
q
qqq
qq
qq
qqq
qqqq                                                            qqqq
qqqq
qqqq
qqqqq
qqq
qq
qq
qq
qqq                                               qqq
qqq
qq
qq
qq
qqqq
q
qqq
qqq
qq
qqq
qqq
qqqq
qqqq
qqqq
qqqqq
qqqqq
qqq
qqqq
qqq
q
qq
qqq
qqqq                                             q
qq
qqq
qqqq
qqqqq
qqqq
qq q                                                  qqqqq
qqqqqq
qqqqqq
qqqqq
qqqqqq
qqqqqq
qqq
qqqqq
qqq
qqqq
qq q
qqqq
qqqq
qqq                                              qqqqqq
qqqqqq
qqqqq
qqqqqq
qqqqq
qqqq
qq q
qq q                                   q
qq
qqqq
qqqq
qq
qqqqq
qqqqq
qqqqq                                          qqqqq
qqqqqq
qqqq
qqqq
qqqq
qqqq
qqq
qqqq
qq
qqqqq
qqqq
qqqq
qq                                  q
qq
q
qq
qqq
q
q
qq q
qqqqq
qqqqqq
qq q q
qqqqqq
qq q                                   qqqq
qqqqq
qqqq
qqqqq
qqqq
qqqqq
qqqqq
qqqq
qqq
qq                             q q
qqqq
qqqq
qqqq
qqqqq
qqqqq
q
qqqqqqq
qq qqq
qqqqqq
qqqqqq                           qqqqqq
qqqqqq
qqqqqq                                                                                                  qq
qq
q
qqq
qq                        qqqqqq
qqqqqq
qqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqq
qqqqqqqq
qqqqq                 qqqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqqqq
q
qqqqqqqqqqq
qqqqqqqqqq
qqqqqq
qqqqqqqq
q qqqq qq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqqqqqqqq                                                                                                                   qqqqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq qqqqq
qqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
q
q         q q
qqqqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqq qq
qqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqq q                                                                                                                         qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
q
qq
qq
q
qqq
q
qqq
qq
qqq
qqq
qqq
qqq
qqq
qq
qqq
qq
qqq
qq
qqqq
qq
q
qqqq
qqq
qq
qqq
qq
qqq
qqq
qq
qq
qq
qq
qq
qq
qqqq
qq
qq
qq
qq
qq
qqqq
qq
qq
qq
qqqq
qq
qq
qq
q
q
qqqq
qq
qqq
qq
qq q
qq
qq
qqq
qq
qq
qqq
qq
qq
qq
qq
q
qqq
qqq
q
qqq
qq
qq
qqq
qq
qq
qq
qq
qq
qq
qq
qqq
qq
qq
qq
qqq
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq
q
q
qq
qq
qq
qq
qq
qq
q
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq
qq

(a) Abutting curves.                                                                                                           (b) Partially occluded curve.

qq
q
qqqqqq
qqqqqqq
q
qqqqqqq
qqqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qqqqq
qqqq
qqqqq
qq
q                                                                                      qqqqq
qqqq
qqqqq
qq
qq
qq
qqq
q
qq
qqq
qqq
qqq
q                                                                                      qqqq
qqqqq
qqqq
qqqq
qqq
qqq
qqq
qq q
qqq
qqq                                                                                   qqq
qqq
qqq
qq
qqq
qq
qqq
qqq
qqq
q
qq
qqq
qqqq                                                                                qq
qq
q q qq
q
qq
qqq
qq
qqq
qq
qq                                                                         q q qq
q q qq
qqq qq
qqqq qq
qqqq qqq
qq
qqq
qqq
qq
qq                                                                       qqqqqqq
qqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
q
qq
qqq
qq
q
qq
qq
qq                                                                   qqqqqqqqq
qqqqqqqqq
qqqqqqqqq
qqq
qq
qq
qq
qq
qqq
qqq
q qqq qqq
q
qqqq
qqqq
qqq
q
qqqq
qqqq
qqq
qqq
qqq
qqq
qqq
qqq                                                                qqq
qqqq
qqqq
qqqq
qqq
qqqq
qqq
qqq
qq
qq
qqq
qqqqq
q                                                          qqqqq
qqqq
qqqq
qqq
qqq
qqq
qq
q                                                        qqqqq
qqqq
qqqq
qqqqq
qqqqq
qqqq
qqq
qqqq
qqq
qqqqqqqqq
qqqqqq qq                                  qq
qq
qqq         qqqqqq
qqqqq
qqqqqq
qqqqqq
qqqqqq
qqqqq
q qqq qq
qqqqqqqq
qqqqqqqq
qqqqqqqq                                qqq q qqqqqq
qqqq
qqqqqq qqqqqqq
qqqq      qqqqqq
q qqq qq
q qqqqq
qq
qqqqqqqq
qqqqqqqqq
qqqqqqqqq
qqqqqqqqq
qqqqq
qq
qqqqq
q      qq
qqqqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqqqqq
qq
qq
qqqqqqqqqqqq
qq
qqqqqqq
qq q
qq q q
qqqqqq
qq q
qqqqqq                     qqqqqqqqqqqq
qqqqqqqqqqqq
qqqqqqqqqqq
qqqq
qqq qqqqqqq
qqqqqqqqqqqq
qqq qqqqqqq
qqq
qq qqq
qqqqqq
qqqqqqq
qqqqqq                 qqq qqqqqq
qqq
qqqq qqqqqqq
qqq
qqqqqqqq
qqqq
qqqqqqqq
qqqqqqqq
qqqqq               qqq
qqq
q
qqqq
qqq
qqq
qqqq
qq
qq
q
qqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqqqqqq

(c) Noisy curve.

Figure 8.5: Curve detection by predictive entropic chunking with the curves shown in
diﬀerent colours.

To detect these situations, a line segment lk−1 can be used with the conditional model
p (gk ) = p (lk |lk−1 ) to predict several successors ˆk , ˆk+1 , ...ˆk+K at a time (where lk is the
l l            l
successor of lk−1 , lk+1 is the successor of lk , etc.). If a line segment is found at one of the
predicted locations, then the curve is seen to continue, and the predicted line segments
can be inserted in the locations of those that were missing or noise-aﬀected. Predictive
chunking includes this type of extended prediction. Its results are shown in Figure 8.5.
The predictive chunking algorithm has successfully detected the whole of the top curve in
Figure 8.5(a), as well as the partially occluded curve in Figure 8.5(b).

8.4    An alternating algorithm for detecting curves

Section 3.4 in Chapter 3 described an algorithm for estimating both a global model and
a number of independent measurement models. The algorithm iteratively updates the
global model using the measurement models, and then updates the measurement models
using the global model. It eﬀectively ﬁlters measurement error or local noise using the
global model. This section presents an algorithm that uses this idea to detect curves that
may be aﬀected by similar types of noise.
8.5. Discussion                                                                          127

the curve in order to predict the locations of successive line segments along it. They
assume that the curvature changes smoothly, the line segments are located at regular
intervals along the curve and they have roughly the same length. The ﬁrst two of these
assumptions are the smoothness and continuity constraints used by Kass et al. [114] to
iteratively update a snake (as described in Chapter 5).

In this chapter, the use of n2 -patterns (that is, line segments) has already allowed
entropic chunking to be applied. This alternating algorithm demonstrates a second ad-
vantage of representing a curve as a sequence of line segments {lk }K : the sequence of
1
corresponding Gaussian models {p (lk )}K form a model for the curve as a whole, so that
1
there is no need to model the curve globally.

Extracting n2 -patterns at multiple scales n, and then updating the measurement mod-
els using the Gaussian models (using the same algorithm as that described in Section
3.4), gives an alternating algorithm that ﬁlters noise at diﬀerent scales. The algorithm
ﬁrst extracts the n2 -patterns using a large value of n. It then uses the Gaussian models
to update the measurement models, and uses their expectations as the data for the next
iteration. The scale n is reduced and the algorithm iterates.

Figure 8.6 demonstrates how this multiscale alternating algorithm eﬀectively ﬁlters
measurement error and local noise. It was run using n ∈ {30, 25, 20, 15, 10}, such that at
each iteration the following steps were performed:

1. Extract the n2 -patterns (line segments) and their corresponding Gaussian models
using predictive entropic chunking.

2. Use Gaussian models to update the measurement models.

3. Use the expectations of the updated measurement models as the data for the next
iteration.

8.5   Discussion

This chapter has shown how predictive entropic chunking can be used to detect curves in
images, giving a syntactic curve detection algorithm.

The UpWrite learns compositional relationships, using entropic chunking to determine
which pixels are part of the individual curves in the image. A local model of order n2 is
estimated in order to use entropic chunking. The estimation can be performed by using a
training sample of images containing single curves, by estimating it in an online fashion,
128                                                                                                                                                           Chapter 8. Syntactic curve detection

qq
qq                                                                                                                                    qq
q
qqqqqqq
qqqqqqq
qqqqqqq
qqqqq
qqqqq
qqqqq q
qqqqqqqq
qqqqqqq
qq
qqqqq
qqqqq
qq
qqqqq
qq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq
qqq
qqq
qqqqqq
qqqqq
qqqqq
qq
qq
q
qqq
qqqq
qqqqq
qqqqq
qqqq
qqqq
qq
qqq
qqq
qqqq
qq
qq
qqq
qq
qq
qq
q
qq                                                                                      qqqqq
qqqqq
qqqq
qqqq
qqqq
qqqqq                                           q
q                                                                                         qqq
qqqq
qqq
qqq
qqq
qqqq
qqq
qqq
qq
qqq
qqq
qqq
qq                                                                                   qqq
qqqq
qqq
qq q
q
qq
q
qq
q                                                                                     qqqq
qqq
qqq
qqq
qqq
qqq
qqq
qq                                                                                 qq
qqq
q
q
qq
qq
qq
qq
q
qq
q
qq                                                                                 qqq
qq
qq
q
qq
qq
qqqq
qqq
qq
qqq
qq                                                                           qqq qq
q    qq
qq
qq qq
qqq qqq
qq
qq
q
qq
qq
q
qq
qq
qq
qq
qqq
qqq
qq
qq
qqq
qq                                                                       qqqqqqq
qqqqqqq
qqqqqqqq
qqqq qq
qqqq qq
q q
qqqq qqq                                                   qq
qq
q                                                                            q q
qqq qq
q qqq
q
q
qq
qq
qqq
qq
qq                                                                     qqqqqqqqq
qqqqqqqq
qqqqqqqqq                                                       qq
q                                                                        qqqq qq
qqqq q
qqqq qq
qqqqq q
qqqqq q
qqqqq qq
qq
qq
qqq
qq
qq
qq                                                                   qqqqq qqqq
qqqqq qqqq
qqqq qqq
qqqq
qqqq
qqqq qqq
qq
qq
q
q
qq                                                                    qqq
qqq
qqq
qq
qqq
qq
qqq
qqq                                                                 qqqq
qqq
qqqq
qqqq
qqq
qqqq
qq
qq
q
qq
qq
qq                                                                 qqq
qqq
qqq
qqq
qqqq
qqq
qqq
qq
q
qqqq
qqq
qqq                                                              qqqq
qqqq
qqqq
qq                                                                     qq
qq                                                              qq
qq
qq
qqq
qqq
qq
qq                                                             qqqq
qqqq
qqqqq
qqqqq
qqqq
qqqq
qq
qq
qq
qq                                                          qqq
qqq
qqq
qq
qqq
qqq
qq
qqq
qq
qqqq
qqq
qqq                                                        qqqqq
qqqq
q qqq q
qqqqqq
q
qq
qq
qq                                                       qqq
qqq
qqq
q
q
qqqqqq q
qqqqqq qq
qqqqqqqqq
q                                        qq
qq
qq
qqq        qqqqqq
q qqqq
qqqqqq
qqqqq
qqqqqq
qq
qq
q                                                  qq qq
qq
qqqqq
qqqqq
qqqq
qqq
q qqqqq
q qqqqq
qqqqqqqq
q qqqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqqq                              qqqq
qqqq
qqqq
qqqqqqq qqqqq
qqqqq
qqqqq       qqqqqq
qqqqqq
qqqqq
qqqqqqq qqqqqqq
qqqqq
qq qq
qq qqqq
qq qq
qq qqq                                q qq
q qq
q qqq    qqqq
qqqq
q qqq q
qqqqq qqqqq
qqqqq
qqqqqqqqq
qqqqq
qqqqqqqqq
qqqqqqq                        qqqqqqqqqqqq
qqqqqqq qq q
qqqqqq
qqqqqqqqqqqq
qqqqqqqqqqqq
qq qqqq
qq qqqqqq
q
qq   qq
qq
qqqq                           qqqqqqq qqqq
qqqqqqq qqqq
qqqqqqq qqqq
qqqqqqqqq
qqqqqqqqqq
qqqqqqqqqqq
qqqqqq
qqq
qqqqq
qqqqqq
q
qqq
qqqqqqq
qqqqqq                     qq q qqqqqqq
qqqqqqqqqqqq
qqqq qqqqqqq
qqq
qqq qqqqqq
q      qqqqq
qqqqqq
qqqqq
qqqqqq
qqqq
qqqq
qqq                                                                                                qqq
qqqq
qqq
qqq
qq                       q qqqqqqqq
q q qqqqq
q    qqqq
q
qqqqq
qq
qqq
qqqqqq
qqq
qqqqq
qqqqqqqq
qqqqqqqq
qqqqqqqq
qqqq                qq
qqq
qq
qqq                                                                                                                  q
qqq
qq
qq
qqqq
qqqq                 qq
q
qqq
qqqq
qqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqq
qqqqqqqqqqqqqqqqqq         qq
qqq
qq
q                                                                                                         qqqqqqqqqqqqqqqqq
qq qqqqqqqqqqqqq
q
qqqqqqqqqqqqqqqqq
qq            qqq
qqq
qqq
qqqqqqqqqqq
qqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqqqqqq
qqqqqqqqqq                                                                                                                           qqqqqqqqqqqq
qqqqqqqqqqqqq
qqqqqqqqqqq
qq
qq

(a) n = 30.                                                                                                                             (b) n = 25.

qq
q
qq
qq
qqq
qq                                                                                                                                        qq
q
qq
q
qqq
qqq
qqq                                                                                                                                       qqqq
qq
qqq
qq
qq
qq                                                                                                                                         qq
qqq
q
q                                                                                          qqq
qq
qqq                                                                                                                                         qq
q
qq
qq                                                                                    qq qq
qq                                            q
q                                                                                          qqqq
qq
q
q
q
qq                                                                                  qq
qq
qq
qq
q                                             qq
qq                                                                                      qqq
qq                                                                                qq
qq
qq
q
q
q                                                                                     qq
qq
q
qq                                                                             qqq
qq
qqq
qq                                                                                 qq
qq
q qq
q
q
q                                                                        qqq
qqq
qqqqq                                                         qq                                                                            q q
q q
q q
q
q
qq
q                                                                 qq qq
qq                                                               q
q                                                                        qq
qqq
q
q
qq                                                             qqqq
q
q qq
qq                                                                  qqq
q                                                                  q
qqqq
q
qq
q
q                                                                                                                                     qq
qq
qq                                                       qq
qq q                                                                          q
q                                                             qq
qq
qq
q
q
qq                                                     qq
qq
qqq
qq
qq                                                          q
q
q q
q q q
q                                                qqq
qqq
qqq q                                                                                 q
q
qqqq
q qq
qq
q
q
q qqqq
qq q
qqqq
qqqq                                       qqq
qqq
qqq
qqq                                                                                      qq qq
qqq q
qq qq                                            qqq
qqqq
q   qqqq
qqqq
qqqq                         q qq q qq
q
q
q qq qqq
qqqq qqqq
qqqq qqq
q qq                                                                                                  qqqq
qqq
qqqqq                                qqq qqq
qq  qq
qqq qq
qqq
qq
q                       qqqqqqqq
q qq q q
qqq
qq                                                                                                             qqq
qqq
qqq                          qq q q
q qq
qq q
qqq
qqq q
qqq qq              qq
q                                                                                                                   qq
qqq                   qq
qq
q qqqqqq qqqq
qqq qqqqqqq
q qqqqqq qqqq
q          qqq
qqq                                                                                                                    qq q
q qq qqqq
q qq qqqq
qq qqqqq q q qq
qq
qq
q qqq
qq qq
q  q                                                                                                                                     qqqq
qq q

(c) n = 20.                                                                                                                             (d) n = 15.

qq
q
qq
q
qq
q
q
qq
qq
qq
q
q                                                                                         qq
qq
qq
q
qq
qq                                                                                   qq
qq
q
q                                                                                qq
qq
q                                                                           qq
q
qqq
qq
qq                                                                         qq
q q
q
q                                                                     qqq
qq                                                               q
q qq
qq
q
qq                                                              q
qq                                                         qq
qq
qq
q
qq
qqq
q
qq                                              qq
qq
qq
qqq
q
qq q
q qqq                                       qqq
qq
qq
qqq q
q qqq q
qqq                            qqqqq
qqq q
qqq qq
q
q q                     q q
q q
q qq
qqq
qqq
qqq              qq
qq
qqq
q qqqqq qqq
qqqqqqqqq
q   qqqq  q q
q

(e) n = 10.

Figure 8.6: Detected sub-pattern models at each scale (overlaid on expectations of the
measurement models).
8.5. Discussion                                                                          129

or by making an approximation that uses thresholds on the rotation and translation of
successive line segments.

The syntactic approach diﬀers from more traditional methods for curve detection,
such as the the Hough transform and deformable models, because it does not require
the speciﬁcation of a particular curve model, or constraints other than those imposed by
the estimated local model. This makes it similar to the snakes described in Chapter 5,
that only use local smoothness and continuity constraints. However, unlike snakes and
the other active contour methods which require an initialisation for each curve, synactic
shape detection does not require any initialisation, and it can therefore detect and count
the curves in an image without requiring input from the user or programmer.

This chapter also presented a multiscale approach to curve detection that alternately
updates the sub-pattern models and the measurement models. The resulting algorithm is
intended to allow curves to be detected in the presence of spatially varying noise. This
algorithm has only been demonstrated on a test curve and requires further evaluation.
130   Chapter 8. Syntactic curve detection

```
To top