boofcv.alg.shapes.polyline
Class RefinePolyLineCorner
- java.lang.Object
-
- boofcv.alg.shapes.polyline.RefinePolyLineCorner
-
public class RefinePolyLineCorner extends java.lang.ObjectOptimizing corner placements to a pixel level when given a contour and integer list of approximate corner locations which define set of line segments. Corners are optimized by searching for another near by pixel in the provided contour which reduces the distance of the contour from the line segments. This is intended to optimize the output from
SplitMergeLineFit. Can be configured to handle case where line segments form a loop or have disconnected end points.Each corner is individually optimized once per iteration. The process is repeated until the maximum number of iterations has been reached or there is no change in corner placements.
-
-
Constructor Summary
Constructors Constructor and Description RefinePolyLineCorner(boolean looping)Constructor using default parametersRefinePolyLineCorner(boolean looping, int maxIterations)Constructor with configurable parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanfit(java.util.List<Point2D_I32> contour, GrowQueue_I32 corners)Fits a polygon to the contour given an initial set of candidate corners.
-
-
-
Constructor Detail
-
RefinePolyLineCorner
public RefinePolyLineCorner(boolean looping, int maxIterations)Constructor with configurable parameters- Parameters:
looping- true if it loops or false if notmaxIterations- Number of internal EM iterations
-
RefinePolyLineCorner
public RefinePolyLineCorner(boolean looping)
Constructor using default parameters
-
-
Method Detail
-
fit
public boolean fit(java.util.List<Point2D_I32> contour, GrowQueue_I32 corners)
Fits a polygon to the contour given an initial set of candidate corners. If not looping the corners must include the end points still. Minimum of 3 points required. Otherwise there's no corner!.- Parameters:
contour- Contours around the shapecorners- (Input) initial set of corners. (output) refined set of corners
-
-
DataMelt 3.0 © DataMelt by jWork.ORG