Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILCalibRotation Interface Reference

This interface provide functionalities of the rotation center calibration and alignment task. More...

Inheritance diagram for ILCalibRotation:
ILObject LCalibRotation

Public Member Functions

void AddRotPoint (double pntX, double pntY, double angle)
 
void AddRotPointPair (double pntX1, double pntY1, double pntX2, double pntY2, double angle)
 
void Align (double pntX1, double pntY1, double pntX2, double pntY2, double *dx, double *dy, double *da)
 
void AlignTo (double pntX1, double pntY1, double pntX2, double pntY2, double aimPointX1, double aimPointY1, double aimPointX2, double aimPointY2, double *dx, double *dy, double *da)
 
LPVErrorCode Calibrate ()
 
ILPointGetRotCenter ()
 
BOOL IsCalibrated ()
 
void SetAim (double aimPointX1, double aimPointY1, double aimPointX2, double aimPointY2)
 
void Transform (double pntX, double pntY, double dx, double dy, double da, double *newX, double *newY)
 
- Public Member Functions inherited from ILObject
ILObjectCopy ()
 
LPVErrorCode Load (LString filename)
 
void Reset ()
 
LPVErrorCode Save (LString filename)
 
BOOL Valid ()
 

Properties

BOOL TranslationOnRotation [get, set]
 Whether the translation platform is dependent on the rotation platform. By default, it's off.
If yes, then the rotation drives and changes the coordinates of translation platform, affect its translation direction in physical world.
.
 

Detailed Description

This interface provide functionalities of the rotation center calibration and alignment task.

The rotation calibration is commonly used in a vision system with rotation platform for guiding, grabbing and alignment tasks.
The center is estimated with the rotation points or pairs of points around the center. The rotation calibration is usually done after the hand-eye calibration using N-Points model. Thus, the points here in most use case indicates the world points.

After calibration, you can use the center for aim-object alignment, it report the translation and rotation for align the aim and object point.

To use this interface, you should create a LCalibRotation object.

Example Code

Member Function Documentation

◆ AddRotPoint()

void AddRotPoint ( double  pntX,
double  pntY,
double  angle 
)

Add a rotation point for calibration. It forms a rotation circular path around the rotation center.

Parameters
[in]pntXThe x-coordinate of the rotation point.
[in]pntYThe y-coordinate of the rotation point.
[in]angleThe rotation angle of the platform, pass in -1 (default) to ignore this value.

◆ AddRotPointPair()

void AddRotPointPair ( double  pntX1,
double  pntY1,
double  pntX2,
double  pntY2,
double  angle 
)

Add a pair of rotation points for calibration. It forms two concentric circular paths around the rotation center.

Parameters
[in]pntX1The x-coordinate of the 1st rotation point.
[in]pntY1The y-coordinate of the 1st rotation point.
[in]pntX2The x-coordinate of the 2nd rotation point.
[in]pntY2The y-coordinate of the 2nd rotation point.
[in]angleThe rotation angle of the platform, pass in -1 (default) to ignore this value.

◆ Align()

void Align ( double  pntX1,
double  pntY1,
double  pntX2,
double  pntY2,
double *  dx,
double *  dy,
double *  da 
)

Align the object to the configured aim position. The mapping works with a calibrated system, if not the outputs are all zeros.

Parameters
[in]pntX1The x-coordinate of the 1st mark of the object position.
[in]pntY1The y-coordinate of the 1st mark of the object position.
[in]pntX2The x-coordinate of the 2nd mark of the object position.
[in]pntY2The y-coordinate of the 2nd mark of the object position.
[out]dxReturn the offset in x coordinate for the platform to align the object to the aim position.
[out]dyReturn the offset in y coordinate for the platform to align the object to the aim position.
[out]daReturn the rotation for the platform to align the object to the aim position.
See also
SetAim(), AlignTo().

◆ AlignTo()

void AlignTo ( double  pntX1,
double  pntY1,
double  pntX2,
double  pntY2,
double  aimPointX1,
double  aimPointY1,
double  aimPointX2,
double  aimPointY2,
double *  dx,
double *  dy,
double *  da 
)

Align the object to the given aim position. The mapping works with a calibrated system, if not the outputs are all zeros.

Parameters
[in]aimPointX1The x-coordinate of the 1st mark of the aim position.
[in]aimPointY1The y-coordinate of the 1st mark of the aim position.
[in]aimPointX2The x-coordinate of the 2nd mark of the aim position.
[in]aimPointY2The y-coordinate of the 2nd mark of the aim position.
[in]pntX1The x-coordinate of the 1st mark of the object position.
[in]pntY1The y-coordinate of the 1st mark of the object position.
[in]pntX2The x-coordinate of the 2nd mark of the object position.
[in]pntY2The y-coordinate of the 2nd mark of the object position.
[out]dxReturn the offset in x coordinate for the platform to align the object to the aim position.
[out]dyReturn the offset in y coordinate for the platform to align the object to the aim position.
[out]daReturn the rotation for the platform to align the object to the aim position.
See also
Align(), SetAim().

◆ Calibrate()

LPVErrorCode Calibrate ( )

Do calibration with current configuration and the rotation points added.

Return values
errorReturn error code if anything is wrong.

◆ GetRotCenter()

ILPoint* GetRotCenter ( )

Get the estimated rotation center

◆ IsCalibrated()

BOOL IsCalibrated ( )

Check whether the calibration object is well-calibrated.

Return values
valReturn true if it's calibrated, otherwise, return false.

◆ SetAim()

void SetAim ( double  aimPointX1,
double  aimPointY1,
double  aimPointX2,
double  aimPointY2 
)

Set the aligning aim position.

Parameters
[in]aimPointX1The x-coordinate of the 1st mark of the aim position.
[in]aimPointY1The y-coordinate of the 1st mark of the aim position.
[in]aimPointX2The x-coordinate of the 2nd mark of the aim position.
[in]aimPointY2The y-coordinate of the 2nd mark of the aim position.
See also
Align(), AlignTo().

◆ Transform()

void Transform ( double  pntX,
double  pntY,
double  dx,
double  dy,
double  da,
double *  newX,
double *  newY 
)

Transform the given point

Parameters
[in]pntXThe x-coordinate of the point.
[in]pntYThe y-coordinate of the point.
[in]dxThe offset in x coordinate.
[in]dyThe offset in y coordinate.
[in]daThe rotation angle.
[out]newXOutput the x-coordinate of the transformed point.
[out]newYOutput the y-coordinate of the transformed point.