constrained Laplacian smoothing of grain boundaries
Description
Replaces every vertex by a weighted mean of itself and its neighbours, a fixed number of times. This is what grain2d/smoothBoundary has always done and it stays the default.
Note that a Laplacian is a low pass filter with gain 1-lambda*k, so it shrinks: every iteration pulls a convex region inwards, without bound. Use taubinFilter when that matters. Note also that iter is not a physical quantity - how far a boundary is smoothed depends on how densely it is sampled, so the same call on the same sample measured at a finer step size does something different. Use curvatureFilter when that matters.
The averaging includes the vertex itself with the weight of its own degree, which is how the adjacency comes out of the vertex - segment incidence matrix. For a vertex with two neighbours the mean is therefore (2*V + Vl + Vr)/4, so lambda is applied to half the normalized Laplacian - the default lambda = 0.5 is in truth a rate of 0.25. The variational filters use the normalized Laplacian itself, so their parameters are not comparable to this one.
Syntax
grains = smoothBoundary(grains,5) % the default, iter = 5F = laplaceFilter;
F.iter = 10;
F.weight = 'gauss';
grains = smoothBoundary(grains,F)Class Properties
| iter | number of iterations (default: 1) |
| lambda | step size (default: 0.5) |
| weight | 'rate', 'gauss', 'exp' or 'umbrella' |
| secondOrder | average over the neighbours of the neighbours as well |
See also
grain2d.smoothBoundary boundaryFilter taubinFilter curvatureFilter