The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Shape Similarity other words, the area of the regions lying within one of the two polygons but not both of them. If the two polygons are identical, and properly aligned, the Hamming distance will be zero. If the polygons differ only in a little noise at the boundary, then the Hamming distance will be small if the polygons are properly aligned. If the two polygons are completely disjoint, then the Hamming distance is the sum of the areas of the two polygons. Computing the area of the symmetric difference reduces to finding the intersection or union of two polygons, as discussed in Section , and then computing areas, as discussed in . The difficult part of computing Hamming distance is finding the right alignment, or overlay, of the two polygons. For certain applications, such as OCR, the overlay problem is simplified because the characters are inherently aligned with the page and thus not free to rotate. Hamming distance is particularly simple and efficient to compute on bit-mapped images, since after alignment all we do is sum the differences of the corresponding pixels. Although Hamming distance makes sense conceptually and can be simple to implement, it captures only a crude notion of shape and is likely to be ineffective in most applications. ● Hausdorff distance - An alternative distance metric is Hausdorff distance, which identifies the point on that is the maximum distance from and returns this distance. The Hausdorff distance is not symmetrical, for the distance from to is not necessarily the distance from to . Note the difference between Hamming and Hausdorff distance. A large but thin protrusion from one of the models will have a large effect on the Hausdorff distance but little on the Hamming distance. However, a fattening of the entire boundary of one of the models (as is liable to happen with boundary noise) by a small amount will increase the Hamming distance yet have little effect on the Hausdorff distance. Which is better, Hamming or Hausdorff? It depends upon your application. As with Hamming distance, computing the right alignment between the polygons can be difficult and timeconsuming. Again, Hausdorff distance captures only a crude notion of shape. ● Comparing Skeletons - A more powerful approach to shape similarity uses thinning (see Section ) to extract a tree-like skeleton for each object. This skeleton captures many aspects of the original shape. The problem now reduces to comparing the shape of two such skeletons, using such features as the topology of the tree and the lengths/slopes of the edges. This comparison can be modeled as a form of subgraph isomorphism (see Section ), with edges allowed to match whenever their lengths and slopes are sufficiently similar. ● Neural Networks - A final method for shape comparison uses neural networks, which are discussed in Section . Neural nets prove a reasonable approach to recognition problems when you have a lot of data to experiment with and no particular ideas of what to do with it. First, you must identify a set of easily computed features of the shape, such as area, number of sides, and number of holes. Based on these features, a black-box program (the neural network training algorithm) takes your training data and produces a classification function. This classification function accepts as input the values of these features and returns a measure of what the shape is, file:///E|/BOOK/BOOK5/NODE196.HTM (2 of 3) [19/1/2003 1:31:56]

Shape Similarity or how close it is to a particular shape. How good are the resulting classifiers? It depends upon the application. Like any ad hoc method, neural networks usually take a fair amount of tweaking and tuning to realize their full potential. One caveat. Because your classifier was developed by a black box, you never really know why your classifier is making its decisions, so you can't know when it will fail. An interesting case was a system built for the military to distinguish between images of cars and tanks. It performed very well on test images but disastrously in the field. Eventually, someone realized that the car images had been filmed on a sunnier day than the tanks, and the program was classifying solely on the presence of clouds in the background of the image! Implementations: The Stuttgart Neural Network Simulator supports many types of networks and training algorithms, as well as sophisticated graphical visualization tools under X11. It has been ported to many flavors of UNIX. It is available for ftp from ftp.informatik.uni-stuttgart.de [129.69.211.2] in directory /pub/SNNS as SNNSv4.1.tar.gz (1.4 MB, Source code) and SNNSv4.1.Manual.ps.gz (1 MB, Documentation). It may be best to first have a look at the file SNNSv4.1.Readme. More information can be found in the WWW under http://www.informatik.uni-stuttgart.de/ipvr/bv/projekte/snns/snns.html An alternate distance metric between polygons can be based on its angle turning function [ACH 91]. An implementation in C of this turning function metric by Eugene K. Ressler is provided on the algorithm repository http://www.cs.sunysb.edu/ algorith. Notes: General books on pattern classification algorithms include [DH73, JD88]. A wide variety of computational geometry approaches to shape similarity testing have been proposed, including [AMWW88, ACH 91, Ata84, AE83, BM89, OW85]. A linear-time algorithm for computing the Hausdorff distance between two convex polygons is given in [Ata83], with algorithms for the general case reported in [HK90]. Related Problems: Graph isomorphism (see page ), thinning (see page ). Next: Motion Planning Up: Computational Geometry Previous: Simplifying Polygons Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK5/NODE196.HTM (3 of 3) [19/1/2003 1:31:56]

Shape Similarity<br />

or how close it is to a particular shape.<br />

How good are the resulting classifiers? It depends upon the application. Like any ad hoc method,<br />

neural networks usually take a fair amount of tweaking and tuning to realize their full potential.<br />

One caveat. Because your classifier was developed by a black box, you never really know why<br />

your classifier is making its decisions, so you can't know when it will fail. An interesting case was<br />

a system built for the military to distinguish between images of cars and tanks. It performed very<br />

well on test images but disastrously in the field. Eventually, someone realized that the car images<br />

had been filmed on a sunnier day than the tanks, and the program was classifying solely on the<br />

presence of clouds in the background of the image!<br />

Implementations: <strong>The</strong> Stuttgart Neural Network Simulator supports many types of networks and<br />

training algorithms, as well as sophisticated graphical visualization tools under X11. It has been ported to<br />

many flavors of UNIX. It is available for ftp from ftp.informatik.uni-stuttgart.de [129.69.211.2] in<br />

directory /pub/SNNS as SNNSv4.1.tar.gz (1.4 MB, Source code) and SNNSv4.1.<strong>Manual</strong>.ps.gz (1 MB,<br />

Documentation). It may be best to first have a look at the file SNNSv4.1.Readme. More information can<br />

be found in the WWW under http://www.informatik.uni-stuttgart.de/ipvr/bv/projekte/snns/snns.html<br />

An alternate distance metric between polygons can be based on its angle turning function [ACH 91].<br />

An implementation in C of this turning function metric by Eugene K. Ressler is provided on the<br />

algorithm repository http://www.cs.sunysb.edu/ algorith.<br />

Notes: General books on pattern classification algorithms include [DH73, JD88]. A wide variety of<br />

computational geometry approaches to shape similarity testing have been proposed, including<br />

[AMWW88, ACH 91, Ata84, AE83, BM89, OW85].<br />

A linear-time algorithm for computing the Hausdorff distance between two convex polygons is given in<br />

[Ata83], with algorithms for the general case reported in [HK90].<br />

Related Problems: Graph isomorphism (see page ), thinning (see page ).<br />

Next: Motion Planning Up: Computational Geometry Previous: Simplifying Polygons<br />

<strong>Algorithm</strong>s<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK5/NODE196.HTM (3 of 3) [19/1/2003 1:31:56]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!