Class for aruco calibration and point transformations from workspace to camera.
More...
Class for aruco calibration and point transformations from workspace to camera.
- Parameters
-
| [in] | markerLength | length of the aruco marker in meters |
| [in] | cam | camera used to gather frames |
| [in] | cameraMatrix | the intrinsic camera matrix |
| [in] | distortionCoeffs | the distortion coefficients of the camera |
| [in] | calibrationLoops | the number of times a frame needs to be read from the camera before the image is stable |
| [in] | arucoDict | the predefined aruco dictionary that the marker belongs to |
◆ __init__()
| def __init__ |
( |
|
self, |
|
|
float |
markerLength, |
|
|
Base |
cam = None, |
|
|
|
cameraMatrix = None, |
|
|
|
distortionCoeffs = None, |
|
|
int |
calibrationLoops = 1000, |
|
|
|
arucoDict = cv2.aruco.DICT_6X6_100 |
|
) |
| |
Args:
markerLenght (any): length of the aruco marker in meters
cam (optional): camera used to gather frames
- if not provided, OAK-D SR camera from camera.OAK class will be used
cameraMatrix (optional): the intrinsic camera matrix
- if not provided, matrix will be from yaml file for OAK-D SR camera
distortionCoeffs (optional): the distortion coefficients of the camera
- if not provided, coefficients will be from yaml file for OAK-D SR camera
calibrationLoops (optional): the number of times a frame needs to be read from the camera before the image is stable
arucoDict (optional): the predefined aruco dictionary that the marker belongs to
◆ calibrate()
Calculate and return the transformation gCW.
- Returns
- gCW
Calculate and return the transformation gCW
Returns:
gCW: transformation in homogeneous coordinates
◆ getCameraMatrix()
| def getCameraMatrix |
( |
|
self | ) |
|
gets the intrinsic camera matrix
- Returns
- cameraMatrix
Gets the intrinsic camera matrix
Returns:
cameraMatrix: the intrinsic camera matrix
◆ getDistoritionCoeffs()
| def getDistoritionCoeffs |
( |
|
self | ) |
|
gets the camera distortion coefficients
- Returns
- distCoeffs
Gets the camera distortion coefficients
Returns:
distCoeffs: the camera distortion coefficients
◆ getgCW()
| def getgCW |
( |
|
self, |
|
|
|
bwImg |
|
) |
| |
gets the transformation from workspace to camera
- Parameters
-
| [in] | bwImg | black and white image containing an aruco tag |
- Returns
- gCW
gets the transformation from workspace to camera
Args:
bwImg (np.array (H, W)): black and white image containing an aruco tag
◆ process()
| def process |
( |
|
self, |
|
|
np.ndarray |
img, |
|
|
np.ndarray |
depth = None |
|
) |
| |
Process function to calibrate extrinsic matrix from rgb and depth frame.
- Parameters
-
| [in] | img | rgb image |
| [in] | depth | depth map |
- Returns
- gCW
Process function to calibrate extrinsic matrix from rgb and depth frame
Args:
img (np.ndarray (H, W, 3)): rgb image
depth (np.ndarray (H, W), optional): Depth map. Not used
Returns:
gCW (np.ndarray (4,4)): Extrinsic aruco-to-camera transformation matrix
◆ arucoDict
the dictionary the aruco tag belongs to
◆ calibrationLoops
the number of frames to get before calibrating
◆ cam
the camera to be used for calibration
◆ cameraMatrix
the intrinsic camera matrix
◆ distortionCoeffs
the camera distortion coefficients
◆ gCW
the camera to world transformation matrix
◆ markerLength
the length of the aruco marker in meters
◆ numberOfLoops
the number of loops currently run
◆ objPoints
the coordinates of the middle of the marker
The documentation for this class was generated from the following file: