*本例程展示了标定相机的高精度拼接
-
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