Zivid 标定对象

Zivid 支持以下标定对象:

  • Zivid 标定板

  • ArUco 标记

The main Zivid calibration boards can be purchased at the Zivid WebShop. These boards are also used for camera maintenance with infield correction. To use the board in hand-eye calibration, both the checkerboard and ArUco marker need to be detectable in each capture.

../../../../_images/infield-calibration-boards.png

CAD files for the boards can be downloaded from Accessories Downloads.

Pose Detection

The pose returned by the checkerboard detection has its origin at the top left inner corner of the checkerboard, with the axes oriented as shown below.

../../../../_images/checkerboard-pose-origin-and-coordinate-system.png

To estimate the pose, detect the checkerboard and read the pose from the detection result.

Go to source

source

std::cout << "Detecting and estimating pose of the Zivid checkerboard in the camera frame" << std::endl;
const auto detectionResult = Zivid::Calibration::detectCalibrationBoard(frame);
if(!detectionResult.valid())
{
    throw std::runtime_error("No checkerboard detected. " + detectionResult.statusDescription());
}
const auto cameraToCheckerboardTransform = detectionResult.pose().toMatrix();
Go to source

source

Console.WriteLine("Detecting and estimating pose of the Zivid checkerboard in the camera frame");
var detectionResult = Detector.DetectCalibrationBoard(frame);
var cameraToCheckerboardTransform = new Zivid.NET.Matrix4x4(detectionResult.Pose().ToMatrix());
Go to source

source

print("Detecting and estimating pose of the Zivid checkerboard in the camera frame")
detection_result = zivid.calibration.detect_calibration_board(frame)

if not detection_result.valid():
    raise RuntimeError(f"No Checkerboard detected. {detection_result.status_description()}")

camera_to_checkerboard_transform = detection_result.pose().to_matrix()

The image above was created by projecting the pose onto the 2D image and drawing the coordinate system axes.

Go to source

source

std::cout << "Converting to OpenCV image format" << std::endl;
const auto bgraImage = pointCloudToColorBGRA_SRGB(pointCloud);
std::cout << "Visualizing checkerboard with coordinate system" << std::endl;
cv::Mat bgrCoordinateSystem;
cv::cvtColor(bgraImage, bgrCoordinateSystem, cv::COLOR_BGRA2BGR);
drawCoordinateSystem(frame, cameraToCheckerboardTransform, bgrCoordinateSystem);
displayBGR(bgrCoordinateSystem, "Checkerboard transformation frame");
Go to source

source

print("Converting to OpenCV image format")
bgra_image = point_cloud.copy_data("bgra_srgb")
print("Visualizing checkerboard with coordinate system")
bgr_coordinate_system = bgra_image[:, :, 0:3].copy()
_draw_coordinate_system(frame, camera_to_checkerboard_transform, bgr_coordinate_system)
display_bgr(bgr_coordinate_system, "Checkerboard transformation frame")

For the full example, see 基于棋盘格的坐标转换.

Zivid 手眼标定可以使用一个或多个 ArUco 标记作为标定对象。一般来说,使用的标记越多越好。您可以在 https://chev.me/arucogen/ 生成和打印 ArUco 标记。确保标记打印在平坦的表面上。我们支持的 OpenCV 字典包括 4x4、5x5、6x6 和 7x7 图案。使用 ArUco 标记进行手眼标定的一个好处是它们尺寸很小。另一个好处是,在每次捕获中并非所有标记都需要可检测到。

ArUco 标记示例

Pose Detection

The pose returned by the ArUco marker detection has its origin at the center of the marker. Its z-axis points perpendicularly into the face of the marker, as shown below.

../../../../_images/aruco-pose-origin-and-coordinate-system.png

To estimate the pose, detect the marker and read the pose from the detected marker.

Go to source

source

std::cout << "Detecting ArUco marker" << std::endl;
const auto detectionResult = Zivid::Calibration::detectMarkers(frame, markerId, markerDictionary);
std::cout << "Estimating pose of detected ArUco marker" << std::endl;
const auto cameraToMarkerTransform = detectionResult.detectedMarkers()[0].pose().toMatrix();
Go to source

