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 |
changed, contour, line, maxIterations, point2D, splits, toleranceMerge, toleranceSplitSq, work| Constructor and Description |
|---|
SplitMergeLineFitLoop(double toleranceSplit,
double toleranceMerge,
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 which have an acute angle less than the threshold.
|
void |
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 paint that is too far away
|
computeAcute, getSplitspublic SplitMergeLineFitLoop(double toleranceSplit,
double toleranceMerge,
int maxIterations)
public void 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)