HALCON标定之hand_eye_stationarycam_calibration.hdev

该示例详细说明了在相机静止而标定物体随机械手臂移动的情况下进行手眼标定的过程。目标是确定相机坐标系中机械手基座的位姿和工具坐标系中标定物体的位姿。为了获得高精度,建议使用至少10个不同角度的图像。标定物体的位姿通过静态相机捕获,然后利用这些信息进行手眼标定,计算出的变换矩阵用于计算物体在相机坐标系中的位姿。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

*这个示例演示如何进行相机机械手相对固定场合的手眼标定,标定物体附着在机械手臂上

  • This example explains how to use the hand eye calibration for the case where
  • the camera is stationary with respect to the robot and the calibration
  • object is attached to the robot arm.

*在这个案例中,手眼标定的目标是:确定两个未知的位姿
*1.机械手基座在相机坐标系的位姿BaseInCamPose
*2.标定物体在工具坐标系的位姿CalObjInToolPose)

  • In this case, the goal of the hand eye calibration
  • is to determine two unknown poses:
    • the pose of the robot base in the coordinate system
  • of the camera (BaseInCamPose).
    • the pose of the calibration object in the coordinate system of the
  • tool (CalObjInToolPose)

*理论上来说,至少需要三个标定物体在相机坐标系的位姿和对应的机械手工具在机械手坐标系的位姿
*但是,为了更高精度,推荐是至少10个位姿

  • Theoretically, as input the method needs at least 3 poses of the
  • calibration object in the camera coordinate system and the corresponding
  • poses of the robot tool in the coordinate system of the
  • robot base. However it is recommended
  • to use at least 10 Poses.
    *标定物体的位姿从静态相机拍摄的图片中得来
  • The poses of the calibration object are obtained from images of the
  • calibration object recorded with the stationary camera.
    *标定物体由机械手带动。
  • The calibration object is moved by the robot with respect to the camera.
    *为了获得高精度标定结果,推荐相对于相机定位标定物体,获取一些标定物体是倾斜的图片
  • To obtain good calibration results, it its essential to position
  • the calibration object with respect to the camera so that the object appears
  • tilted in the image.
    *手眼标定后,计算好的矩阵变换提取出来,用来计算标定物体在相机坐标系的位姿
  • After the hand eye calibration, the computed transformations are
  • extracted and used to compute the pose of the calibration object in the
  • camera coordinate system.
    dev_update_off ()
  • Directories with calibration images and data files
    ImageNameStart := ‘3d_machine_vision/hand_eye/stationarycam_calib3cm_’
    DataNameStart := ‘hand_eye/stationarycam_’
    NumImages := 17
  • Read image
    *读取图像
    read_i
### Halcon 手眼标定教程与实现 #### 定义手眼标定问题 在工业自动化领域,手眼标定是指通过校准相机和机器人的相对位置关系来解决视觉引导机器人操作的问题。对于Eye-to-Hand配置而言,意味着摄像机安装在一个固定的位置而目标物体由机械臂移动到视野内完成拍摄[^1]。 #### 准备工作 为了执行此过程,在Halcon环境中需准备如下组件: - 一台带有已知参数的摄像头; - 可控制运动路径并记录位姿数据的机器人系统; - 能够被识别特征点的标准棋盘格或其他形式的目标物; #### 实现步骤概述 利用`calibrate_cameras_and_robots`算子可以简化整个流程。该函数接收来自不同视角下的图像以及对应的机器人姿态作为输入,并计算出最终的手眼变换矩阵T_CamToRobotBase。具体来说: ```cpp // 假设已经获取了多组匹配好的图像坐标系下标记点位置world_points[] 和对应时刻机器人TCP端法兰面相对于基座的姿态robot_poses[] // 进行手眼标定求解转换关系 T_CamToRobotBase hom_mat3d_identity (CamToRobotBase); calibrate_cameras_and_robots (NumPoses, RowsWorld, ColsWorld, RobotPosesRow, RobotPosesCol, CameraParam, 'eye_to_hand', CamToRobotBase) ``` 上述代码片段展示了如何调用Halcon内置工具来进行手眼标定的核心部分。 #### 结果验证 一旦获得了手眼变换矩阵,则可以通过让机器人携带测试对象到达新地点并通过视觉确认其实际位置是否符合预期的方式检验准确性。如果存在偏差,则可能需要重新调整或增加更多的训练样本以提高精度。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值