source

Console.WriteLine("Detecting ArUco marker");
var detectionResult = Detector.DetectMarkers(frame, markerId, markerDictionary);
Console.WriteLine("Estimating pose of detected ArUco marker");
var cameraToMarkerTransform = new Zivid.NET.Matrix4x4(detectionResult.DetectedMarkers()[0].Pose().ToMatrix());
Go to source

source

print("Detecting ArUco marker")
detection_result = zivid.calibration.detect_markers(frame, marker_id, marker_dictionary)
print("Estimating pose of detected ArUco marker")
camera_to_marker_transform = detection_result.detected_markers()[0].pose.to_matrix()

The image above was created by projecting the pose onto the 2D image and drawing the coordinate system axes.

Go to source

source

std::cout << "Converting to OpenCV image format" << std::endl;
const auto bgraImage = pointCloudToColorBGRA_SRGB(pointCloud);
std::cout << "Visualizing ArUco marker with coordinate system" << std::endl;
cv::Mat bgrCoordinateSystem;
cv::cvtColor(bgraImage, bgrCoordinateSystem, cv::COLOR_BGRA2BGR);
drawCoordinateSystem(frame, cameraToMarkerTransform, bgrCoordinateSystem);
displayBGR(bgrCoordinateSystem, "ArUco marker transformation frame");
Go to source

source

print("Converting to OpenCV image format")
bgra_image = point_cloud.copy_data("bgra_srgb")
print("Visualizing ArUco marker with coordinate system")
bgr_coordinate_system = bgra_image[:, :, 0:3].copy()
_draw_coordinate_system(frame, camera_to_marker_transform, bgr_coordinate_system)
display_bgr(bgr_coordinate_system, "ArUco marker transformation frame")

For the full example, see 基于ArUco标记的坐标转换.

ArUco 标记需要多大?

我们建议在最远的成像距离处,每个 ArUco 位上至少有 7 个像素。下图显示了 ArUco 标记的放大图像,其中每个 ArUco 位由 8 个像素表示。以下示例解释了如何确定所需的最小尺寸(以毫米为单位)。

../../../../_images/aruco_bit_8_pixels.png

对于 4x4 ArUco 字典,有 6 位(4 个内部位和 2 个外部位),因此每个标记的边至少应有 42 个像素。

假设您使用的是 Zivid 2+ M130 相机,最大成像距离为 2 米。此时相机的空间分辨率为 0.5 毫米(请参阅 计算FOV和成像距离 )。将 0.5 毫米乘以 42 像素可得出 21 毫米。

因此,要在最远 2 米的距离内使用 Zivid 2+ M130,ArUco 标记的尺寸至少应为 21 毫米。

备注

您应该在 ArUco 标记周围留出一些空白,至少留出 1 位边框。对于上例,这意味着每边留出 3.5 毫米(7 个像素乘以 0.5 毫米)。

应该使用哪种标定对象?

我们建议尽可能使用 Zivid 标定板。请根据您使用的相机型号选择标定板型号,如下表所示:

相机型号

推荐的标定板

Zivid 2 M70

7x8 - 30 mm

Zivid 2 L100

7x8 - 30 mm

Zivid 2+ MR130

7x8 - 30 mm

Zivid 2+ LR110

7x8 - 30 mm

Zivid 2+ MR60

5x6 - 20 mm

Zivid 3 XL250

7x8 - 30 mm

ArUco 标记适用于以下使用场景:

  • 眼在手外(Eye-to-hand)的配置

  • 标定对象需要永久安装在机器人上

  • Zivid 标定板尺寸过大

../../../../_images/aruco-collar-bracket.png

现在您已经选择了标定对象,请查看 如何运行和集成 Zivid 手眼标定

版本历史

SDK

变更

2.16.0

增加了对较小尺寸的标定板 ZVDA-CB02 (5x6 20 mm) 的支持。

2.14.0

取消了对 9x6 灰白棋盘格的支持。

2.13.0

增加了对 ArUco 标记的支持。