public class SplitMergeLineFitLoop extends SplitMergeLineFit
SplitMergeLineFit for looped lists of points. The beginning and end of the list are
assumed to be connected. An additional check is done in the start to find two points which are far apart.| Modifier and Type | Field and Description |
|---|---|
protected int |
N |
abortSplits, changed, contour, line, maxIterations, minimumSideLengthFraction, minimumSideLengthPixel, point2D, splits, toleranceFractionSq, work| Constructor and Description |
|---|
SplitMergeLineFitLoop(double splitFraction,
double minimumSplitFraction,
int maxIterations) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
circularDistance(int start,
int end)
Distance the two points are apart in clockwise direction
|
protected boolean |
mergeSegments()
Merges lines together if the common corner is close to a common line
|
boolean |
process(java.util.List<georegression.struct.point.Point2D_I32> contour)
Approximates the input list with a set of line segments
|
protected int |
selectFarthest(java.util.List<georegression.struct.point.Point2D_I32> contour)
Computes the distance between pairs of points which are separated by 1/2 the contour list.
|
protected int |
selectSplitOffset(int indexStart,
int length)
Finds the point between indexStart and the end point which is the greater distance from the line
(set up prior to calling).
|
protected void |
splitPixels(int indexStart,
int length)
Recursively splits pixels between indexStart to indexStart+length.
|
protected boolean |
splitSegments()
Splits a line in two if there is a point that is too far away
|
getAbortSplits, getMinimumSideLengthFraction, getSplits, setAbortSplits, setMaxIterations, setMinimumSideLengthFraction, setSplitFraction, splitThresholdSqpublic SplitMergeLineFitLoop(double splitFraction,
double minimumSplitFraction,
int maxIterations)
public boolean process(java.util.List<georegression.struct.point.Point2D_I32> contour)
SplitMergeLineFitprocess in class SplitMergeLineFitcontour - Ordered list of connected points.protected void splitPixels(int indexStart,
int length)
protected int selectFarthest(java.util.List<georegression.struct.point.Point2D_I32> contour)
protected boolean mergeSegments()
protected boolean splitSegments()
protected int selectSplitOffset(int indexStart,
int length)
protected int circularDistance(int start,
int end)