Leaper Vision Toolkit
Public Member Functions
ILPoints Interface Reference

This interface represents a collection of points(LPoints object). More...

Inheritance diagram for ILPoints:
ILObjects ILObject LPoints

Public Member Functions

void Add (double x, double y)
 
void AddPoints (ILPoints *points)
 
void AddPointsInRegion (ILRegion *region)
 
LArray< double > DistancesToLine (ILLine *line)
 
LArray< double > DistancesToPoint (ILPoint *point)
 
LArray< double > DistancesToPoints (ILPoints *points, LArray< int > indexes)
 
LArray< double > DistancesToPolygon (ILPolygon *polygon, LArray< ILPoint * > rootPoints)
 
double DistanceToLine (ILLine *line, LPVAggregation aggType)
 
double DistanceToPoint (ILPoint *point, LPVAggregation aggType)
 
double DistanceToPoints (ILPoints *points, LPVAggregation aggType)
 
double DistanceToPolygon (ILPolygon *polygon, LPVAggregation aggType)
 
void Draw (LPVPointShape shape, HDC hdc, double zoomX, double zoomY, double panX, double panY)
 
ILCircleFitCircle ()
 
ILEllipseFitEllipse ()
 
ILLineFitLine ()
 
void FromSortables (ILSortables *sortable, LPVPositionMode posMode)
 
ILCircleGetBoundingCircle ()
 
ILRectGetBoundingRect ()
 
ILRectGetBoundingRotRect ()
 
ILPointGetCenter ()
 
ILPolygonGetConvexHull ()
 
void GetPoints (LArray< double > xs, LArray< double > ys)
 
ILPointItem (int index)
 
void RemovePoints (double lbX, double ubX, double lbY, double ubY)
 
ILPointsScale (double factorX, double factorY)
 
void SetPoints (LArray< double > xs, LArray< double > ys)
 
ILPointsTransform (ILTransform *tf)
 
ILPointsTranslate (double offsetX, double offsetY)
 
- Public Member Functions inherited from ILObjects
int Count ()
 
BOOL Empty ()
 
ILObjectItemObject (int objIndex)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Detailed Description

This interface represents a collection of points(LPoints object).

Member Function Documentation

◆ Add()

void Add ( double  x,
double  y 
)

Add a point to the collection.

Parameters
[in]xThe x-coordinate of the new point
[in]yThe y-coordinate of the new point

◆ AddPoints()

void AddPoints ( ILPoints points)

Add the points in the given collection to this.

Parameters
[in]pointsThe input points

◆ AddPointsInRegion()

void AddPointsInRegion ( ILRegion region)

Add all points in the given region to the collection.

Parameters
[in]regionThe input region

◆ DistancesToLine()

LArray<double> DistancesToLine ( ILLine line)

Calculate the distance from each point in the collection to the input line, report all the distances. The distance is defined as ILLine::Perpendicular().

Parameters
[in]lineThe input line.
Return values
valsReturn all the distances, in the same order as the points.

◆ DistancesToPoint()

LArray<double> DistancesToPoint ( ILPoint point)

Calculate the distance from each point in the collection to the input point, report all the distances. The distance is defined as ILPoint::Distance().

Parameters
[in]pointThe input point
Return values
valsReturn all the distances, in the same order as the points.

◆ DistancesToPoints()

LArray<double> DistancesToPoints ( ILPoints points,
LArray< int >  indexes 
)

Calculate the distance from each point in the collection to the nearest point in the input points, report all the distances and the index of the nearest point.

Parameters
[in]pointsThe input points
[out]indexesOutput the index of the nearest point in the input
Return values
valsReturn all the distances, in the same order as the points.

◆ DistancesToPolygon()

LArray<double> DistancesToPolygon ( ILPolygon polygon,
LArray< ILPoint * >  rootPoints 
)

Calculate the distance from each point in the collection to the input polygon, report all the distances. The distance is defined as ILPolygon::DistanceToPoint().

Parameters
[in]polygonThe input polygon
[out]rootPointsOutput the root points on the polygon
Return values
valsReturn all the distances, in the same order as the points.

◆ DistanceToLine()

double DistanceToLine ( ILLine line,
LPVAggregation  aggType 
)

Calculate the distance from each point in the collection to the input line, report the aggregated metric such as maximum, minimum or average distance. The distance is defined as ILLine::Perpendicular().

Parameters
[in]lineThe input Line
[in]aggTypeThe aggregation type
Return values
valReturn the distance metric.

◆ DistanceToPoint()

double DistanceToPoint ( ILPoint point,
LPVAggregation  aggType 
)

Calculate the distance from each point in the collection to the input point, report the aggregated metric such as maximum, minimum or average distance. The distance is defined as ILPoint::Distance().

