boofcv.alg.shapes.polyline
Class MinimizeEnergyPrune
- java.lang.Object
-
- boofcv.alg.shapes.polyline.MinimizeEnergyPrune
-
public class MinimizeEnergyPrune extends java.lang.ObjectPrunes corners from a pixel level accuracy contour by minizing a penalized energy function. The energy of a line segment is defined as Euclidean distance squared of each point from the line summed plus a penalty divided by the distance between two end points of the line. When a corner is removed the location of its neighbors are optimized again.
Energy of line segment = [Sum( distance points from line squared) + penalty ] / (segment length)
-
-
Constructor Summary
Constructors Constructor and Description MinimizeEnergyPrune(double splitPenalty)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanprune(java.util.List<Point2D_I32> contour, GrowQueue_I32 input, GrowQueue_I32 output)Given a contour and initial set of corners compute a new set of corner indexes
-
-
-
Method Detail
-
prune
public boolean prune(java.util.List<Point2D_I32> contour, GrowQueue_I32 input, GrowQueue_I32 output)
Given a contour and initial set of corners compute a new set of corner indexes- Parameters:
contour- List of points in the shape's contourinput- Initial set of cornersoutput- Pruned set of corners- Returns:
- true if one or more corners were pruned, false if nothing changed
-
-
DataMelt 3.0 © DataMelt by jWork.ORG