• Aucun résultat trouvé

Turning Functions

Dans le document Advances in Pattern Recognition (Page 147-151)

6.4 Distance Measures for Curves

6.4.1 Turning Functions

6.4.1.1 Main Idea

According to van Otterloo [9], a so-called turning function can be calculated from a polygonal approximation of the curve. In a second step, two polygons can be com-pared by means of a distance metric based on the discrepancies of their turning functions. For the moment, let’s assume that a suitable polygonal approximation of the object contour, i.e., a polygon consisting of line segments located in the vicinity of the object boundary, is already available (see Chapter 4 how such an approximation can be obtained).

The turning function Tp(s) of a polygon p defines the cumulative angle between the line segments of the polygon and the x-axis as a function of the arc length s, which increases from 0 to 1 as the polygon is traversed. Starting at an end point

s T

Fig. 6.6 Example for the calculation of Tp(s): The polygon is depicted in the left part; the deduced turning function can be seen on the right. The starting point is marked light blue

of p (or, equivalently, at s= 0), T is initialized by the angle between the line seg-ment which contains the end point and the x-axis. As s increases, the value of Tp(s) is changed at each vertex connecting two line segments of the polygon. Tp(s) is increased by the angle between two successive line segments if the polygon turns to the left and Tp(s) is decreased by the angle between two successive line segments if the polygon turns to the right (see Fig.6.6).

Let’s have a look at some properties of the turning function: First of all, it can easily be seen that T is translation invariant. As the polygons are normalized such that s ranges from 0 to 1, the turning function is scale invariant, too. A rotation θ of the polygon leads to a vertical shift of T. In the case of closed contours, a

“movement” of the starting point along the contour results in a horizontal shift of T.

Apart from these shifts, which can be identified easily, turning functions are suitable for a comparison of polygons featuring minor deformations due to their cumulative nature: even if the course of the polygon is different at a certain position, in cases where the polygons are perceptually similar the cumulative angle should be similar, too. This is a very desirable property for flexible model fitting.

Based on the turning function, a distance metric d(a, b)between two polygons a and b, which integrates the differences of the cumulative angles, can be calculated as follows:

d(a, b)=

1

0

|Ta(s)Tb(s)+θ0|nds

⎠ 1/n

(6.15)

where Ta(s) and Tb(s) denote the turning functions derived from the polygons a and b. The parameter n is often chosen to n = 2. With the help ofθ0 a possible rota-tion between the two polygons can be compensated:θ0is chosen such that d(a, b) is minimized. As a consequence, the metric is invariant to the class of similarity transformations.

An example can be seen in Fig.6.7: Two polygons differing especially in one vertex in their upper right part are compared there. The differences of their turning

s T

Fig. 6.7 Example of the turning-function-based distance metric

functions are indicated by gray areas in the right part of the figure. Observe that the arc lengths in T are normalized: actually, the light blue polygon is longer than the dark blue polygon. Despite considerable appearance variations between the two polygons, their turning functions are quite similar, which correlates well with the visual perception of the polygons: the basic characteristics of both polygons are usually perceived similar by human observers.

6.4.1.2 Example

Latecki and Lakämper [4] presented an object recognition scheme based on the turning function as distance measure for the comparison of curves. The method starts when the curve approximating the border of a query object has already been extracted, e.g., by a proper segmentation scheme or a snake refinement. Recognition then consists of the following steps:

1. Polygonal approximation of the curve: every planar curve can be represented by a series of pixels which define the locations of the curve in 2D space. This pixel representation can already be interpreted as a polygon, because any two consecu-tive pixels define a very short line segment. Of course, such a (initial) polygonal representation is of little use in respect of the turning function as even small amount of noise causes many turns. Hence, an iterative process called discrete contour evolution or discrete curve evolution (DCE) is applied. At each iteration step, the two line segments l1and l2with the least significant contribution to the curve are replaced by a single new line segment which connects the outmost two end points of l1and l2(see also Fig.6.8) The significance of the contribution is measured by a cost function which increases with the turning angle between l1

and l2as well as the length of the segments. The iteration stops if the previously defined distance metric d(p0, pi)between the initial curve p0and the polygonal approximation pi at iteration step i exceeds a certain threshold. This proceed-ing results in a smoothproceed-ing of spurious and noisy details while the characteristic course of the curve is preserved at the same time.

2. Distance metric calculation: once an appropriate polygonal approximation of the object contour is available, its similarity to objects stored in a model database can

Fig. 6.8 Example of discrete curve evolution (DCE) taken from Latecki and Lakämper [4] (©

2000 IEEE; with permission). A few iteration stages of the DCE algorithm are shown when approx-imating the contour of a fish. The original contour is presented in the upper left part. At first, variations of small scale are removed. Finally, an entirely convex polygon remains (lower right)

be calculated with the help of the turning function-based distance metric defined by (6.15). Bear in mind, though, that a global representation of the object contour by means of a single closed polygon is sensitive to occlusion. Therefore, in order to increase robustness, the polygons are split into visual parts, and each part vpi

is compared separately to a part of a model polygon or concatenations of such parts. Details of this partitioning can be found in [4].

3. Classification: based on the previously computed distances to the objects of a model database, the assignment of the query object to a certain model object can be made, e.g., by nearest-neighbor classification (cf. also Appendix B).

6.4.1.3 Pseudocode

function classifyCurveTurningFunction (in Image I, in boundary curve v(s) of object in scene image, in visual parts vpM of all models, in maximum polygonal approx. deviation tp,max, in similarity threshold tsim, out model index m)

// DCE approximation

// set initial polygonal approximation to boundary curve p0v(s)

i ← 0; dev ← 0 while devtp,max do

sigmin ← MAX_FLOAT // init of significance minimum // detect the two least significant lines

for j = 1 to number of lines of pi-1 for k = j + 1 to number of lines of pi

calculate significance sigj,k of lines lj and lk for polygon pi

if sigj,ksigmin then sigminsigj,k end if

next

next

replace the two lines from which sigmin was derived by one line connecting their outer endpoints in pi devd(p0, pi)// compare p0 to pi acc. to Equation 6.15 ii + 1

end while

split pi into visual parts vpS,i and store them in list vpS // classification

for each model index m // loop for all database models errm ← 0 // cumulated turning function discrepancies for i = 1 to number of visual parts (elements of vpS)

find closest match vpm,k to vpS,i (Equation 6.15) increment errm according to d(vpm,k,vpS,i)

next next

find model index mmin with smallest deviation error errm,min if errm,mintsim then

// valid object class identified return mmin

else

return -1 // in order to indicate an error has occurred end if

6.4.1.4 Rating

The authors regard the main strength of their method to be the capability to find correct correspondences between visual salient parts of object contours. The DCE-algorithm, which can be seen as a pre-filter, effectively suppresses noise, which facilitates the matching step. The method proved to outperform many other schemes in a comparative study, where database retrieval applications were simulated [5].

However, the partitioning into parts with subsequent combinatorial matching also involves a considerable increase in computational complexity. Moreover, the scheme concentrates on classification; an estimation of the pose of the object being approximated by the polygon is not straightforward.

Dans le document Advances in Pattern Recognition (Page 147-151)