public class ShapeFittingOps
extends java.lang.Object
CannyEdge,
BinaryImageOps.contour(GrayU8, boofcv.struct.ConnectRule, GrayS32)| Constructor and Description |
|---|
ShapeFittingOps() |
| Modifier and Type | Method and Description |
|---|---|
static FitData<georegression.struct.trig.Circle2D_F64> |
averageCircle_F64(java.util.List<georegression.struct.point.Point2D_F64> points,
org.ddogleg.struct.GrowQueue_F64 optional,
FitData<georegression.struct.trig.Circle2D_F64> outputStorage)
Computes a circle which has it's center at the mean position of the provided points and radius is equal to the
average distance of each point from the center.
|
static FitData<georegression.struct.trig.Circle2D_F64> |
averageCircle_I32(java.util.List<georegression.struct.point.Point2D_I32> points,
org.ddogleg.struct.GrowQueue_F64 optional,
FitData<georegression.struct.trig.Circle2D_F64> outputStorage)
Computes a circle which has it's center at the mean position of the provided points and radius is equal to the
average distance of each point from the center.
|
static FitData<georegression.struct.shapes.EllipseRotated_F64> |
fitEllipse_F64(java.util.List<georegression.struct.point.Point2D_F64> points,
int iterations,
boolean computeError,
FitData<georegression.struct.shapes.EllipseRotated_F64> outputStorage)
Computes the best fit ellipse based on minimizing Euclidean distance.
|
static FitData<georegression.struct.shapes.EllipseRotated_F64> |
fitEllipse_I32(java.util.List<georegression.struct.point.Point2D_I32> points,
int iterations,
boolean computeError,
FitData<georegression.struct.shapes.EllipseRotated_F64> outputStorage)
Convenience function.
|
static java.util.List<boofcv.struct.PointIndex_I32> |
fitPolygon(java.util.List<georegression.struct.point.Point2D_I32> sequence,
boolean loop,
double splitFraction,
double minimumSideFraction,
int iterations)
Fits a polygon to the provided sequence of connected points.
|
static void |
indexToPointIndex(java.util.List<georegression.struct.point.Point2D_I32> sequence,
org.ddogleg.struct.GrowQueue_I32 indexes,
org.ddogleg.struct.FastQueue<boofcv.struct.PointIndex_I32> output)
Converts the list of indexes in a sequence into a list of
PointIndex_I32. |
public static java.util.List<boofcv.struct.PointIndex_I32> fitPolygon(java.util.List<georegression.struct.point.Point2D_I32> sequence,
boolean loop,
double splitFraction,
double minimumSideFraction,
int iterations)
Fits a polygon to the provided sequence of connected points. The found polygon is returned as a list of vertices. Each point in the original sequence is guaranteed to be within "toleranceDist' of a line segment.
Internally a split-and-merge algorithm is used. See referenced classes for more information. Consider using internal algorithms directly if this function is a performance bottleneck.
sequence - Ordered and connected list of points.loop - If true the sequence is a connected at both ends, otherwise it is assumed to not be.splitFraction - A line will be split if a point is more than this fraction of its
length away from the line. Try 0.05minimumSideFraction - The minimum allowed side length as a function of contour length.iterations - Maximum number of iterations done to improve the fit. Can be 0. Try 50.SplitMergeLineFitLoop,
SplitMergeLineFitSegmentpublic static FitData<georegression.struct.shapes.EllipseRotated_F64> fitEllipse_F64(java.util.List<georegression.struct.point.Point2D_F64> points, int iterations, boolean computeError, FitData<georegression.struct.shapes.EllipseRotated_F64> outputStorage)
NOTE: To improve speed, make calls directly to classes in Georegression. Look at the code for details.
points - (Input) Set of unordered points. Not modified.iterations - Number of iterations used to refine the fit. If set to zero then an algebraic solution
is returned.computeError - If true it will compute the average Euclidean distance erroroutputStorage - (Output/Optional) Storage for the ellipse. Can be null.public static FitData<georegression.struct.shapes.EllipseRotated_F64> fitEllipse_I32(java.util.List<georegression.struct.point.Point2D_I32> points, int iterations, boolean computeError, FitData<georegression.struct.shapes.EllipseRotated_F64> outputStorage)
fitEllipse_F64(java.util.List, int, boolean,FitData), but converts the set of integer points
into floating point points.points - (Input) Set of unordered points. Not modified.iterations - Number of iterations used to refine the fit. If set to zero then an algebraic solution
is returned.computeError - If true it will compute the average Euclidean distance erroroutputStorage - (Output/Optional) Storage for the ellipse. Can be nullpublic static FitData<georegression.struct.trig.Circle2D_F64> averageCircle_I32(java.util.List<georegression.struct.point.Point2D_I32> points, org.ddogleg.struct.GrowQueue_F64 optional, FitData<georegression.struct.trig.Circle2D_F64> outputStorage)
points - (Input) Set of unordered points. Not modified.optional - (Optional) Used internally to store the distance of each point from the center. Can be null.outputStorage - (Output/Optional) Storage for results. If null then a new circle instance will be returned.public static FitData<georegression.struct.trig.Circle2D_F64> averageCircle_F64(java.util.List<georegression.struct.point.Point2D_F64> points, org.ddogleg.struct.GrowQueue_F64 optional, FitData<georegression.struct.trig.Circle2D_F64> outputStorage)
points - (Input) Set of unordered points. Not modified.optional - (Optional) Used internally to store the distance of each point from the center. Can be null.outputStorage - (Output/Optional) Storage for results. If null then a new circle instance will be returned.public static void indexToPointIndex(java.util.List<georegression.struct.point.Point2D_I32> sequence,
org.ddogleg.struct.GrowQueue_I32 indexes,
org.ddogleg.struct.FastQueue<boofcv.struct.PointIndex_I32> output)
PointIndex_I32.sequence - Sequence of points.indexes - List of indexes in the sequence.output - Output list of PointIndex_I32.