工控编程吧

标题: halcon图形3维场景函数详细介绍 [打印本页]

作者: qq263946146    时间: 2019-11-6 12:34
标题: halcon图形3维场景函数详细介绍
Halcon中可以将三维物体加上灯光效果,以不同的位姿进行效果显示。
我们这里也对些函数进行运行,查看效果。一般初学halcon对此有个了解就够,
掌握常用视觉处理方法再深入学习3D部分。
下面是这此函数的罗列
create_scene_3d  add_scene_3d_camera
set_scene_3d_camera_pose  add_scene_3d_light  add_scene_3d_instance
add_scene_3d_label   display_scene_3d   set_scene_3d_light_para   set_scene_3d_instance_para
set_scene_3d_label_param   set_scene_3d_instance_pose
set_scene_3d_param
render_scene_3d
set_scene_3d_to_world_pose
get_display_scene_3d_info
remove_scene_3d_camera
remove_scene_3d_instance
remove_scene_3d_label
remove_scene_3d_light
clear_scene_3d

实例运行演示
dev_close_window ()
dev_open_window (0, 0, 1280, 1024, 'black', WindowHandle)
read_image (Image, 'printer_chip/printer_chip_01')
dev_display (Image)
create_scene_3d (Scene3D)
gen_cam_par_area_scan_division (0.008, 0, 5.2e-006, 5.2e-006, 640, 512, 1280, 1024, CameraParam)
add_scene_3d_camera (Scene3D,CameraParam, CameraIndex)
set_scene_3d_camera_pose (Scene3D, CameraIndex, [0,0,-0.4,0,0,0,0])
set_scene_3d_param (Scene3D, 'disp_background', 'true')
set_scene_3d_param (Scene3D, 'object_index_persistence', 'true')
add_scene_3d_light (Scene3D, [1.0,1.0,1.0], 'point_light', LightIndex)
set_scene_3d_light_param (Scene3D, LightIndex, 'diffuse', [0.8,0.8,0.8])
read_object_model_3d ('pipe_joint', 'm', [], [], ObjectModel3D, Status)
create_pose (0.001, 0.001, 0.01, 90, 90, 90, 'Rp+T', 'gba', 'point', Pose)
*create_pose (-0.037, 0.026, 0.02, 137, 52, 326, 'Rp+T', 'gba', 'point', Pose)
add_scene_3d_instance (Scene3D, ObjectModel3D, Pose, InstanceIndex)
set_scene_3d_instance_param (Scene3D, InstanceIndex, 'color','red')
create_pose (0.009, -0.011, 0.0, 354, 317, 252, 'Rp+T', 'gba', 'point', Pose2)
set_scene_3d_instance_pose (Scene3D, InstanceIndex, Pose2)
add_scene_3d_label (Scene3D, 'i am label', Pose[0:2], 'top', 'point', LabelIndex)
set_scene_3d_label_param (Scene3D, LabelIndex,  'text', 'gkbc8.com')
set_scene_3d_to_world_pose (Scene3D, [0,0,0,90,0,0,0])
display_scene_3d (WindowHandle, Scene3D, CameraIndex)
display_scene_3d (WindowHandle, Scene3D, CameraIndex)
render_scene_3d (Image1, Scene3D, CameraIndex)
dev_display (Image1)
get_display_scene_3d_info (WindowHandle, Scene3D, 472, 633, 'object_index', Value)
stop()
remove_scene_3d_camera (Scene3D, CameraIndex)
remove_scene_3d_instance (Scene3D, InstanceIndex)
remove_scene_3d_label (Scene3D, LabelIndex)
remove_scene_3d_light (Scene3D, LightIndex)
clear_scene_3d (Scene3D)
上边为视频教程部分内容。
可以下载下面的教程入门学习。

[halcon]1[/halcon]
[MFC408]1[/MFC408]
[weixinlianxi]1[/weixinlianxi]







欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4