首页 > 其他分享 >halcon 标定

halcon 标定

时间:2023-12-28 15:22:42浏览次数:26  
标签:division area scan 标定 halcon 相机 Cx telecentric

1.标定板类型

    a.Calibration plate with hexagonally arranged marks  带有六边形排列标记的校准板

 

 

    b.Calibration plate with rectangularly arranged marks   带有矩形排列标记的校准板

 2.标定过程

 a.准备校准输入数据

  1.create_calib_data   创建校准数据模型,指定设置中的相机数量和使用的校准对象数量

    Create a calibration data model with the operator create_calib_data, specifying the number of cameras in the setup and the number of used calibration objects.

  2.set_calib_data_cam_param   指定相机类型和初始内部相机参数

    Specify the camera type and the initial internal camera parameters with the operator set_calib_data_cam_param.

  3.set_calib_data_calib_object     指定所有校准对象的描述

    Specify the description of all calibration objects with the operator set_calib_data_calib_object.

  4.  采集观测数据,即获得提取的标定对象标定标记的图像坐标和标定对象相对于观测相机的粗略估计位置find_calib_object/set_calib_data_observ_points

    Collect observation data with the operators find_calib_object or set_calib_data_observ_points, i.e., obtain the image coordinates of the extracted calibration marks of the calibration object and a roughly estimated pose of the calibration object relative to the  observing camera.

  5.配置标定过程 set_calib_data

    Configure the calibration process, e.g., exclude certain camera parameters from the optimization. You can specify these parameters with the operator set_calib_data. For example, if the image sensor cell size of camera 0 is known precisely and only the rest of the parameters needs to be calibrated, you call

  set_calib_data (CalibDataID, 'camera', 0, 'excluded_settings', ['sx','sy']).

b.执行实际的相机校准并获得其结果  get_calib_data

c.查询校准结果        get_calib_data

d.检查校准是否成功   RMS值单位为像素

 

3.关于相机参数,您可以区分内部和外部相机参数

A.相机外部参数

  The following 6 parameters describe the 3D pose, i.e., the position and orientation of the world coordinate system relative to the camera coordinate system. The x- and y-axis of the camera coordinate system are parallel to the column and row axes of the image, while the z-axis is perpendicular to the image plane. For line scan cameras, the pose of the world coordinate system refers to the camera coordinate system of the first image line.以下 6 个参数描述了 3D 姿态,即世界坐标系相对于相机坐标系的位置和方向。相机坐标系的 x 轴和 y 轴平行于图像的列轴和行轴,而 z 轴垂直于图像平面。对于线扫描相机,世界坐标系的姿态是指第一条图像线的相机坐标系。

TransX:
Translation along the x-axis of the camera coordinate system. 沿相机坐标系的 X 轴平移

TransY:
Translation along the y-axis of the camera coordinate system.  沿相机坐标系的 Y 轴平移

TransZ:
Translation along the z-axis of the camera coordinate system.沿相机坐标系的 Z 轴平移

RotX:
Rotation around the x-axis of the camera coordinate system. 绕相机坐标系的 X 轴旋转

RotY:
Rotation around the y-axis of the camera coordinate system.绕相机坐标系的 Y 轴旋转

RotZ:
Rotation around the z-axis of the camera coordinate system.绕相机坐标系的 Z 轴旋转

 

B.相机内部参数

a.常规镜头的面阵相机