Parameters
[in]pointThe input point
[in]aggTypeThe aggregation type
Return values
valReturn the distance metric.

◆ DistanceToPoints()

double DistanceToPoints ( ILPoints points,
LPVAggregation  aggType 
)

Calculate the distance from each point in the collection to the nearest point in the input points, report the aggregated metric such as maximum, minimum or average distance.

Parameters
[in]pointsThe input points
[in]aggTypeThe aggregation type
Return values
valReturn the distance metric.

◆ DistanceToPolygon()

double DistanceToPolygon ( ILPolygon polygon,
LPVAggregation  aggType 
)

Calculate the distance from each point in the collection to the input polygon, report the aggregated metric such as maximum, minimum or average distance. The distance is defined as ILPolygon::DistanceToPoint().

Parameters
[in]polygonThe input polygon
[in]aggTypeThe aggregation type
Return values
valReturn the distance metric.

◆ Draw()

void Draw ( LPVPointShape  shape,
HDC  hdc,
double  zoomX,
double  zoomY,
double  panX,
double  panY 
)

Draw all the points on HDC.

Parameters
[in]shapeThe shape of the point in drawing
See also
Use Draw Functions
Remarks
This function is currently not available on Linux / MacOS platform.

◆ FitCircle()

ILCircle* FitCircle ( )

Fit a circle which minimize the total distance between the result and all the points. If out-lier filtering is necessary, use LFitting instead.

Return values
valReturn the fitting result circle
See also
FitLine(), FitEllipse().

◆ FitEllipse()

ILEllipse* FitEllipse ( )

Fit an ellipse which minimize the total distance between the result and all the points.

Return values
valReturn the fitting result ellipse
See also
FitLine(), FitCircle().

◆ FitLine()

ILLine* FitLine ( )

Fit a line which minimize the total distance between the result and all the points. If out-lier filtering is necessary, use LFitting instead.

Return values
valReturn the fitting result line
See also
FitCircle(), FitEllipse().

◆ FromSortables()

void FromSortables ( ILSortables sortable,
LPVPositionMode  posMode 
)

Set placement of the point from the input sortable collection object.

Parameters
[in]sortableThe input sortable collection object
[in]posModeSpecify which points are used as the objects's positions, usually the centers.

◆ GetBoundingCircle()

ILCircle* GetBoundingCircle ( )

Get the bounding circle of all the points

◆ GetBoundingRect()

ILRect* GetBoundingRect ( )

Get the bounding rectangle of all the points

◆ GetBoundingRotRect()

ILRect* GetBoundingRotRect ( )

Get the rotated bounding rectangle of all the points

◆ GetCenter()

ILPoint* GetCenter ( )

Get the center, it's averaging position of the all points, as:

\[ (\overline{x}, \overline{y}) \]

◆ GetConvexHull()

ILPolygon* GetConvexHull ( )

Get the bounding convex hull of all the points

◆ GetPoints()

void GetPoints ( LArray< double >  xs,
LArray< double >  ys 
)

Get all the points

Parameters
[in]xsOutput x-coordinates of the points, you should get the count and reserve the array outside.
[in]ysOutput y-coordinates of the points

◆ Item()

ILPoint* Item ( int  index)

Fetch one point with the given index.

Parameters
[in]indexThe input index, it should be a 0-based number smaller than total count.
Return values
pointReturn the point of given index.

◆ RemovePoints()

void RemovePoints ( double  lbX,
double  ubX,
double  lbY,
double  ubY 
)

Remove some points in the collection which is in the given range.

Parameters
[in]lbXThe lower bound of the x-coordinate to be removed
[in]ubXThe upper bound of the x-coordinate to be removed
[in]lbYThe lower bound of the y-coordinate to be removed
[in]ubYThe upper bound of the y-coordinate to be removed

◆ Scale()

ILPoints* Scale ( double  factorX,
double  factorY 
)

Scale the points by the given factor and return a new collection of points

Parameters
[in]factorXThe scale factor of x-coordinate
[in]factorYThe scale factor of y-coordinate
Return values
resultsReturn the new collection of points

◆ SetPoints()

void SetPoints ( LArray< double >  xs,
LArray< double >  ys 
)

Set the points

Parameters
[in]xsThe x-coordinate of the points
[in]ysThe y-coordinate of the points

◆ Transform()

ILPoints* Transform ( ILTransform tf)

Transform the points via the given transformation and return a new collection of points

Parameters
[in]tfThe transformation.
Return values
Returnthe new collection of points

◆ Translate()

ILPoints* Translate ( double  offsetX,
double  offsetY 
)

Translate the points by the given offset and return a new collection of points

Parameters
[in]offsetXThe x-coordinate of the offset
[in]offsetYThe y-coordinate of the offset
Return values
resultsReturn the new collection points