Shape optimizer, which removes obtuse angles (close to flat) from a shape.
Namespace:
AForge.Math.GeometryAssembly: AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
C# |
---|
public class FlatAnglesOptimizer : IShapeOptimizer |
Remarks
This shape optimizing algorithm checks all adjacent edges of a shape and substitutes any 2 edges with a single edge if angle between them is greater than MaxAngleToKeep. The algorithm makes sure there are not obtuse angles in a shape, which are very close to flat line.
The shape optimizer does not optimize shapes to less than 3 points, so optimized shape always will have at least 3 points.
For example, the below circle shape comprised of 65 points, can be optimized to 10 points
by setting MaxAngleToKeep to 160.