remove boundary vertices that carry no shape information
Description
Douglas-Peucker simplification of the grain boundaries. A vertex is dropped if removing it moves the boundary by less than epsilon, so a straight run collapses into a single segment while a corner is kept. On a pixel grid this is what turns the staircase into the straight line it approximates.
Junctions stay exactly where they are, so which grains touch, and where, is unchanged. The grain polygons are retraced along with the boundary, so the grain areas do move - by at most about epsilon times the perimeter. A grain too small to survive the tolerance is left uncoarsened rather than collapsed, so no grain is ever simplified away.
Syntax
grains = simplifyBoundary(grains)
grains = simplifyBoundary(grains,epsilon)Input
| grains | grain2d |
| epsilon | tolerance in EBSD units (default: the median segment length over sqrt(2), which is exactly how far a staircase can stray from the straight line it approximates) |
Output
| grains | grain2d |
See also
grainBoundary.simplify grain2d.reduceBoundary grain2d.refineBoundary grain2d.smoothBoundary