Camera Target Detection
The targets described on this page can be detected using scripts/detection/camera_target.py.
The configuration classes listed below are provided to the detection scripts as yaml files.
Examples are located in the scripts/detection/configs directory.
Type |
Config |
|---|---|
|
|
|
|
|
The camera images are provided as image files (e.g., png or jpg) in a directory.
Their filenames represent the timestamp in nanoseconds as integer.
The directory must further contain an intrinsics.yaml file, providing the camera intrinsics:
- class excalibur.io.camera.CameraIntrinsics(camera_matrix: numpy.ndarray, dist_coeffs: numpy.ndarray = <factory>)[source]
- camera_matrix: ndarray
3x3 camera matrix
- dist_coeffs: ndarray
vector with distortion coefficients in opencv format
Example images, generated using the CARLA Simulator, are located in the test/detection directory.
Alternatively, a ROS2 bag can be used as input.
For this, the topic containing sensor_msgs/Image messages must be provided.
The intrinsics are automatically extracted from the respective sensor_msgs/CameraInfo topic.
Checkerboard
Detect and estimate the 3D pose of a checkerboard.
Note
A unique estimation of the 3D pose of a checkerboard from camera images is not always possible. This issue, called flip ambiguity, is explained in detail in IPPE by Toby Collins. The Checkerboard-ArUco combination can resolve this issue by including additional non-coplanar ArUco markers.
- class excalibur.targets.camera.checkerboard.CheckerboardConfig(board_dim: Tuple[int, int], square_length: float | None = None, flags: int | None = None, fast_check: bool = False)[source]
Configuration for checkerboard detection.
- board_dim: Tuple[int, int]
number of cells (length/x, width/y)
- square_length: float | None = None
cell size [m]
- flags: int | None = None
checkerboard detection flags for cv2.findChessboardCorners
- fast_check: bool = False
run fast check before full estimation
ChArUco Board
Detect and estimate the 3D pose of a ChArUco board.
Note
Since the checkerboard and all ArUco markers are coplanar, the previously mentioned flip-ambiguity can also apply here.
- class excalibur.targets.camera.charuco.CharucoBoardConfig(dict_id: int, board_dim: ~typing.Tuple[int, int], square_length: float, marker_length: float, aruco_params: ~cv2.aruco.DetectorParameters = <factory>)[source]
Configuration for ChArUco board detection.
- dict_id: int
aruco dictionary identifier (e.g., 0 for cv2.aruco.DICT_4X4_50)
- board_dim: Tuple[int, int]
number of cells (length/x, width/y)
- square_length: float
cell size [m]
- marker_length: float
marker side length [m]
- aruco_params: DetectorParameters
Checkerboard-ArUco Combination
Detect and estimate the 3D pose of a checkerboard, supported by ArUco markers with a known approximate relative pose with respect to the checkerboard. The ArUco markers help to preselect the checkerboard within the camera image. Furthermore, a non-coplanar ArUco marker can resolve the flip ambiguity of the checkerboard detection.
- class excalibur.targets.camera.checkerboard_combi.ArucoMarker(length: float, pose: TransformInterface)[source]
Single ArUco marker configuration for combined ArUco-checkerboard detection.
- length: float
marker side length [m]
- pose: TransformInterface
marker pose w.r.t. the checkerboard
- class excalibur.targets.camera.checkerboard_combi.CheckerboardCombiConfig(name: str, checkerboard_cfg: ~excalibur.targets.camera.checkerboard.CheckerboardConfig, dict_id: int, markers: ~typing.Dict[int, ~excalibur.targets.camera.checkerboard_combi.ArucoMarker], cutout_margin: float, force_z_up: False, aruco_params: ~cv2.aruco.DetectorParameters = <factory>)[source]
Configuration for combined checkerboard-ArUco detection.
- name: str
unique checkerboard identifier string
- checkerboard_cfg: CheckerboardConfig
checkerboard detection configuration
- dict_id: int
aruco dictionary identifier (e.g., 0 for cv2.aruco.DICT_4X4_50)
- markers: Dict[int, ArucoMarker]
available aruco markers with identifier as key
- cutout_margin: float
margin for the checkerboard cutout w.r.t. the relative aruco pose [m]
- force_z_up: False
force the checkerboard z-axis to point upwards in positive z-direction
- aruco_params: DetectorParameters
parameters for aruco detection