Вы находитесь на странице: 1из 8

General Plane Curve Matching under Affine Transformations

Y. Zhu, L. D. Seneviratne and S. W. E. Earles Department of Mechanical Engineering ,King's College London, Strand, London WC2R 2LS, United Kingdom
It is common to use an anne transformation to approximate in dealing with the matching o plane f curves under a projective transformation. The plane curve itself can be used as an identity to solve the parameters o an a@ne transformation. The f objective o this paper is to obtain a closed form f f solution o the parameters using low order f derivatives o the plane curve. A unique solution to f the parameters o an anne transformation with up to second order derivatives i presented using s differential invariants as well as the available global information. The computational time on veriTcation has been significantly reduced. In computer vision, derivatives are obtained by numerical means. Achieving accurate numerical derivatives is an important application issue. Smoothing with a Gaussian filter modified by a linear combination of Hermite polynomials, can preserve the accuracy o f continuous polynomials with powers up to the same s order a the Hermite polynomials. In the discrete space, however, the introduction o Hermite f polynomials leads to a choice of a large smoothing scale D in order to reduce computational errors, at the expense o a reduction of local controllability f and over-smoothing o the curve. It is shown that f f using a oproportional to the order o the derivatives is more reliable in applications. hybrid affine invariants, applied to perspective projections of plane curves, since projective invariants often require unwieldy combinations of point correspondences and high order derivatives. Cohen and Wong [ l l ] locally (for a small patch) approximated the perspective projection by an &ne transformation that mimics the skewing and scaling effects associated with the perspective transformation. Boundary curves in computer images, dgtised by an integral grid, can be described in chain codes. They can be mathematically approximated into polygons, B-splines, Fourier descriptors, implicit algebraic polynomials, or autoregressive models. DdEerent representations of boundary curves contain different information, which can be used for dif&erent purposes such as data compression or pattern matching. Generally, boundary curves have different sizes. The curves in an image are physically observable, with inner scales limited to a finite range determined by the resolution of the sampling device. Once the inner scale is fixed, all smaller scale features of the curve are destroyed and can no longer be reconstructed [11. On the other hand, spurious details may be introduced by dwretization with certain scales. Motivated by classical differential invariant theory, Vaz and Cyganski [ 3 , 41 used a reparametrization method to determine linearly parameters of an aftine transformation. This method was generalised by Bruckstein et al. [5] to analyse general planar recognition from the local contour. They showed that for general viewing transformations there exist invariant signature fimctions with suitably reparametrized versions of plane curves, Arbter et al. [6] applied afine invariant Fourier descriptors to recognition of 3D objects based on a parameterized boundary description. Van Goo1 et al. [7] and Brill et al. [SI proposed the method of compromising, between a correspondence search and the order of

The concept of the affine transformation arises when weak perspective transforms are used to approximate projective transforms, assuming the depth of an object is small compared to the viewing distance, and extends to a more general class of 3 0 to 2D transforms where there is no restriction to the elements of the 2D transform matrix. It is common to use an affine transformation in dealing with plane curve matching under a projective transformation. Holt and Netravali [16] examined the accuracy of
Proc. IROS 96

0-7803-3213-X/96/ $5.00 0 1996 IEEE


daerentiation, which leads to a compelling class of invariants, called semi-hfferential invariants. Combined with known reference points the order of derivatives can be reduced. T h s is also true for other invariants under general viewing transformations. The pure diEerential method for an invariant signature under an H i n e transformation needs up to sixth-order derivatives. It requires up to fourth order derivatives with one known reference point. It is well-known that numerical differentiation is an ill-posed problem in the sense of Hadamard [2]. Simple finite dfference methods for derivative estimation do not provide the required insensitivity to spatial quantization errors and some form of local averagmg must be used to reduce the effects of these perturbations. The most promising candidate would seem to be smoothing with a low-pass Gaussian filter. Using a Gaussian filter on the discrete image data provides a quantitative link between continuous derivatives and discrete approximations, thus making the curve differentiable in any order. In the case of high order derivatives, noise reduction, due to the spatial averagmg in scale space more than counteracts noise enhancement by the high-pass nature of differentiation. The representation at zero scale is the same as the original curve, i.e. no smoothing has been done. With the increase of scale 6, the number of inflexion points in the curve decreases monotonously. It has a good local

solution to parameters of an affine transformation using up to second order derivatives is presented. Compared to Huang and Cohens method [lo], which has four solutions to be verfied, the computational time on verification has been significantly reduced without the cost of increasing the order of the derivatives. This can be considered as an extension of Van Gools [7] idea to the calculation of parameters of an &ne transformation.



There are six unknown parameters of an affine transformation; al17a1z,azl,azz7b1and bz, Eq. (1). They can be determined if the coordinates of three points on the original curve and the corresponding points on the transformed curve, are known. They can also be determined if a pair of correspondmg points with up to the fourth order derivatives are known [4]. In fact there are many ways of finding the unknown parameters, the two extremes being: using the most number of corresponding points without any derivatives, and using the least number of correspondmg points with the highest order of derivatives. If no corresponding points, but the whole curves or the corresponding parts of curves are available, a closed form solution is sought using the lowest order derivatives. 2 controllability, since the exponential function 3 In this section, the derivation of a unique solution decays very fast with respect to x. This is important to the parameters of an affine transformation using because Merent portions of the curve will undergo up to second order derivatives is presented. The different local transformations in a natural arc solution is based on dflerential relationships length. between the original and transformed curves. Cohen et al. [9-111 used B-splines for curve Let (x(t),y(t))denote the coordinates of the representation and recognition in affine invariant original curve as a function of the parameter t , and matchmg. It is well known that a B-spline curve is (u(t),v(t))the coordinates of the curve after an not uniquely described by a single set of control H i n e transformation as a function of the parameter points. With a different set of knot points, a different t. The transformed curve and original curve are set of control points can be induced, describing the related by the equation, same curve. Thus it is impossible to match two curves by directly comparing between their respective parameters. Cohen et al. employed minimum mean square error estimation (mmse) to obtain a B-spline representation which is also less sensitive to noise. Two methods are used to estimate the parameters of an affine transformation. Let Cand cf represent the original curve and the For the invariant signature methods, parameters transformed curve, respectively. The @ q , ) order of an aEine transformation are undetermined. Vaz weighted curve moments of Cand c a r e defined as: and Cyganski [4] obtained a unique solution of the 4 ( parameters of an affine transformation using up to m 7 (P, 1 = x ( t )Uq(t 1w 2 ( x t 1,U( t 1)dt C fourth order derivatives. In this paper, a unique


Mr(p,g)= J U (t 1vq (t )w7(u(t1),v(t))dt


where Wi(X(t),y(t))and wi(u(t),v(t))are the weighted functions of the original curve and the transformed curve, respectively. The relationships where C is the contour surrounding the region R, and between m i ( p , g ) a n d M , ( p , q ) are built through the differential invariants w i ( X t ),y ( t ))dt = w i (U ( t ), V ( t ))dt . ( =detlAl(3a11J xGkdy 3 4 1 2 ydxdy) (8) Let R and R represent the areas surrounded or 1,O) - b iM( 0,O) respectively. The (p,q) order area by Cand = det [AI (aiiE( 1,O) a n E ( 0,l)); moments of R and R are defined as




W 7 q ) = JJxpYqdydy M ( p , q ) = jjupvqdudv

Based on Eq. (1) the differential relationship between ( x ( t ) , y ( t ) ) and (u(t),v(t)) with respect to their independent variables t and t can be established as follows. First displace the translation b to the left side of the equation.

where &? indicates the area moments enclosed by the transformed curve and Z the area moments enclosed by the origtnal curve. It is well-known that areas are uniformly scaled by det [AI under an affine transformation, i.e. detlAl= W O , O )

E(1,O) m( 0,O)
+a12 -


Therefore, Eq. (9) can be written as _ . Differentiating Eq. (1) gives



M ( 0,O)




Now a matrix equation can be formed using a chain rule, [U-b1 du]=[all X G k (4)

In a similar way, it can be shown that = a21 E(1.0) + a22 m(071) +bz (12) M(O,O) m P,O) (04) The points



a21 a22 y dy

m(1,0) iii(0,l) ) ( E( 0,O) E( 0,O)


Equating the determinants of the above matrices yields

(udv - vdu ) + (bzdu - bldv) =det IAl(x& - ydx)


Applying this differential relationship to Eq. ( 2 ) gives


IAl(a11x +any)(xdy - y d x ) (6) ~ - V ~ )U h -tbzudu - bl(b2d~ b i h ) =det IAl[anx(xdy-y&)+alzy(xdy - y d x ) ] .

U ( udv

- vdu ) - bl( 2

From Greens theorem the relation between the integration along the closed curve and the integration on the area enclosed by that closed curve is

are the area centres of the (M(0,O) M(0,O) original curve and the transformed curve. Eqs. (1 1) and (12) show that the area centres are a pair of corresponding points under an affine transformation. The condition of Greens theorem requires that the curve C is closed. If a curve is open, a straight line can be constructed from the start point to the end point of the curve, and this is invariant under an f l i n e transformation. If the straight line intersects with the open curve, several closed areas are formed. Greens theorem is still applicable for each area. Therefore, the above result is valid for both open and closed curves. From Eqs. (l), (1 1) and (12), the translation b can be eliminated.



where Mi indicates the moments of the transformed curve with the weight wl(u,v)
-ci5 =

dV (c-dt'

-d5 -) dt'


mi the moments of the original curve with the weight




The four parameters of A

can be solved nonlinearly, given the first order of derivatives. If the second order derivatives of the curves are available, a derivative matrix relationshp and its related determinant equation are formed as in [4]:

then Eq. (13) can be written in a compact form as



In a similar way as Eqs. (4) and (3,

dv d2v -dtf dtf2

_ _ _ _

(Gfi- Vfi)=detlAl( X@ - jT&) (18) From Eq. (1S), Eq. (10) can be easily obtained since the area is independent of the coordinate system selection. Eq. (18) can be written in a parametric form as:

d$ dt

-& 7)dt'


=det IAl(X----y-)dt

4 -dF
dt dt

du d _ _ _ ~ _ 2 v dv d 2 u_- ~ d t f d t f 2 dt' dtl2 d x d ' y d y d 2 x dt det IAl (--- -~ dt dt2 dt dt2



du d 2 v dv -dt' u d2 dt' d t r 2 dt' d t t 2

Eq. (23) is independent of translation b. From Eas. (23) and (16), it can be shown that

2 where M indicates the moments of the transformed curve with the weight w l ( u , v ) = du d 2 v dv d 2 u
/ d l ' dt" dt'dt''



the moments of the original curve with the

dxd2y dt dt2 d --.y d ' x
dt dt2

Weight w 2 ( x , y )=

From Eqs.

(24a) and (24b) together with Eqs. (20a) and (20b), four closed form solutions to four parameters of A can be obtained. Huang and Cohen [lo] got similar results using a different method. The four solutions need to be verified and the verification process is usually very time-consuming.


The presented method can be further extended to reduce the number of solutions. One possible approach is to increase the order of derivatives from the second to the third. However, this is not necessary in this situation. If Eq. (22) is divided by Eq. (19X

diid2v -___-__ diid2ii dtdtf2 dtdtf2 -dii -dii U--vdt dt

&d2y @d2Y ) d dt2 d dt2 t t ( X4 y --cif -- ) d t d t


dt d t f 2 dtf =

d t
w3(u,v) =


&d2F dFd2U fi -dii ) / ( U 7- V -) dt d t f 2 dtdtf2 d t dt

and nu the moments of the original curve with the weight -


& d 2 Y @d2F d dt2 d dt2 t t

It should be pointed out that w3(x,y) and w3(u,v) respectively. This happens at the point whose tangent passes through the area center. It could be the case for some concave curves. Eqs. (24a) and (24b) together with Eqs. (27a) and (2%) g v e four linear equations of four unknowns of A. With Eqs. (11) and (12), b can be found. Thus, a unique solution to six parameters of an &ne transformation can be obtained, using up to second order derivatives of the original and transformed curves.

In order to estimate the parameters of an &ine transformation accurately, it is essential that h h g quality derivatives up to the second order can be obtained from the image data. One problem with Gaussian filtering of coordinate functions is that it results in a shrinking of the closed curves. The larger the curvature or the scale of smoothing, the greater the amount of shrinkage. Lowe [12] suggested a method to compensate for the shrinkage of a smoothed curve. Weiss [13] also pointed out that a systematic over-smoothing error is introduced when random noise is smoothed out using the Gaussian kernel. Generally, smoothing reduces the accuracy even in the analytic case, as rapid changes in the function are smoothed out. The ideal balance between smoothing and accuracy is to maintain the accuracy of changes on a certain scale or larger, but smooth out the smaller features in the image, assuming that any changes below that scale are noise. Weiss gave a modfied Gaussian filter by a linear combination of up to mth order Hermite polynomials, to keep up to mth powers of polynomials from error, because Hermite polynomials are orthogonal with respect to the Gaussian weight function. Any point of a curve can be approximated by a Taylor expansion. This method has also been used to deblur the Gaussian blur of an image caused by errors of devices [14]. In general, the process of reversing the Gaussian blur is unstable and cannot be represented as a convolution filter in the spatial domain. A convolution inverse exists if the allowable functions are polynomials of a fixed finite degree. The Gaussian derivative function can be expressed in terms of Hermite polynomials. Let the normalised Gaussian kernel be

and its nth order derivatives

0 -



where Hn are nth Hermite polynomials and 0 is a smoothing scale. Fig. 1 shows the Gaussian kernel modified by up to tenth order of Hermite polynomials F i o and its first and second order derivatives, Fio and Fio . F i o , FIO and F1o are more oscillatory than g ( t ;U), g(t; D) and g(t; U) [2], respectively. From the simulation [ 181, it can be seen that: 1). For the normal Gaussian and its derivatives, large cs will cause over-smoothing of the original curve. Errors will increase when cs is beyond a certain


value. The modified Gaussian and its derivatives improve approximation when CJ is suj3ciently large. The optimal CJ is smaller without modification than with modification. The introduction of Hermite

polynomials leads to a choice of large cs in order to reduce computational errors, whch means a reduction of local controllability of the Gaussian kernel and over-smoothing of a curve.

Fig. 1 The modified Gaussain and its first and second order derivative kernels (Curve 1: the modified Gaussain kernel; Curve 2: its first order derivative kernel; Curve 3: its second order derivative kernel)
2). With higher order derivatives, a larger CY is required to reduce computational errors. Generally, the error of second order derivatives is larger than that of first order derivatives. Therefore, the use of as low order as possible of derivatives in the matching schemes is of practical significance. 3 ) . In some areas, digitization produces predominant relative errors and even the mocllfied Gaussian kemel cannot alleviate them. This would cause a large error in the calculation of the weighted moments listed in the last section. It is therefore recommended to use dfferent cs corresponding to different order derivatives with the normal Gaussian kernel. For smoothing coordinate functions, small cs is used ( ~ 4 - 6 ) ; for first order derivatives, 0-6-8; and for second order derivatives, ~8-12.

intervals of the curve being available: At = 1, if two neighbouring points are vertically or horizontally adjacent; or At = A,if two neighbouring points are diagonally adjacent. Both digitisation and smoothing destroy some details of the curve especially for high order derivatives. Assuming the functions of the original curve and the transformed curve are known, the parameters of an affine transformation can be obtained accurately. For example, suppose the original curve is (Fig. 2a): x( 8) = cos( 8) + sin( 8); (30) y ( 8 ) = sin(8)(1+cos(Q)). where 8 is the parameter variable. The transformed curve is given by (Fig. 2b):
u(Q)=cos(Q)+(1+-)smn(B)+-m(Q)cos(8)+10.O, 3 3


.I J


-3&) smn(B) cos(Q) v(Q> (6 = 2



1 . + - m(s1 3

+ 20.0.
(3 1)

The new method for obtaining the closed form 1 &/3 solution of the parameters of an affine transformation AI=[ is tested in this section. -&/2 113 In cllgital space, the arc length is a feasible variable for coordinate functions of each point The results are ( x ( t ) , y ( t ) ) .The digitisation leads to only two

i. e.

1, " 1.




0.5773501, -0.866025 0.333333

bi* = 10.01.


and the results are

If the digital images of the orignal curve and the A2*= 0.679361 0.552514 transformed curve subject to the following affine transformation are available (Fig. 2c); 19.00542 4 1 2 b2*=[ 52.39943 h=[ 1'2 b:=[t:]. (33) 4 2 112 It should be pointed out that due to the errors in the estimation of the coordinate functions, their first and second order derivatives and their unknown distributions, which are either not zero mean or even, cannot be cancelled in the integration process, the matching process is not stable. It can be seen that if a curve is symmetric to an arbitrary point, m (1,O) and m (0,l) in Eqs. (24a) z and (24b), m3 (1,O) and m3 (0,l) in Eqs. (27a) and (27b) are zero. So are Mz(l,O), Mz(O,l), W(1,O) and M (0,l). If a curve is symmetric to an arbitrary axis, 3 m (1,O) and m (0,l) are dependent. So are the other three pairs of the moments. The derived method cannot be directly used with symmetric curves. If bitangents can be found in the concave part of a. the original curve described in Eq. (30) the curve, two points of tangency are constructed. These two points, together with the centre of area, composed of the curve and the bitangent, can be used to determine the parameters of an &ne transformation. This is the alternative way to a solution, where only the first order derivatives are employed and seem to be more reliable than higher order derivatives. This method is still valid even if other parts of the curve are occluded. If a further pair of points are obtained by constructing lines through each of the two tangent points to the curve elsewhere, these four points build a canonical frame which is invariant under a projective transformation [151.

0.497063 -0.695703



b. the transformed curve described in Eq. (31)


the transformed curve described in Eq. (33)

: :

The study of planar shapes, defined by their outer contours, is common in image analysis and computer vision. The objective of this paper is to obtain a closed form solution to the parameters of an &ne transformation using the lowest possible order of derivatives, given the whole curves or the corresponding part of curves are available. Due to the employment of the global information, which is the correspondence of area centers, a unique solution to these parameters is presented using up to second order derivatives. Compared to Huang and Cohen's method, the number O SOlUtiOnS is reduced without f any cost in increasing the order of derivatives. The main idea 1s to make full Use Of differentid relations

Fig 2 the original and transformed CUWeS


as well as the available global information. The results can be seen as a midway between the two extremes mentioned at the beginning section 2. The application of this method requires the accurate estimation of derivatives. In digital space, smoothing is necessary and the Gaussian kernel is the common choice. Generally smoothing reduces the accuracy even in the analytical case. During the smoothing process, segments with highly curvature will move inwards faster than slightly curved ones, so that the whole curve becomes smoother. When modified by a linear combination of Hermite polynomials, Gaussian smoothing can preserve accuracy for the continuous polynomial functions of powers up to the same order as the Hermite polynomials. However, the modification by Hermite polynomials increases the power of ( t / 0).To reduce computational errors in digital space, a large CJ should be chosen at the expense of a reduction of local controllability and sometimes over-smoothing of a curve. The observation of this paper is made that using different CJ values, corresponding to different order derivatives, better results are obtained in practice. The method has been tested with digital curves. Due to the errors of numerical derivatives and their unknown distributions, the matching result for digital curves is not stable. The presented method cannot be Qrectly used when a curve is symmetric to any point or any axis because the values of the moments become zero and the parameters of an affine transform matrix can not be solved.

1. L. M. J. Florack, B. M. ter Haar Romeny, J. J. Koenderink and M. A. Viergever, Scale and the differential structure of images, Image & Vision Comput. Vol. 10, pp 376-388, JulylAugust 1992. 2. T. Lindeberg, Scale-space theory in computer vision, Kluwer, Amsterdam, 1994. 3. R. F. Vaz and D. Cyganski, Generation of a i n e invariant local contour feature data, Pattern Recognzt. Lett. Vol. 11, pp. 479-483, 1990. 4. D. Cyganski, J. A. Orr, T. A. Cott and R. J. Dodson, An affine transform invariant curvature function, Proc. 1st Int. Con$ Comput. Vision, pp. 496-500, London, UK, 1987. 5. A. M. Bruckstein, R. J. Holt, A. N.Netravali, and T. J. Richardson, Invariant signatures for planar shape recognition under partial occlusion, CVGIP: Image Understanding, Vol. 58, No. 1, pp. 49-65, July 1993.

6. K. Abter, W. E. Snyder, H. Burkhardt and G. Hirzinger, Application of affine invariant Fourier descriptors to recognition of 3D objects, IEEE Trans. Pattern Anal. Machine Intell., Vol. 12, PAMI-12, NO. 7, pp. 640-647, July 1990. 7. L. J. Van Gool, T. Moons, E. Pauwels and A. Oosterlinck, Semi-differential invariants, Geometrical Invariance in Computer Vision, J. L. Mundy and A. Zisserman editors, MIT Press, 1992. 8. M. H. Brill, E. B. Barrett and P. M. Payton, Projective invariants for curves in two and three Qmensions, Geometrical Invariance in Computer Vision, J. L. Mundy and A. Zisserman editors, MIT Press, 1992. 9. F. S. Cohen, Z. Huang and Z. Yang, Invariant matching and identification of curves using B-splines curve representation, IEEE Trans. image Processing, Vol. 4, No. 1, pp. 1-10, Jan. 1995. 10. Z. Huang and F. S. Cohen, Affine-invariant Bspline moments for curve matching, Proc. CWR94, pp. 490-495, 1994. 11. F. S. Cohen and J. Wang, Part I: modeling image curves using invariant 3-D object curve models--A path to 3-D recognition and shape estimation from image contours, IEEE Trans. Pattern Anal. Machine Intell., Vol. 16, PAMI-16, No. 1, pp. 1-12, Jan. 1994. 12. D. G. Lowe, Organization of smooth image curves at multiple scales, International Journal of Computer Vision, Vol. 3, No. 2 , pp. 119-130, 1989. 13. I. Weiss, Noise resistant invariants of curves, Geometrical Invariance in Computer Vision, J. L. Mundy and A. Zisserman eQtors, MIT Press, 1992. 14. R. A. Hummel, B. Kimia and S. W. Zucker, Deblurring Gaussian blur, CVGIP Vol. 38, No. 1, p ~66-80, 1987. . 15. A. Zisserman, D. A. Forsyth, J. L. Mundy, C. A. Rothwell, Recognising general curved objects efficiently, Geometrical Invariance in Computer Vision, J. L. Mundy and A. Zisserman editors, MIT Press, 1992. 16. R. J. Holt, A. N. Netravali, Using affine invariants on perspective projections of plane curves, Computer Vision and Image Understanding, Vol. 61,No. 1,pp. 112-121, Jan. 1995. 17. G. Szego, Orthogonal polynomials, American Mathematical Society, Providence, Rhode Island, Fourth Edition, 1975. 18. Y. Zhu, L.D. Seneviratne and S. W. E. Earles, General plane curve matching under &ne transformations, Internal Report, Dept. of Mechanical Eng., Kings College London, U. K.