Functions | |
cvbres_t | AddAngles (ANGLE Angle1, ANGLE Angle2, ANGLE &Sum) |
Adds two angle objects. More... | |
cvbres_t | AddVector2DToPixelList (VECTOR2D Vector, PIXELLIST List) |
Inserts a Vector2D object into a pixel list. More... | |
cvbres_t | AddVectors2D (VECTOR2D Vector1, VECTOR2D Vector2, VECTOR2D &Result) |
Build the sum of two vectors. More... | |
cvbres_t | CalculateCircleRegression (PIXELLIST pl, double ¢erX, double ¢erY, double &radius) |
Calculate a circle from a pixel list. More... | |
cvbres_t | CalculateEllipseRegression (PIXELLIST pl, double ¢erX, double ¢erY, double &radiusA, double &radiusB, double &rotation) |
Calculate an ellipse from a pixel list. More... | |
cvbres_t | CompareAngles (ANGLE Angle1, ANGLE Angle2, long &Result) |
Compares two angles. More... | |
ANGLE | CreateAngle () |
Create an angle object initialized to zero degrees. More... | |
ANGLE | CreateAngleArgument (double X, double Y) |
Create an angle object and initialize it with angle between the x-axis and the point whose coordinates are given. More... | |
ANGLE | CreateAngleDegrees (double Deg) |
Create an angle object and initialize it with an angle given in degrees. More... | |
ANGLE | CreateAngleRadians (double Rad) |
Create an angle object and initialize it with an angle given in radians. More... | |
CIRCLE2D | CreateCircle2D () |
Create an uninitialized circle object (center at (0,0), radius 0). More... | |
CIRCLE2D | CreateCircle2DByRegression (PIXELLIST RegressionList) |
Create a circle object based on a regression based on the points given in the input pixel-list. More... | |
CIRCLE2D | CreateCircle2DParametric (double CenterX, double CenterY, double Radius) |
Create a circle object by defining its center point and radius. More... | |
LINE2D | CreateLine2DAnalytical (double A, double B, cvbbool_t AxplusB) |
Create a line object according to its analytical formula. More... | |
LINE2D | CreateLine2DByRegression (PIXELLIST RegressionList) |
Create a line object by performing a linear regression over an input pixel-list. More... | |
LINE2D | CreateLine2DDistanceOrientation (double Distance, ANGLE Direction) |
Create a line object by specifying its distance from the origin and the direction in which the line is running. More... | |
LINE2D | CreateLine2DNormalDistance (VECTOR2D Normal, double Distance) |
Create a line object by specifying its distance from the origin and a normal vector on the line. More... | |
LINE2D | CreateLine2DTwoPoints (VECTOR2D Point1, VECTOR2D Point2) |
Create a line object by defining two points that are lying on the line. More... | |
LINE2D | CreateLine2DVectorOrientation (VECTOR2D Vector, ANGLE Direction) |
Create a line object by defining a point on the line and the angle at which the line passes through that point. More... | |
cvbres_t | CreateNormalizedVector2D (VECTOR2D Input, VECTOR2D &Output) |
Create a normalized version of the input vector. More... | |
cvbres_t | CreateNormalVector2D (VECTOR2D Input, VECTOR2D &Output) |
Create a normal vector of the input vector. More... | |
LINE2D | CreatePerpendicularLine2D (LINE2D Line, VECTOR2D Point) |
Create a line object that is perpendicular to the input line and runs through a given point. More... | |
VECTOR2D | CreateVector2D () |
Create a null vector object. More... | |
VECTOR2D | CreateVector2DCartesian (double X, double Y) |
Create a vector object and initializes it with the specified cartesian data. More... | |
VECTOR2D | CreateVector2DFromPOINT (POINT Vertex) |
Create a vector object and initializes it with the values taken from the specified POINT structure. More... | |
VECTOR2D | CreateVector2DRadial (ANGLE Ang, double Radius) |
Create a vector object and initialize it with values given in radial coordinates. More... | |
cvbres_t | DoLine2DClip (LINE2D Line, TDRect ClippingRect, VECTOR2D &Clip1, VECTOR2D &Clip2) |
Calculates the two points at which a line object (potentially) intersects with a TDRect structure. More... | |
cvbres_t | GetAngleCosine (ANGLE Angle, double &Cosine) |
Get the cosine of an angle object. More... | |
cvbres_t | GetAngleDegrees (ANGLE Angle, double &Degrees) |
Get an angle object's value in degrees. More... | |
cvbres_t | GetAngleRadians (ANGLE Angle, double &Radians) |
Get an angle object's value in radians. More... | |
cvbres_t | GetAngleSine (ANGLE Angle, double &Sine) |
Get the sine of an angle object. More... | |
cvbres_t | GetAngleTangent (ANGLE Angle, double &Tangent) |
Get the tangent of an angle object. More... | |
cvbres_t | GetCircle2DCenter (CIRCLE2D Circle, double &CenterX, double &CenterY) |
Retrieve the center of a circle object. More... | |
cvbres_t | GetCircle2DRadius (CIRCLE2D Circle, double &Radius) |
Retrieve the radius of a circle object. More... | |
cvbres_t | GetCircle2DRoundness (CIRCLE2D Circle, PIXELLIST PointList, double &Roundness) |
Get measure for the quality of a fitted circle. More... | |
cvbres_t | GetLine2DAXBFormula (LINE2D Line, double &A, double &B) |
Get the analytical formula in the shape y = A * x + B that describes a line object. More... | |
cvbres_t | GetLine2DAYBFormula (LINE2D Line, double &A, double &B) |
Get the analytical formula in the shape x = A * y + B that describes a line object. More... | |
cvbres_t | GetLine2DInclination (LINE2D Line, ANGLE &Inclination) |
Retrieves the inclination of a line object (the angle at which it intersects the x-axis of the coordinate system). More... | |
cvbres_t | GetLine2DIntersectionAngle (LINE2D Line1, LINE2D Line2, ANGLE &Intersection) |
Calculate the angle at which two lines intersect. More... | |
cvbres_t | GetLine2DIntersectionPoint (LINE2D Line1, LINE2D Line2, VECTOR2D &Result) |
Get the point at which two lines intersect. More... | |
cvbres_t | GetLine2DNormalVector (LINE2D Line, VECTOR2D &Vector) |
Calculate normal vector of a line object. More... | |
cvbres_t | GetLine2DOriginDistance (LINE2D Line, double &Distance) |
Get the distance of a line object from the origin. More... | |
cvbres_t | GetLine2DVectorOrientation (LINE2D Line, VECTOR2D &Vector, ANGLE &Angle) |
Get a point on a line object and the angle at which the line crosses that point. More... | |
cvbres_t | GetManyLine2DIntersectionPoint (LINE2D *LineArray, size_t ArrayLength, double ConvergenceThreshold, cvbval_t MaxIterations, VECTOR2D &Point) |
Uses an iteration scheme to approximate the intersection point of an array of line objects. More... | |
cvbres_t | GetPointDistance2D (VECTOR2D Point1, VECTOR2D Point2, double &Distance) |
Calculate the distance between two points pointed to by two vectors. More... | |
cvbres_t | GetPointLine2DDistance (LINE2D Line, VECTOR2D Point, double &Distance) |
Get the distance between a line and a point. More... | |
cvbres_t | GetVector2DCartesian (VECTOR2D Input, double &X, double &Y) |
Get the Cartesian components of a 2D vector object. More... | |
cvbres_t | GetVector2DLength (VECTOR2D Input, double &Length) |
Get the length of a vector object. More... | |
cvbres_t | GetVector2DRadial (VECTOR2D Input, ANGLE &Angle, double &Radius) |
Get the radial coordinates of a 2D vector object. More... | |
cvbres_t | InnerProduct2D (VECTOR2D Vector1, VECTOR2D Vector2, double &Result) |
Calculates the inner product of two vectors. More... | |
BOOL | IsAngle (ANGLE Handle) |
Checks whether a handle points to an angle object or not. More... | |
cvbres_t | IsAntiParallelVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result) |
Checks whether two vectors are anti parallel (i.e. parallel but pointing into different directions). More... | |
BOOL | IsCircle2D (CIRCLE2D Handle) |
Checks whether a handle points to a circle object or not. More... | |
cvbres_t | IsEqualCircle2D (CIRCLE2D Circle1, CIRCLE2D Circle2, cvbbool_t &Result) |
Checks whether two circles are equal. More... | |
cvbres_t | IsEqualLine2D (LINE2D Line1, LINE2D Line2, cvbbool_t &Result) |
Checks two line objects for equality. More... | |
cvbres_t | IsEqualVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result) |
Checks two vector objects for equality. More... | |
BOOL | IsLine2D (LINE2D Handle) |
Checks whether a handle points to an line object or not. More... | |
cvbres_t | IsLine2DParallel (LINE2D Line1, LINE2D Line2, cvbbool_t &Result) |
Checks whether two line objects are parallel. More... | |
cvbres_t | IsLine2DPerpendicular (LINE2D Line1, LINE2D Line2, cvbbool_t &Result) |
Checks whether two line objects are perpendicular. More... | |
cvbres_t | IsParallelVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result) |
Checks whether two vector objects are parallel. More... | |
cvbres_t | IsPerpendicularVector2D (VECTOR2D Vector1, VECTOR2D Vector2, cvbbool_t &Result) |
Checks whether two vector objects are perpendicular. More... | |
cvbres_t | IsPointInCircle2D (CIRCLE2D Circle, double PointX, double PointY, cvbbool_t &Result) |
Checks whether a given point is inside a circle. More... | |
cvbres_t | IsPointOnCircle2DRadius (CIRCLE2D Circle, double PointX, double PointY, double Epsilon, cvbbool_t &Result) |
Checks whether a point is on the radius (or within a small epsilon environment of the radius) of a circle object. More... | |
BOOL | IsVector2D (LINE2D Handle) |
Checks whether a handle points to a VECTOR2D object or not. More... | |
cvbres_t | MultiplyAngle (ANGLE Angle, double Constant) |
Multiply an angle with a (dimension-free) number. More... | |
cvbres_t | MultiplyVector2D (VECTOR2D Vector, double Scalar, VECTOR2D &Result) |
Multiply a vector with a scalar. More... | |
cvbres_t | SetAngleArgument (ANGLE Angle, double X, double Y) |
Set an angle to a new value which is defined as the angle between the x-axis and the line connecting the origin to a point (X,Y). More... | |
cvbres_t | SetAngleDegrees (ANGLE Angle, double Degrees) |
Set an angle object to a new value. More... | |
void | SetAngleLUTGranularityDeg (double Granularity) |
Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations. More... | |
void | SetAngleLUTGranularityRad (double Granularity) |
Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations. More... | |
cvbres_t | SetAngleRadians (ANGLE Angle, double Radians) |
Set an angle object to a new value. More... | |
cvbres_t | SetLine2DAnalytical (LINE2D Line, double A, double B, cvbbool_t AxplusB) |
Change a line object according to its analytical formula. More... | |
cvbres_t | SetLine2DByRegression (LINE2D Line, PIXELLIST RegressionList) |
Modifies a 2D line object by performing a linear regression over an input pixel list. More... | |
cvbres_t | SetLine2DDistanceOrientation (LINE2D Line, double Distance, ANGLE Direction) |
Modifies a line 2D object by specifying its distance from the origin and the direction in which the line is running (direction of the tangent on the circle around the origin with radius r). More... | |
cvbres_t | SetLine2DInclination (LINE2D Line, ANGLE Inclination) |
Change the inclination of a line object. More... | |
cvbres_t | SetLine2DNormalVector (LINE2D Line, VECTOR2D Normal) |
Redefine a line by changing its normal vector. More... | |
cvbres_t | SetLine2DOriginDistance (LINE2D Line, double Distance) |
Change the distance of a line from the origin. More... | |
cvbres_t | SetLine2DTwoPoints (LINE2D Line, VECTOR2D Point1, VECTOR2D Point2) |
Change a line object by specifying two points the line should cross. More... | |
cvbres_t | SetVector2DCartesian (VECTOR2D Input, double X, double Y) |
Set the Cartesian components of a 2D vector object. More... | |
cvbres_t | SetVector2DRadial (VECTOR2D Input, ANGLE Angle, double Radius) |
Set a 2D vector object to new radial coordinates. More... | |
cvbres_t | SubtractAngles (ANGLE Angle1, ANGLE Angle2, ANGLE &Diff) |
Subtracts two angle objects. More... | |
cvbres_t | SubtractVectors2D (VECTOR2D Vector1, VECTOR2D Vector2, VECTOR2D &Result) |
Build the difference of two vectors. More... | |
Adds two angle objects.
Automatically takes care of the fact that the angles wrap around at -Pi and +Pi.
[in] | Angle1 | First angle to be added. |
[in] | Angle2 | Second angle to be added. |
[out] | Sum | Handle of result angle containing the sum (Angle1 + Angle2). Attention: Handle must be released with the ReleaseObject when no longer needed. |
Inserts a Vector2D object into a pixel list.
[in] | Vector | Vector to be added to the pixel list. |
[in,out] | List | List to add the pixel to. |
Build the sum of two vectors.
[in] | Vector1 | First vector to be added. |
[in] | Vector2 | Second vector to be added. |
[out] | Result | Handle of result vector containing the sum (Vector1 + Vector2). Attention: Handle must be released with the ReleaseObject when no longer needed. |
cvbres_t CalculateCircleRegression | ( | PIXELLIST | pl, |
double & | centerX, | ||
double & | centerY, | ||
double & | radius | ||
) |
Calculate a circle from a pixel list.
This function assumes that all the pixels in the provided pixel list are located on the perimeter of a circle and calculates the center coordinates and the radius of that circle using a linear regression approach.
The regression works best if the pixels are evenly distributed over the whole perimeter of the circle. Taking pixels from only a small segment of the circle works, but the smaller that segment gets, the higher the error from the calculation will become.
At least three pixels are required to carry out the calculation and get an unambiguous result - if pl
contains less than three pixels an error CVC_E_NOTENOUGHDATA
will be returned. The processing time required for the regression increases with the 3rd power of the pixel count, i.e. if 6 pixels are given, the calculations will take 8 times as long as they would take with only 3 pixels.
[in] | pl | Pixel list. |
[out] | centerX | Center of the circle (x coordinate in the same units the pixel list is using). |
[out] | centerY | Center of the circle (y coordinate in the same units the pixel list is using). |
[out] | radius | Radius of the circle (in the same units the pixel list is using). |
cvbres_t CalculateEllipseRegression | ( | PIXELLIST | pl, |
double & | centerX, | ||
double & | centerY, | ||
double & | radiusA, | ||
double & | radiusB, | ||
double & | rotation | ||
) |
Calculate an ellipse from a pixel list.
This function assumes that all the pixels in the provided pixel list are located on the perimeter of an ellipse and calculates the center coordinates, the two semi major axises and the rotation angle of that ellipse using a linear regression approach.
The regression works best if the pixels are evenly distributed over the whole perimeter of the ellipse. Taking pixels from only a small segment of the ellipse works, but the smaller that segment gets, the higher the error from the calculation will become.
At least six pixels are required to carry out the calculation and get an unambiguous result - if pl
contains less than six pixels an error CVC_E_NOTENOUGHDATA
will be returned.
[in] | pl | Pixel list. |
[out] | centerX | Center of the ellipse (x coordinate in the same units the pixel list is using). |
[out] | centerY | Center of the ellipse (y coordinate in the same units the pixel list is using). |
[out] | radiusA | Semi major radius of the ellipse (in the same units the pixel list is using). |
[out] | radiusB | Semi major radius of the ellipse (in the same units the pixel list is using). |
[out] | rotation | Rotation angle of the ellipse (in degrees). |
Compares two angles.
For the comparison keep in mind, that angles wrap around at -Pi and + Pi (-180 degrees and +180 degrees) which means that there will never be an angle of e.g. 181 and an angle created with 181 degrees will actually be smaller than one created with 179 degrees because 181 degrees internally becomes -179 degrees.
[in] | Angle1 | First angle for comparison. |
[in] | Angle2 | Second angle for comparison. |
[out] | Result | Result of the comparison: 0 if Angle 1 = Angle 2 1 if Angle 1 > Angle 2 -1 if Angle 1 < Angle 2 |
ANGLE CreateAngle | ( | ) |
ANGLE CreateAngleArgument | ( | double | X, |
double | Y | ||
) |
Create an angle object and initialize it with angle between the x-axis and the point whose coordinates are given.
[in] | X | X-coordinate of the point. |
[in] | Y | Y-coordinate of the point. |
NULL
if creation failed. ANGLE CreateAngleDegrees | ( | double | Deg | ) |
Create an angle object and initialize it with an angle given in degrees.
[in] | Deg | Initialization value in degrees. |
NULL
if creation failed. ANGLE CreateAngleRadians | ( | double | Rad | ) |
Create an angle object and initialize it with an angle given in radians.
[in] | Rad | Initialization value in radians. |
NULL
if creation failed. CIRCLE2D CreateCircle2D | ( | ) |
Create an uninitialized circle object (center at (0,0), radius 0).
NULL
if creation failed. Create a circle object based on a regression based on the points given in the input pixel-list.
The regression assumes that all the points in the input pixel list are lying on the \b perimeter of a circle. \n\n The algorithm then performs a linear regression to find out the <b>center point</b> and \b radius of the circle, minimizing the error of both parameters on the input pixel list. \n\n Regression requires at least two pixels in the input pixel list (in which case the output circle will be an exact result). For 3 input pixels, the result will be exact as well, any additional pixels may introduce a statistical error. Regression is based on a QR split, therefore processing time increases with n<sup>3</sup>.
[in] | RegressionList | Pixel list containing the pixels that define the circle object. |
NULL
if creation failed. CIRCLE2D CreateCircle2DParametric | ( | double | CenterX, |
double | CenterY, | ||
double | Radius | ||
) |
Create a circle object by defining its center point and radius.
[in] | CenterX | X-coordinate of the circle's center. |
[in] | CenterY | Y-coordinate of the circle's center. |
[in] | Radius | Radius of the circle. |
NULL
if creation failed. LINE2D CreateLine2DAnalytical | ( | double | A, |
double | B, | ||
cvbbool_t | AxplusB | ||
) |
Create a line object according to its analytical formula.
[in] | A | Steepness parameter of the line. |
[in] | B | Offset parameter of the line. |
[in] | AxplusB | Specifies the formula to be used to define the line. = A * x + B (cannot define a vertical line) = A * y + B (cannot define a horizontal line) |
NULL
if creation failed. Create a line object by performing a linear regression over an input pixel-list.
[in] | RegressionList | List of pixels that define the line. |
NULL
if creation failed. Create a line object by specifying its distance from the origin and the direction in which the line is running.
The direction of the line is the direction of the tangent on the circle around the origin with radius r.
[in] | Distance | Line's distance from the origin. |
[in] | Direction | Direction of the line. |
NULL
if creation failed. Create a line object by specifying its distance from the origin and a normal vector on the line.
[in] | Normal | Vector that is perpendicular on the line. |
[in] | Distance | Line's distance from the origin. |
NULL
if creation failed. Create a line object by defining two points that are lying on the line.
[in] | Point1 | First point on the line. |
[in] | Point2 | Second point on the line. |
NULL
if creation failed. Create a line object by defining a point on the line and the angle at which the line passes through that point.
[in] | Vector | Point on the line |
[in] | Direction | Direction of the line passing through the point. |
NULL
if creation failed. Create a normalized version of the input vector.
The normalized vector has the same orientation as the input vector, but with length 1.
[in] | Input | Handle of input vector. |
[out] | Output | Handle of normalized output vector. Attention: The vector object must be released using ReleaseObject once it is no longer used. |
Create a normal vector of the input vector.
The output vector has the same length as the input vector, but is perpendicular on the input vector.
[in] | Input | Handle of input vector. |
[out] | Output | Handle of normal vector. Attention: The vector object must be released using ReleaseObject once it is no longer used. |
Create a line object that is perpendicular to the input line and runs through a given point.
[in] | Line | Handle of input line object. |
[in] | Point | Point through which the new line should run. |
NULL
if creation failed. VECTOR2D CreateVector2D | ( | ) |
VECTOR2D CreateVector2DCartesian | ( | double | X, |
double | Y | ||
) |
Create a vector object and initializes it with the specified cartesian data.
[in] | X | X-component of the vector. |
[in] | Y | Y-component of the vector. |
NULL
if creation failed. VECTOR2D CreateVector2DFromPOINT | ( | POINT | Vertex | ) |
Create a vector object and initializes it with the values taken from the specified POINT structure.
[in] | Vertex | Point with which to initialize the vector. |
NULL
if creation failed. Create a vector object and initialize it with values given in radial coordinates.
[in] | Ang | Angle coordinate of the vector. |
[in] | Radius | Radius coordinate of the vector. |
NULL
if creation failed. Calculates the two points at which a line object (potentially) intersects with a TDRect structure.
[in] | Line | Handle of line object to calculate the intersection for. |
[in] | ClippingRect | Rectangle with which to intersect the line. |
[out] | Clip1 | Handle to a newly created vector object containing the first intersection point. Attention: The vector object must be released using ReleaseObject once it is no longer used. |
[out] | Clip2 | Handle to a newly created vector object containing the second intersection point. Attention: The vector object must be released using ReleaseObject once it is no longer used. |
cvbres_t GetAngleCosine | ( | ANGLE | Angle, |
double & | Cosine | ||
) |
Get the cosine of an angle object.
This function either calculates the cosine using the standard implementation of that function, or it approximates the value by transparently using a lookup table that has been previously generated with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
[in] | Angle | Handle of angle object. |
[out] | Cosine | Cosine of the angle object. |
cvbres_t GetAngleDegrees | ( | ANGLE | Angle, |
double & | Degrees | ||
) |
cvbres_t GetAngleRadians | ( | ANGLE | Angle, |
double & | Radians | ||
) |
cvbres_t GetAngleSine | ( | ANGLE | Angle, |
double & | Sine | ||
) |
Get the sine of an angle object.
This function either calculates the sine using the standard implementation of that function, or it approximates the value by transparently using a lookup table that has been previously generated with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
[in] | Angle | Handle of angle object. |
[out] | Sine | Sine of the angle object. |
cvbres_t GetAngleTangent | ( | ANGLE | Angle, |
double & | Tangent | ||
) |
Get the tangent of an angle object.
This function either calculates the sine using the standard implementation of that function, or it approximates the value by transparently using a lookup table that has been previously generated with \ref SetAngleLUTGranularityDeg or \ref SetAngleLUTGranularityRad.
[in] | Angle | Handle of angle object. |
[out] | Tangent | Tangent of the angle object. |
cvbres_t GetCircle2DCenter | ( | CIRCLE2D | Circle, |
double & | CenterX, | ||
double & | CenterY | ||
) |
Retrieve the center of a circle object.
[in] | Circle | Handle of circle object. |
[out] | CenterX | X-coordinate of the circle's center. |
[out] | CenterY | Y-coordinate of the circle's center. |
cvbres_t GetCircle2DRadius | ( | CIRCLE2D | Circle, |
double & | Radius | ||
) |
Get measure for the quality of a fitted circle.
[in] | Circle | Circle2D Circle fitted into the point list (e.g. by regression). |
[in] | PointList | PIXELLIST Measured points, the circle is created from |
[out] | Roundness | double& The roundness is defined as the mean percentage deviation between a measured point and its equivalent on the circumference |
PIXELLIST
, CIRCLE2D cvbres_t GetLine2DAXBFormula | ( | LINE2D | Line, |
double & | A, | ||
double & | B | ||
) |
Get the analytical formula in the shape y = A * x + B that describes a line object.
[in] | Line | Handle of line object. |
[out] | A | Slope parameter of the formula. |
[out] | B | Offset parameter of the formula. |
cvbres_t GetLine2DAYBFormula | ( | LINE2D | Line, |
double & | A, | ||
double & | B | ||
) |
Get the analytical formula in the shape x = A * y + B that describes a line object.
[in] | Line | Handle of line object. |
[out] | A | Slope parameter of the formula. |
[out] | B | Offset parameter of the formula. |
Retrieves the inclination of a line object (the angle at which it intersects the x-axis of the coordinate system).
[in] | Line | Handle of line object to retrieve the inclination for. |
[out] | Inclination | Inclination of the line. Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
Calculate the angle at which two lines intersect.
[in] | Line1 | Handle of first line object for the intersection. |
[in] | Line2 | Handle of second line object for the intersection. |
[out] | Intersection | Intersection angle of the two lines or NULL if they do not intersect. Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
Get the point at which two lines intersect.
[in] | Line1 | Handle of first line object for the intersection. |
[in] | Line2 | Handle of second line object for the intersection. |
[out] | Result | Intersection point of the two lines or NULL if they do not intersect. Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
Calculate normal vector of a line object.
[in] | Line | Handle of line object for which to calculate the normal vector. |
[out] | Vector | Normal vector on the line. Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
cvbres_t GetLine2DOriginDistance | ( | LINE2D | Line, |
double & | Distance | ||
) |
Get the distance of a line object from the origin.
[in] | Line | Handle of line object for which to retrieve the distance. |
[out] | Distance | Distance of the line object from the origin. |
Get a point on a line object and the angle at which the line crosses that point.
[in] | Line | Handle of line object. |
[out] | Vector | Vector pointing from the origin to a point on the line. Attention: The vector object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
[out] | Angle | Angle at which the line crosses the point pointed to by Vector. Attention: The angle object will be created by the function and needs to be cleared with the ReleaseObject function once it is no longer used! |
cvbres_t GetManyLine2DIntersectionPoint | ( | LINE2D * | LineArray, |
size_t | ArrayLength, | ||
double | ConvergenceThreshold, | ||
cvbval_t | MaxIterations, | ||
VECTOR2D & | Point | ||
) |
Uses an iteration scheme to approximate the intersection point of an array of line objects.
[in] | LineArray | Array of handles to line objects for which to calculate the intersection approximation. |
[in] | ArrayLength | Length of the line array. |
[in] | ConvergenceThreshold | Threshold for the convergence. If during the iteration process the difference between two steps is below this threshold, the iteration stops. Therefore this threshold is also the upper limit of the error if the iteration succeeds. |
[in] | MaxIterations | Number of iterations after which to stop the iteration process. Specifying -1 will run indefinitely. |
[out] | Point | Intersection point. |
Calculate the distance between two points pointed to by two vectors.
[in] | Point1 | Vector pointing to first point. |
[in] | Point2 | Vector pointing to second point. |
[out] | Distance | Distance between those points. |
Get the distance between a line and a point.
[in] | Line | Handle of line object for the distance calculation. |
[in] | Point | Handle of the point for the distance calculation. |
[out] | Distance | Distance between the point and the line. |
cvbres_t GetVector2DCartesian | ( | VECTOR2D | Input, |
double & | X, | ||
double & | Y | ||
) |
Get the Cartesian components of a 2D vector object.
[in] | Input | Handle of vector for which to retrieve the Cartesian components. |
[out] | X | X-component of the vector. |
[out] | Y | Y-component of the vector. |
cvbres_t GetVector2DLength | ( | VECTOR2D | Input, |
double & | Length | ||
) |
Get the radial coordinates of a 2D vector object.
[in] | Input | Handle of vector for which to retrieve the radial coordinates. |
[out] | Angle | Radial coordinate. Attention: This object must be released with the ReleaseObject function once it is no longer needed! |
[out] | Radius | Radius coordinate of the angle. |
Calculates the inner product of two vectors.
[in] | Vector1 | Handle of first vector object. |
[in] | Vector2 | Handle of second vector object. |
[out] | Result | Inner product of both vectors. |
BOOL IsAngle | ( | ANGLE | Handle | ) |
Checks whether two vectors are anti parallel (i.e. parallel but pointing into different directions).
[in] | Vector1 | Handle of first vector object to be checked. |
[in] | Vector2 | Handle of second vector object to be checked. |
[out] | Result | TRUE indicates that both vectors are anti parallel, FALSE otherwise. |
BOOL IsCircle2D | ( | CIRCLE2D | Handle | ) |
Checks whether two circles are equal.
[in] | Circle1 | Handle of first circle to be checked. |
[in] | Circle2 | Handle of second circle to be checked. |
[out] | Result | TRUE if the circles are identical, FALSE otherwise. |
Checks two line objects for equality.
[in] | Line1 | Handle of first line to be checked. |
[in] | Line2 | Handle of second line to be checked. |
[out] | Result | TRUE if the lines are identical, FALSE otherwise. |
Checks two vector objects for equality.
[in] | Vector1 | Handle of first vector to be checked. |
[in] | Vector2 | Handle of second vector to be checked. |
[out] | Result | TRUE if the vectors are identical, FALSE otherwise. |
BOOL IsLine2D | ( | LINE2D | Handle | ) |
Checks whether two line objects are parallel.
[in] | Line1 | Handle of first line object to be checked. |
[in] | Line2 | Handle of second line object to be checked. |
[out] | Result | TRUE if the lines are parallel, FALSE otherwise. |
Checks whether two line objects are perpendicular.
[in] | Line1 | Handle of first line object to be checked. |
[in] | Line2 | Handle of second line object to be checked. |
[out] | Result | TRUE if the lines are perpendicular, FALSE otherwise. |
Checks whether two vector objects are parallel.
[in] | Vector1 | Handle of first vector to be checked. |
[in] | Vector2 | Handle of second vector to be checked. |
[out] | Result | TRUE if the vectors are parallel, FALSE otherwise. |
Checks whether two vector objects are perpendicular.
[in] | Vector1 | Handle of first vector to be checked. |
[in] | Vector2 | Handle of second vector to be checked. |
[out] | Result | TRUE if the vectors are perpendicular, FALSE otherwise. |
cvbres_t IsPointInCircle2D | ( | CIRCLE2D | Circle, |
double | PointX, | ||
double | PointY, | ||
cvbbool_t & | Result | ||
) |
Checks whether a given point is inside a circle.
[in] | Circle | Handle of circle for the check. |
[in] | PointX | X-coordinate of the location to be checked. |
[in] | PointY | Y-coordinate of the location to be checked. |
[out] | Result | TRUE if the point is inside the given circle, FALSE otherwise. |
cvbres_t IsPointOnCircle2DRadius | ( | CIRCLE2D | Circle, |
double | PointX, | ||
double | PointY, | ||
double | Epsilon, | ||
cvbbool_t & | Result | ||
) |
Checks whether a point is on the radius (or within a small epsilon environment of the radius) of a circle object.
[in] | Circle | Handle of circle for the check. |
[in] | PointX | X-coordinate of the location to be checked. |
[in] | PointY | Y-coordinate of the location to be checked. |
[in] | Epsilon | Size of the environment for the check. |
[out] | Result | TRUE if the point is on the radius of the circle, FALSE otherwise. |
BOOL IsVector2D | ( | LINE2D | Handle | ) |
cvbres_t MultiplyAngle | ( | ANGLE | Angle, |
double | Constant | ||
) |
Multiply an angle with a (dimension-free) number.
[in] | Angle | Angle object to be multiplied. |
[in] | Constant | Constant with which to multiply the angle. |
Multiply a vector with a scalar.
[in] | Vector | Handle of vector to be multiplied. |
[in] | Scalar | Scalar with which to multiply the vector. |
[out] | Result | Handle of the result vector. Attention: This object must be released with the ReleaseObject function once it is no longer needed! |
cvbres_t SetAngleArgument | ( | ANGLE | Angle, |
double | X, | ||
double | Y | ||
) |
Set an angle to a new value which is defined as the angle between the x-axis and the line connecting the origin to a point (X,Y).
[in] | Angle | Handle of angle object to be changed. |
[in] | X | X-coordinate of the point defining the new angle. |
[in] | Y | Y-coordinate of the point defining the new angle. |
cvbres_t SetAngleDegrees | ( | ANGLE | Angle, |
double | Degrees | ||
) |
Set an angle object to a new value.
[in] | Angle | Handle of angle object to be changed. |
[in] | Degrees | New value to be set. |
void SetAngleLUTGranularityDeg | ( | double | Granularity | ) |
Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations.
The size (and therefore the precision) of these lookup tables depends on the granularity with which they were generated. The lookup tables are automatically used by the functions \ref GetAngleSine, \ref GetAngleCosine and \ref GetAngleTangent.
[in] | Granularity | Granularity with which to generate the lookup table. If the granularity is 0 or less, then no lookup table will be used internally. |
void SetAngleLUTGranularityRad | ( | double | Granularity | ) |
Generates internal lookup-tables for sin, cos and tan to speed up these geometric operations.
The size (and therefore the precision) of these lookup tables depends on the granularity with which they were generated. The lookup tables are automatically used by the functions \ref GetAngleSine, \ref GetAngleCosine and \ref GetAngleTangent.
[in] | Granularity | Granularity with which to generate the lookup table. If the granularity is 0 or less, then no lookup table will be used internally. |
cvbres_t SetAngleRadians | ( | ANGLE | Angle, |
double | Radians | ||
) |
cvbres_t SetLine2DAnalytical | ( | LINE2D | Line, |
double | A, | ||
double | B, | ||
cvbbool_t | AxplusB | ||
) |
Change a line object according to its analytical formula.
[in] | Line | Handle of line object to be modified. |
[in] | A | Steepness parameter of the line. |
[in] | B | Offset parameter of the line. |
[in] | AxplusB | Specifies the formula to be used to define the line TRUE: y = A * x + B (cannot define a vertical line) FALSE: x = A * y + B (cannot define a horizontal line) |
Modifies a 2D line object by performing a linear regression over an input pixel list.
[in] | Line | Handle of line object to be modified. |
[in] | RegressionList | List of pixels that define the line. |
Modifies a line 2D object by specifying its distance from the origin and the direction in which the line is running (direction of the tangent on the circle around the origin with radius r).
[in] | Line | Handle of line object to be modified. |
[in] | Distance | Line's distance from the origin. |
[in] | Direction | Direction of the line. |
cvbres_t SetLine2DOriginDistance | ( | LINE2D | Line, |
double | Distance | ||
) |
Change a line object by specifying two points the line should cross.
[in] | Line | Handle of line object to be changed. |
[in] | Point1 | Handle of first point defining the new line. |
[in] | Point2 | Handle of second point defining the new line. |
cvbres_t SetVector2DCartesian | ( | VECTOR2D | Input, |
double | X, | ||
double | Y | ||
) |
Set a 2D vector object to new radial coordinates.
[in] | Input | Handle of vector object to be modified. |
[in] | Angle | New angle coordinate to be set. |
[in] | Radius | New radius coordinate to be set. |
Subtracts two angle objects.
Automatically takes care of the fact that the angles wrap around at -Pi and +Pi.
[in] | Angle1 | First angle to be subtracted. |
[in] | Angle2 | Second angle to be subtracted. |
[out] | Diff | Handle of result angle containing the difference (Angle1 - Angle2). Attention: Handle must be released with the ReleaseObject when no longer needed. |
Build the difference of two vectors.
[in] | Vector1 | First vector for the subtraction. |
[in] | Vector2 | Second vector for the subtraction. |
[out] | Result | Newly created result vector containing the difference (Vector1 - Vector2 ). Attention: Handle must be released with the ReleaseObject when no longer needed. |