You are here: Start » AVL.NET » Function Reference » Computer Vision » Camera Calibration » AVL.AnnotateGridPoints_Ransac

AVL.AnnotateGridPoints_Ransac

Select a subset of the given points that forms a grid and assign 2D indices to them.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void AnnotateGridPoints_Ransac
(
	IList<AvlNet.Point2D> inPoints,
	int? inMaxAttempts,
	int? inMaxOutlierCount,
	float inMinLength,
	float? inMaxLength,
	float inMaxLengthRatio,
	float inAngleRange,
	float inBaseAspectRatioRange,
	float? inBaseAspectRatio,
	float? inBaseShear,
	float? inBaseOrientation,
	IList<AvlNet.AnnotatedPoint2D> outPointGrid
)

Parameters

Name Type Range Default Description
inPointsSystem.Collections.Generic.IList<AvlNet.Point2D>
inMaxAttemptsint?<1, INF>Maximum number of attempts at finding the grid. Default value: atl::NIL.
inMaxOutlierCountint?<0, INF>Determines how many outlier points can be present to end the search. Default value: atl::NIL.
inMinLengthfloat<0.0f, INF>0.0fMinimum length of a grid segment. Default value: 0.0f.
inMaxLengthfloat?<0.0f, INF>10.0fMaximum length of a grid segment, if set to Auto it will be approximated. Default value: 10.0f.
inMaxLengthRatiofloat<1.0f, 2.0f>1.3fMaximum ratio of two consecutive segments in the grid. Default value: 1.3f.
inAngleRangefloat<0.0f, 45.0f>16.0fMaximum variation of angles between neighbouring grid segments in degrees. Default value: 16.0f.
inBaseAspectRatioRangefloat<0.0f, 1.0f>0.3fMaximum variation of the base aspect ratio (ignores if base aspect ratio is not given). Default value: 0.3f.
inBaseAspectRatiofloat?<0.3f, 1.0f>1.0fA reference aspect ratio of the grid. Default value: 1.0f.
inBaseShearfloat?<0.0f, 60.0f>00.0fA reference shear angle between grid directions. Default value: 00.0f.
inBaseOrientationfloat?<0.0f, 360.0f>A reference orientation of one of the grids directions. Default value: atl::NIL.
outPointGridSystem.Collections.Generic.IList<AvlNet.AnnotatedPoint2D>Detected grid.

Description

This filter analyzes a 2D point array and finds a grid within it. The grid can have missing points as well as noise (points that are not vertices of the gird). The filter provides various input that allow the user to specify the shape of the grid that they want to be found.

It is expected that the point array given does not have a lot of missing and/or noise points.

The filter uses a RANSAC based algorithm to find grid within the input array and returns the grid that includes the most points from the input array among all grids that were found. If more than one grid include the maximum number of points, the returned one is the one with the smallest angle deviations.

The algorithm starts by finding a grid base, which consists of three points: one that will be considered as the origin of the grid, one that is one unit away from the origin on the grids X axis and one that is one unit away on the grids Y axis. The constraints for these grid bases can be specified by the user with the use of Base parameters:

  • inBaseAspectRatio defines the length ratio between the two segments that the grid base consists of (one along the X axis and the other along the Y axis). The ratio is calculated by divining the length of the shorter segment by the length of the longer one. If this parameter is set to Auto, the algorithm will check bases with rations in the range 0.3 - 1.0
  • inBaseAspectRatioRange defines how much the given base aspect ratio can differ from the calculated one.
  • inBaseShear defines the shear of the grid in degrees. The calculated shear can differ from the one given in this parameter by inAngleRange degrees. If this parameter is not given, bases with shears up to 60 degrees will be considered but grids with shears closer to zero will be preferred.
  • inBaseOrientation defines the orientation of the grids X axis. If this parameters is not given then the positive X direction of the grid will be defined as the direction that gives the biggest positive change in real X coordinated.

The grid is build from the base with respect to constraint parameters:

  • inMinLength and inMaxLength define the range of possible segment length in the grid (a segment is a single step in either the X or Y direction).
  • inMaxLengthRatio the maximum length ratio between to neighbouring segments of the grid that are along the same axis (for example: two neighbouring segments along the X axis). The minimum length ratio is calculated as 1 / inMaxLengthRatio.
  • inAngleRange defines how much the angles of neighbouring grid segments can differ.

Examples

Example input array with noise points (left) and the computed annotated grid (right).

A more difficult example.

Function Overrides

See also