Projective area scan cameras with regular lenses 带有常规镜头的投射面阵扫描相机

  'area_scan_division'
  ['area_scan_division', Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_polynomial'
  ['area_scan_polynomial', Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Telecentric area scan cameras with regular lenses  配备常规镜头的远心面阵扫描相机

  'area_scan_telecentric_division'
  ['area_scan_telecentric_division', Magnification, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_telecentric_polynomial'
  ['area_scan_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

b.带倾斜镜头的面阵相机

Projective area scan cameras with tilt lenses 带倾斜镜头的投射面阵扫描相机

  'area_scan_tilt_division'
  ['area_scan_tilt_division', Focus, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_polynomial'
  ['area_scan_tilt_polynomial', Focus, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_image_side_telecentric_division'
  ['area_scan_tilt_image_side_telecentric_division', Focus, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_image_side_telecentric_polynomial'
  ['area_scan_tilt_image_side_telecentric_polynomial', Focus, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

Telecentric area scan cameras with tilt lenses带倾斜镜头的远心面阵扫描相机

  'area_scan_tilt_bilateral_telecentric_division'
  ['area_scan_tilt_bilateral_telecentric_division', Magnification, Kappa, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_bilateral_telecentric_polynomial'
  ['area_scan_tilt_bilateral_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, Tilt, Rot, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_object_side_telecentric_division'
  ['area_scan_tilt_object_side_telecentric_division', Magnification, Kappa, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_tilt_object_side_telecentric_polynomial'
  ['area_scan_tilt_object_side_telecentric_polynomial', Magnification, K1, K2, K3, P1, P2, ImagePlaneDist, Tilt, Rot, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

c.Area scan cameras with hypercentric lenseshypercentric lens(超中心镜头其实就是个大视场角100度左右的鱼眼镜头,设计是按照大景深鱼眼镜头设计,一般用在测柱状体或孔的顶面和侧面用的)

Projective area scan cameras with hypercentric lenses

  'area_scan_hypercentric_division'
  ['area_scan_hypercentric_division', Focus, Kappa, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

  'area_scan_hypercentric_polynomial'
  ['area_scan_hypercentric_polynomial', Focus, K1, K2, K3, P1, P2, Sx, Sy*, Cx, Cy, ImageWidth, ImageHeight]

d.线扫相机

Projective line scan cameras with regular lenses 常规镜头

  'line_scan_division'
  ['line_scan_division', Focus, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]

  'line_scan_polynomial'
  ['line_scan_polynomial', Focus, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz]

Telecentric line scan cameras with regular lenses 远心镜头

  'line_scan_telecentric_division'
  ['line_scan_telecentric_division', Magnification, Kappa, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]

  'line_scan_telecentric_polynomial'
  ['line_scan_telecentric_polynomail', Magnification, K1, K2, K3, P1, P2, Sx*, Sy*, Cx, Cy, ImageWidth, ImageHeight, Vx, Vy, Vz*]

内部参数:

Focus/焦距

Magnification/放大倍率

Kappa/畸变系数

 

 

C.相机参数单位

 

标签:division,area,scan,标定,halcon,相机,Cx,telecentric
From: https://www.cnblogs.com/echo-efun/p/17932593.html

相关文章

  • Halcon 相机外部参数标定例程一(camera_calibration_external.hdev)
    1.create_calib_data—CreateaHALCONcalibrationdatamodel  创建一个HALCON校准数据模型2.read_cam_par—Readinternalcameraparametersfromafile  从文件中读取相机内部参数  3.set_calib_data_cam_param—Settypeandinitialparametersofa......
  • Halcon threshold_sub_pix (Operator)
    read_image(Image,'fabrik')threshold_sub_pix(Image,Border,35)dev_display(Border)Image是输入的原始图像,Threshold是设定的阈值,Width和Height是像素值计算区域的大小,ThresholdedRegion是经过分割后得到的二值化结果。在对图像进行二值化处理时,threshold_sub_pix函数会对每个像......
  • WPF Halcon机器视觉和运动控制软件通用框架,插件式开发,开箱即用 仅供学习!
    点我下载,仅供个人学习使用参考easyvision开发,集成几十个软件算子此版本以添加ui设计器。具体功能如上所示,可以自定义变量,写c#脚本,自定义流程,包含了halcon脚本和封装的算子,可自定义ui,通过插件形式开发很方便拓展自己的功能。......
  • Halcon reduce_domain和scale_image的作用
    在Halcon中,reduce_domain是用于缩小图像域(ImageDomain)的操作。它的作用是通过指定一个感兴趣区域(ROI,RegionofInterest),将图像数据限制在该区域内,从而实现对图像进行裁剪或者缩小处理。reduce_domain的语法如下:reduce_domain(Image,Region,ReducedImage)其中,Image是输入的原始图......
  • Halcon 机械视觉 使用仿射变换 机械手实现孔位定位
    要推算机械手平面坐标系A与相机平面坐标系B的关系,我们可以首先找到两个平面坐标系之间的平移量和旋转量。平移量:选择一个公共的参考点,比如某个标志物,假设在坐标系A中的坐标为(Ax,Ay),在坐标系B中的坐标为(Bx,By)。那么平移量可以表示为:Δx=Bx-AxΔy=By-Ay这里的(Δx,Δy)......
  • Halcon 螺丝孔位定位
    标定坐标:对整个9点标定版进行拍摄时的世界坐标HomMat2D1:标定后得到的换算关系孔位世界坐标:相机移动到孔位上的世界坐标圆心世界坐标:模版匹配后得到的螺丝孔位中心相对偏移:孔位世界坐标-标定坐标目标坐标:圆心世界坐标+相对偏移要输出的偏移量:工具末端世界坐标-目标坐标标定坐标......
  • Halcon (基于镜头中心)协同机械手进行自动标定
    流程使用相机捕捉初始标定点位,记录世界坐标在机器人示教器上基于基准点位进行其余8个点位设置,每次x轴偏移+4或Y轴偏移+4对每个点位进行图像获取编写Halcon脚本,获取9幅图像中点位中心的像素坐标,以及对应算出的机械手世界坐标,导入标定demo获取换算关系。在图像中模拟位置进行验证,此......
  • Halcon 5分钟学会9点标定 带图片示例、示例源码
    9点标定应用流程如果没有9个点,其实只需要一个点就可以,移动机械手,只需将这个点在视野内不同坐标即可,前置条件,相机焦距,视野固定高度和角度,光源光强度固定。移动机械手,使用螺丝批头,在视野范围内的白纸上,点九个点,记录每个点位的位置,每个点位的顺序要和图像上获取的圆心数组顺序一致,此时......
  • halcon-轮廓拟合圆fit_circle_contour_xld
    fit_circle_contour_xld(xld,'algebraic',-1,0,0,3,2,Row,Column,Radius,StartPhi,EndPhi,PointOrder)*对XLD轮廓做近似圆计算--拟合圆--获得圆数据*参数1:输入xld轮廓*参数2:圆的拟合算法*'ahuber'对轮廓点进行加权,以减少异常值的影响*'......
  • [Halcon&拟合] 直线、矩形和圆的边缘提取
    作者:丶布布一、测量矩形拟合提取直线边缘1、封装的函数介绍:将整个算法进行封装,得到函数MS_LineDetecter。MS_LineDetecter(ImageIn:outDetectRectangle:iLineRow1,iLineCol1,iLineRow2,iLineCol2,iRectWidth,iRectHeight,iSigma,iThreshold:oLineRow1,oLineCol......