# Shape Matching

**Abstract**

Describe several algorithms that provide both rigid and non-rigid point-set registration. The point sets are represented as probability density functions and the registration problem is treated as distribution alignment. Using the PDFs instead of the points provides a more robust way of dealing with outliers and noise, and it mitigates the need to establish a correspondence between the points in the two sets. The algorithms operate on the distance between the two PDFs to recover the spatial transformation function needed to register the two point sets. The distance measures used are based on various famous inequalities/divergence measures. The algorithms have been shown to be robust to noise and outliers, and perform well in varying degrees of transformations and noise.

**Cauchy-Schwarz Divergence**

Given to density functions and , Cauchy-Schwarz divergence () measures the similarity between them in similar fashion to the Kullback-Leibler divergence. The measure is derived from the Cauchy-Schwarz inequality

,

where, for pdfs, the equality holds if and only if with . To simplify the calculations, we take its square and the Cauchy-Schwarz divergence of two PDFs is defined as

.

is a symmetric measure and , where the equality holds if and only if latex $f(x)=g(x)$. However, the triangle inequality property does not hold, so it cannot be considered a metric. can be broken down to and rewritten as:

.

The argument of the first term, , estimates the interactions on locations within the support of when exposed to the potential created by (or viceversa). This term measures the similarity (distance) between the two PDFs and it is *Renyi’s quadratic cross entropy*. It can also be interpreted as the information gain from observing with respect to the “true” density . The other two terms are the negative Renyi’s quadratic entropies of the respective PDFs and are considered as simply normalizing terms that act as regularizers. Thus the Cauchy-Schwarz divergence can be interpreted as:

.

**Matching Algorithm**

Suppose we have two point sets and , where . The kernel (Parzen) estimate of the PDF of an arbitrary point using an arbitrary kernel function is given by , where is the bandwidth parameter. The Gaussian kernel, , is considered as the kernel of choice for its properties: symmetric, positive definite, approaches zero as points move away from the center, and the decaying factor can be controlled via the kernel bandwidth.

Substituting the Gaussian kernel PDF estimator in the Cauchy-Schwarz divergence and performing some straightforward manipulations (the integral of the product of two Gaussians is *exactly evaluated* as the value of the Gaussian computed at the difference of the arguments and whose variance is the sum of the variances of the two original Gaussian functions results in the estimator:

.

To align the two mixtures and , the density function needs to undergo some transformation which can be broken down into two parts: 1) *affine* transformation, which is the first step in aligning the point sets and accounts for the major differences between the two PDFs caused due to rotation, scaling, translation, etc. and 2) *non-rigid* transformation, which accounts for deformations due to nonrigid motions that the objects have gone through. The transformations can then be expressed as:

**Rigid and Affine Point Matching**

A basic transformation function involving only rotation and translation applied to a point can be written as follows , where is the rotation angle, is the rotation matrix and is the translation vector. To represent both the translation and affine transformations in a matrix form, we consider homogeneous coordinates where the original vector points are extended to dimensions with the last element being one. Taking this into consideration and considering that the second term depends only on the desired point set and its value never changes nor does it affect the transformation function, thus removing it from future considerations of the cost function, our cost function becomes:

.

Differentiating with respect to the transformation matrix and equating the gradient to zero results in the fixed point update rule shown below. Notice that the transformation matrix is present in both sides of the equation. While there exist many ways of performing the fixed point update, this particular solution was chosen because of its smooth behavior on across iterations.

**Non-rigid Point Matching**

The point matching problem becomes more challenging when non-rigid transformation is also required. To represent the non-rigid deformation, we use radial basis functions (RBF) with the Gaussian kernel as its type. The Gaussian kernel, as mentioned above, is chosen for its symmetric property and because it quickly approaches zero as the distance increases with respect to the bandwidth parameter. Controlling the bandwidth parameter gives us the flexibility to control the decaying factor of the kernel function and thus the rigidity of the transformation. The transformation function becomes:

,

where is the matrix representing the affine transformation, is a warping coefficient matrix representing the non-rigid transformation, and is RBF with size .

In the non-rigid case, there exist many ways of mapping one point set to another. Thus, a smoothness constraint is required to discourage arbitrary mappings and restrict the flexibility of the correspondence between the two point sets. To control the behavior of the mapping, a smoothness measure is required. The TPS-RPM algorithm uses the space integral of the square of the second order derivatives of the mapping function, the thin-plate spline. The CPD algorithm controls the “oscillatory behavior” by using a low-pass filtering function. In our algorithm, we control the smoothness by constraining the non-rigid freedom with respect to the affine transformation. The cost function becomes:

.

Since the correspondence between the random variables and is known, we can measure how similar they are in the neighborhood of the joint space by using another measure known as *correntropy* [1], which is a generalized correlation involving high-order statistics. Cross-correntropy between two random variables and is defined as , where can be any non-negative definite kernel. The cost function then becomes:

.

Using an estimator of correntropy based on the data available, we get the non-rigid cost function:

where is a symmetric Gram matrix of initial point sets with elements . Taking the derivative with respect to and and solving for each of the transformation matrices results in an update rule similar to the fixed point update rule above.

**Experiments and Results**

Browse the links below to see details and results of shape matching using :

- 2D Rigid, Nonrigid, Noise & Outliers
- 3D example
- MPEG-7 database
- ONR 3D – 2D projection

**(to be continued)**

this work is currently under review, more information to follow.