halcon标定之two_camera_calibration.hdev

本文档通过two_camera_calibration.hdev实例详细介绍了如何使用Halcon进行高精度的双摄像头标定和拼接,涉及相机标定、图像读取、窗口管理以及拼接过程中的坐标转换等步骤。

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

*本例程展示了标定相机的高精度拼接

  • This example program shows how high precision mosaicking

  • can be performed with calibrated cameras.

  • 更多信息可以在解决方案Guide III-C 3D Vision第9和10张找到

  • Further information can be found in the

  • Solution Guide III-C 3D Vision, Chapters 9 and 10.
    *这个示例在再第9张中,用来展示标定拼接

  • This example program is used in chapter 9 to

  • illustrate calibrated mosaicking.

  • 关闭更新
    dev_update_off ()
    ImgPath := ‘3d_machine_vision/multiple_cameras/’

  • 开启两窗体

  • Open two windows for the left and the right image.
    *先关闭所有窗体
    dev_close_window ()
    *读取图像
    read_image (Image1, ImgPath + ‘camera1_ref’)
    *获取图像尺寸
    get_image_size (Image1, Width, Height)
    *定义窗体缩放尺寸
    WindowScale := 0.66
    *打开两个窗体
    dev_open_window (0, 0, Width * WindowScale, Height * WindowScale, ‘black’, WindowHandle1)
    dev_open_window (0, Width * WindowScale + 6, Width * WindowScale, Height * WindowScale, ‘black’, WindowHandle2)

  • 设置一些窗体参数

  • Set some parameters for both windows.
    *设置窗体1的一些参数,颜色,填充方式,线宽
    dev_set_window (WindowHandle1)
    dev_set_color (‘green’)
    dev_set_draw (‘margin’)
    dev_set_line_width (2)
    dev_set_part (0, 0, Height - 1, Width - 1)
    set_display_font (WindowHandle1, 16, ‘mono’, ‘true’, ‘false’)

  • 设置窗体2的一些参数,颜色,填充方式,线宽
    dev_set_window (WindowHandle2)
    dev_set_color (‘green’)
    dev_set_draw (‘margin’)
    dev_set_line_width (2)
    dev_set_part (0, 0, Height - 1, Width - 1)
    set_display_font (WindowHandle2, 16, ‘mono’, ‘true’, ‘false’)

  • 我们假设两个相机都已经标定好

  • We assume that the two cameras are already calibrated

  • (we know the internal camera parameters).
    *生成两个相机初始参数
    gen_cam_par_area_scan_division (0.01619, -734.789, 7.402e-006, 7.4e-006, 324.911, 256.894, 640, 480, CamParam1)
    gen_cam_par_area_scan_division (0.0162584, -763.35, 7.39842e-006, 7.4e-006, 324.176, 245.371, 640, 480, CamParam2)

  • 读取并显示图像

  • Read the images and display them.
    read_image (Image1, ImgPath + ‘camera1_ref’)
    read_image (Image2, ImgPath + ‘camera2_ref’)
    *分别在连个窗体中显示图像
    dev_set_window (WindowHandle1)
    dev_display (Image1)
    dev_set_window (WindowHandle2)
    dev_display (Image2)

  • 准备相机标定

  • Pre

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值