7.6 Results
8.1.2 Template Matching on Surfaces
The algorithms described so far do not work for arbitrary surfaces. The 2D algo- rithm assumes a planar grid and the 3D algorithm only works for grids describing volumes. When the surface can be projected onto a planar grid like the delta wing in Figures 6.9 and 6.11, the 2D algorithm can be applied. It is also possible to project the surface only locally onto a planar grid, which is a lesser constraint.
For a 2D irregular grid, one idea was to use a local resampling of the field. For a surface, however, determining the positions for the convolutions is not straight forward as the template is planar and the surface can have a complicated form. Thus, the template has to be deformed to fit onto the surface. One approach to implement this is to use geodesics:
Definition 8.1.1 A geodesic is the locally shortest path between two points.
In an Euclidean space, a geodesic is always a straight line. On a surface, however, the form of the geodesic can be quite complex. Furthermore, it is not always
unambiguous, e.g. in the case of two antipodal points on a sphere there are many shortest connections.
To determine the sampling positions, the geodesics are started at the posi- tion where the convolution is to be computed. The direction and length of the geodesics is given by the vectors from the center of the template to the corre- sponding nodes. The end points of these geodesics determine the positions on the surface which are needed for the convolution computation (Figure 8.4).
Note that it is not advisable to transfer the other approaches of local resampling where the template is resampled at the grid nodes of the flow field. For these approaches, geodesics from the neighboring nodes of the surface to the position where the convolution is computed would need to be determined. This is not solvable other then by brute force as the path of the geodesics is not predictable enough.
Figure 8.4: For matching on surfaces, the planar 2D templates have to be fitted to the surface, here a sphere. This can be done using geodesics: At the position where the convolution is to be computed, geodesics are started with direction towards the template nodes and with corresponding length. Thus, the positions for the computation of the convolution can be determined. Left: Sphere and planar template. Middle left: Direction and length of the geodesics are determined.
Middle right: The actual geodesics determine the convolution positions on the
sphere. Right: The template was fitted on the surface.
8.1.3
Results
Irregular Grids
For template matching on irregular grids, we have chosen two test data sets from real applications. The first data set is the OM06 (Section 6.2), and the second is the flattened surface of the delta wing (Section 6.4).
For the OM06 data set, which is defined on a regular grid, the results differ only slightly (Figure 8.5). The highest difference can be seen at the border, due to the different approaches of dealing with the missing values outside the field
(Section 3.6.1). For the computation of Figure 8.5, the missing values were as- sumed to be zero for simplicity of the computation. Using local resampling of the template automatically assumes ideal behavior of the flow outside the data set, as only the existing values influence the number of compared positions. Higher similarities at the border of the data set are the result. Note that using only the 1- neighborhood corresponds to matching with a 3× 3 template, which is the reason for the difference to the results when using a 5× 5 template.
Looking at Figure 8.6, the images of the results of resampling the template seem to be splotchy. This has a couple of reasons. First, the data set has some cells of size zero which distorts the results of the convolution. This is an extreme
Figure 8.5: Pattern matching of a 2D vector field with a 5× 5 rotation template. The grid is regular. The similarity values are normalized. Light areas corresponds to the highest similarity and to a righthanded rotation in the field and dark areas to a lefthanded rotation, as a righthanded rotation template is changed into a left- handed by multiplication with -1. Top left: Local resampling of the field. Top
right: Local resampling of the template. Bottom left: n-neighborhood. Bottom right: 1-neighborhood.
Figure 8.6: Regions of convergence (red) and divergence (blue) on the wing. Adaptive color coding of the results of pattern matching with a 5× 5 convergence template. The grid is irregular. Top left: Local resampling of the field. Top right: Local resampling of the template. Bottom left: n-neighborhood. (Bottom left: 1-neighborhood.
example distortion which different cell sizes introduce into the convolution using
n-neighborhood or 1-neighborhood. Cells which have large aspect ratios cause
the same problem. Another reason for the differences is the resampling process which is based on interpolation of the grid points. Thus the first two approaches show different results although in the continuous case they would have exactly the same results.
In Table 8.1 and 8.2, timings of Clifford convolution and pattern matching on two different data sets are given. Local resampling of the template is the slowest approach for both data sets. The OM06 is defined on a regular grid, thus local resampling of the field is faster than local resampling of the template based on
n-neighborhood as the point location is not as expensive as on irregular grids.
hood is more sensitive in terms of noise. Therefore, local resampling of the field is the best approach so far.
Table 8.1: Timings for computing one Clifford convolution on the OM06 and the flatwing data sets on a 1,3 Ghz computer
dataset size of resampling resampling n-neigh-
template of field of template borhood
swirl. jet 3× 3 4 s 75 s 5 s
(12524 p) 5× 5 6 s 314 s 24 s
delta wing 3× 3 33 s 88 s 10 s
(25800 p) 5× 5 90 s 390 s 40 s
Table 8.2: Timings for complete template matching on the OM06 and the flatwing data sets on a 1,3 Ghz computer
dataset size of resampling resampling n-neigh-
template of field of template borhood
swirl. jet 3× 3 8 s 88 s 10 s
(12524 p) 5× 5 16 s 352 s 40 s
delta wing 3× 3 65 s 103 s 21 s
(25800 p) 5× 5 183 s 441 s 66 s
Surfaces
Due to the computation of the geodesics, the computation of template matching on surfaces is slow. It took several hours to compute the template matching for the ICE front wagon (Section 6.5). The results are robust and as expected when comparing it to the LIC image (Figure 8.7). The region of divergence at the tip of the ICE train, where the wind hits the train, is clearly visible. Thus, template matching on arbitrary surfaces is possible though the computational effort is high.
Conclusion
Local resampling of either field or template is slow in comparison to the timings on a regular grid. This is due to the computation of the interpolation position, and the interpolation itself. The results are not better and can be quite noisy. Thus, global resampling of the field is preferred though it can greatly enlarge the number of positions and cells. Even then, template matching on the resampled grid will be faster, especially if the grid size in each dimension is 2k for some,
Figure 8.7: The surface of the front wagon of the ICE data set. Left: LIC. Right: Similarities of the normalized flow to a 3× 3 divergent template. Color coding from dark blue (convergence) to dark red (divergence).
possibly different, k∈ N. Then, the fast Clifford Fourier transform can be used for acceleration of the convolution computations (Section 7.4.3).
The only case when global resampling of the field will not work at all is for flow fields defined on a surface. There, local resampling of the field using geodesics to determine the sampling positions has to be used though it is slow.