Class ArucoCameraCalibration
Calibrates a ArucoCamera with a ArucoBoard and saves the calibrated camera parameters in a file managed by ArucoCameraParametersController. Base class to reference in editor fields.
See the OpenCV and the ArUco module documentations for more information about the calibration process: http://docs.opencv.org/3.4/da/d13/tutorial_aruco_calibration.html and https://docs.opencv.org/3.4/da/d13/tutorial_aruco_calibration.html
Inheritance
Inherited Members
Namespace: ArucoUnity.Calibration
Assembly: Assembly-CSharp.dll
Syntax
public abstract class ArucoCameraCalibration : ArucoObjectDetector, IArucoCameraController, IController, IHasDetectorParameter
Fields
| Improve this Doc View SourceapplicationPath
Declaration
protected string applicationPath
Field Value
Type | Description |
---|---|
String |
calibratingException
Declaration
protected Exception calibratingException
Field Value
Type | Description |
---|---|
Exception |
calibratingMutex
Declaration
protected Mutex calibratingMutex
Field Value
Type | Description |
---|---|
Mutex |
calibratingThread
Declaration
protected Thread calibratingThread
Field Value
Type | Description |
---|---|
Thread |
Properties
| Improve this Doc View SourceAllMarkerCorners
Gets the detected marker corners for each camera.
Declaration
public Std.VectorVectorVectorPoint2f[] AllMarkerCorners { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorVectorVectorPoint2f[] |
AllMarkerIds
Gets the detected marker ids for each camera.
Declaration
public Std.VectorVectorInt[] AllMarkerIds { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorVectorInt[] |
CalibrationBoard
Gets or sets the ArUco board to use for calibration.
Declaration
public ArucoBoard CalibrationBoard { get; set; }
Property Value
Type | Description |
---|---|
ArucoBoard |
CalibrationFlags
Gets or sets the flags for the cameras calibration.
Declaration
public CalibrationFlags CalibrationFlags { get; set; }
Property Value
Type | Description |
---|---|
CalibrationFlags |
CalibrationRunning
Gets if CalibrateAsync() has been called and hasn't completed yet.
Declaration
public bool CalibrationRunning { get; protected set; }
Property Value
Type | Description |
---|---|
Boolean |
CameraParametersController
Gets or sets the camera parameters to use if UseIntrinsicGuess is true. Otherwise, the camera parameters file will be generated from the camera name and the calibration datetime.
Declaration
public ArucoCameraParametersController CameraParametersController { get; set; }
Property Value
Type | Description |
---|---|
ArucoCameraParametersController |
Images
Gets the images to use for the calibration.
Declaration
public Std.VectorMat[] Images { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorMat[] |
IsCalibrated
Gets if the last CalibrateAsync() call has been a success.
Declaration
public bool IsCalibrated { get; protected set; }
Property Value
Type | Description |
---|---|
Boolean |
MarkerCorners
Gets the detected marker corners on the current images of each camera.
Declaration
public Std.VectorVectorPoint2f[] MarkerCorners { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorVectorPoint2f[] |
MarkerIds
Gets the detected marker ids on the current images of each camera.
Declaration
public Std.VectorInt[] MarkerIds { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorInt[] |
RefineMarkersDetection
Gets or sets if need to use a refine algorithm to find not detected markers based on the already detected and the board layout.
Declaration
public bool RefineMarkersDetection { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Rvecs
Gets the estimated rotation vector for each detected markers in each camera.
Declaration
public Std.VectorVec3d[] Rvecs { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorVec3d[] |
Tvecs
Gets the estimated translation vector for each detected markers in each camera.
Declaration
public Std.VectorVec3d[] Tvecs { get; protected set; }
Property Value
Type | Description |
---|---|
Std.VectorVec3d[] |
Methods
| Improve this Doc View SourceAddImages()
Adds the current images of the cameras and the detected corners for the calibration.
Declaration
public virtual void AddImages()
ArucoCamera_ImagesUpdated()
Detects and draw the ArUco markers on the current images of the cameras.
Declaration
protected virtual void ArucoCamera_ImagesUpdated()
Calibrate()
Calibrates each mono camera in ArucoCamera using the detected markers added with AddImages(), the ArucoCameraParameters, the ArucoCameraUndistortion and save the results on a calibration file. Stereo calibrations will be additionally executed on these results for every camera pair.
Declaration
public virtual void Calibrate()
Calibrate(Std.VectorVectorPoint2f[], Std.VectorVectorPoint3f[])
Applies a calibration to the ArucoCamera, set the extrinsic camera parameters to Rvecs and Tvecs and saves the camera parameters in CameraParameters.
Declaration
protected abstract void Calibrate(Std.VectorVectorPoint2f[] imagePoints, Std.VectorVectorPoint3f[] objectPoints)
Parameters
Type | Name | Description |
---|---|---|
Std.VectorVectorPoint2f[] | imagePoints | The detected image points of each camera. |
Std.VectorVectorPoint3f[] | objectPoints | The corresponding object points of each camera. |
CalibrateAsync()
Calls Calibrate() in a background thread.
Declaration
public virtual void CalibrateAsync()
CancelCalibrateAsync()
Stops the calibration if CalibrationRunning is true.
Declaration
public virtual void CancelCalibrateAsync()
Configuring()
Checks if CalibrationBoard is set and calls ResetCalibration().
Declaration
protected override void Configuring()
Overrides
| Improve this Doc View SourceDetectMarkers()
Detects the Aruco markers on the current images of the cameras and store the results in the MarkerCorners and MarkerIds properties.
Declaration
public virtual void DetectMarkers()
DrawDetectedMarkers()
Draws the detected ArUco markers on the current images of the cameras.
Declaration
public virtual void DrawDetectedMarkers()
InitializeCameraParameters()
Initializes and configure the CameraParameters.
Declaration
protected virtual void InitializeCameraParameters()
LateUpdate()
Calls the Calibrated event when a calibration has just completed.
Declaration
protected virtual void LateUpdate()
ResetCalibration()
Resets the properties.
Declaration
public virtual void ResetCalibration()
Starting()
Susbcribes to UndistortRectifyImages.
Declaration
protected override void Starting()
Overrides
| Improve this Doc View SourceStopping()
Unsusbcribes from UndistortRectifyImages.
Declaration
protected override void Stopping()
Overrides
Events
| Improve this Doc View SourceCalibrated
Called when IsCalibrated is set to true.
Declaration
public event Action Calibrated
Event Type
Type | Description |
---|---|
Action |