• Aucun résultat trouvé

Fourier Descriptors

Dans le document Advances in Pattern Recognition (Page 45-49)

2.2 Global Feature Vectors

2.2.5 Fourier Descriptors

2.2.5.1 Main Idea

Instead of using the original image representation in the spatial domain, feature val-ues can also be derived after applying a Fourier transformation, i.e., in the spectral domain. The feature vector calculated from a data representation in the transformed domain, which is called fourier descriptor, is considered to be more robust with respect to noise or minor boundary modifications. This approach is widely used in literature (see, e.g., [17] for an overview) and shall be illustrated with the help of the following example.

2.2.5.2 Example

So-called fiducials of PCBs, which consist of simple geometric forms (e.g., cir-cle, diamond, cross, double cross, or rectangle; cf. Table2.3), are used for accurate positioning of PCBs.

Table 2.3 Examples of different fiducial shapes

The task considered here is to extract the geometry of the fiducials in an auto-matic manner. To this end, a classification of its shape has to be performed. This shape classification task shall be solved with Fourier descriptors; the process is visualized in detail in Fig.2.8.

First, an image of the object, which is selected by the user and exclusively con-tains the fiducial to be classified, is segmented from the background. Next, the contour points of the segmented area (e.g., all pixels having a direct neighbor which is not part of the segmented object area) and their distance to the object center are determined.

When scanning the contour counterclockwise, a “distance function” consisting of the progression of the pixel distances to the object center can be built (also referred to as “centroid distance function” in literature). In order to compare structures of different size, this function is resampled to a fixed length, e.g., 128 values. Such a centroid distance function is an example of the more general class of so-called signatures, where the 2D information about the object contour is summarized in a 1D function. For each geometric form, the fixed-length distance function can be regarded as a distinctive feature vector.

In order to increase performance, this vector is transformed to Fourier space.

This Fourier description of the object contour (cf., e.g., [4] or [16]) is a very

Fig. 2.8 Example of feature vector classification: locally intensity normalized image seg-mented objectobject boundarycentroid distance functionFourier-transformed centroid distance functionclassification vector (smallest distance marked blue)

compact representation of the data. Just a few Fourier coefficients are sufficient for a distinctive description if we deal with “simple” objects. Classification is done by nearest-neighbor searching in Fourier space, i.e., calculating the Euclidean dis-tance of the Fourier-transformed feature vector of a scene object to the known Fourier-transformed feature vectors of the prototypes. Each prototype represents one geometric form (circle, cross, etc.).

2.2.5.3 Modifications

As an alternative, a wavelet representation of the object contour can also be used (e.g., [5]). Compared to Fourier descriptors, wavelet descriptors have the advan-tage of containing multi-resolution information in both the spatial and the frequency domain. This involves, however, that matching is extended from 1D (which is very fast) to a more time-consuming 2D matching. Fourier descriptors can be com-puted and matched fast and have the desirable property to incorporate global and local information. If the number of coefficients is chosen sufficiently large, Fourier descriptors can overcome the disadvantage of a rather weak discrimination ability, which is a common problem of global feature vectors such as moments.

The characterization of objects by means of Fourier descriptors is not restricted to the object boundary (as it is the case with the centroid distance function). Fourier descriptors can also be derived from the region covered by the object. A calculation based on regions is advantageous if characteristic information of the object is not restricted to the boundary. The descriptor representation is more robust to boundary variations if regional information is considered in such cases.

A straightforward approach would be to calculate the descriptors from the 2D Fourier transform of the intensity image showing an object. However, this is not rec-ommendable as neither rotation invariance nor compactness can be achieved in that case. In order to overcome these limitations, Zhang and Lu [17] suggest the deriva-tion of so-called “generic Fourier descriptors” from a modified polar 2D Fourier transform: to this end, a circular region of the original intensity image is sampled at polar coordinates r and θ and can be re-plotted as a rectangular image in the [r,θ]-plane. The [r,θ]-representation is then subject to a conventional 2D Fourier transform. Figure2.9illustrates the principle.

The Fourier descriptors can be derived by sampling the thus obtained Fourier spectrum (which is the amplitude derived from the real and imaginary part of the transformed signal); see [17] for details. They stated that as few as 36 elements are sufficient for a compact and distinctive representation. For speed reasons, compar-ison of objects is done by evaluating the so-called city block distance of descriptor vectors instead of the Euclidean distance, where simply the differences between the two values of elements with identical index are summed up.

Without going into details, let’s briefly discuss the properties of the modified polar 2D Fourier transform: First, a rotation of the object in Cartesian space results in circular shift in polar space. This circular shift does not change the Fourier spec-trum and hence rotation invariance of the descriptor can be achieved in a natural way. Moreover, since the gray value image is a real-valued function, its Fourier

FFT

Sampling

[]

GFD

Fig. 2.9 Illustrative example for a calculation of generic Fourier descriptors with a 1 Euro coin: Original image: 1 Euro coinCircular image region re-plotted after polar transforma-tionMagnitude of Fourier transformed signal of the polar imageSamplingDescriptor Calculation

transform is circularly symmetric. Therefore, only one quarter of the spectrum func-tion is needed to describe the object. That’s the reason why the light blue sampling points in Fig.2.9are all located in the upper left quadrant of the spectrum.

Compared to the Fourier spectra directly calculated from an x, y

-representation, it can be observed that polar Fourier spectra are more concentrated around the ori-gin. This is a very desirable property, because for efficient object representation, the number of descriptor features which are selected to describe the object should be as small as possible. The compact representation allows a fast comparison of objects, which makes the method applicable in online retrieval applications. Despite still being a global scheme, the method can also cope with occlusion to some extent.

However, a proper segmentation from the background is still necessary.

2.2.5.4 Pseudocode

function classifyObjectWithGFD (in Image I, in model descriptors dM,i, in distance threshold t, out classification result c)

// calculate generic fourier descriptor of I

perform background subtraction, if necessary: only the object has to be shown in the image

IP ← polar transform of I

FI ← FFT of IP // two components: real and imaginary part AI

Re{FI}2+Im{FI}2 // power spectrum a ← 0

for m = 0 to M step s for n = 0 to N step s

derive GDF element dI(a) from AI(m, n) a ← a + 1

next next

// calculation of similarity to classes of model database for i = 1 to number of models

dist(i) ← city block distance between dI and dM,i next

if min(dist(i))t then c ← index of min else

c ← -1 // none of the models is similar enough end if

2.3 Principal Component Analysis (PCA)

Dans le document Advances in Pattern Recognition (Page 45-49)