当前位置: 首页 > article >正文

halcon三维点云数据处理(十五)xyz_attrib_to_object_model_3d

目录

  • 一、xyz_attrib_to_object_model_3d函数
  • 二、xyz_attrib_to_object_model_3d例程代码

一、xyz_attrib_to_object_model_3d函数

将三维点从图像转换为三维对象模型,并为对象模型中的点云添加扩展属性。

xyz_attrib_to_object_model_3d(X, Y, Z, AttribImage : : AttribName : ObjectModel3D)

二、xyz_attrib_to_object_model_3d例程代码

//读深度图
dev_update_off ()
dev_close_window ()

read_image (Z, 'mreut_dgm_2.0.tif')
get_image_size (Z, Width, Height)
//读灰度图
read_image (AerialImage, 'mreut4_3.png')

auto_threshold (AerialImage, Regions, 4)
region_to_label (Regions, LabelImage, 'byte', Width, Height)
compose2 (AerialImage, LabelImage, MultiChannelAttribImage)
//创建X  Y  图像
GroundResolution := 2.0
gen_image_surface_first_order (X, 'real', 0, GroundResolution, 0, 0, 0, Width, Height)
gen_image_surface_first_order (Y, 'real', -GroundResolution, 0, 0, 0, 0, Width, Height)

AttribName := ['&gray', '&terrain']
xyz_attrib_to_object_model_3d (X, Y, Z, MultiChannelAttribImage, AttribName, ObjectModel3D)

dev_open_window (Height / 2, 0, Width / 2, Height / 2, 'black', WindowHandle1)
dev_set_part (0, 0, Height - 1, Width - 1)
set_display_font (WindowHandle1, 16, 'mono', 'true', 'false')
dev_set_color (['red', 'green', 'blue'])
dev_set_draw ('fill')
dev_display (Regions)
disp_message (WindowHandle1, 'Terrain types', 'window', 12, 12, 'black', 'true')
* 
dev_open_window (0, 0, Width / 2, Height / 2, 'black', WindowHandle2)
set_display_font (WindowHandle2, 16, 'mono', 'true', 'false')
dev_display (AerialImage)
disp_message (WindowHandle2, 'Aerial image', 'window', 12, 12, 'black', 'true')
* 
dev_open_window (0, Width / 2 + 8, Width, Height, 'gray', WindowHandle3)
set_display_font (WindowHandle3, 16, 'mono', 'true', 'false')
dev_display (Z)
* 
disp_message (WindowHandle3, 'Digital surface model', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowHandle3, 'black', 'true')
stop ()
* 
* Perform fast triangulation of the object model for better visualization.
prepare_object_model_3d (ObjectModel3D, 'segmentation', 'true', [], [])
* Visualize 3d object model interactively
create_pose (-620, -85, 17000, 135, 2, 10, 'Rp+T', 'gba', 'point', Pose)
Instructions := 'Rotate: Left button'
Instructions[1] := 'Zoom: Shift + left button'
Instructions[2] := 'Move: Ctrl + left button'
visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], Pose, ['color_attrib', 'color_attrib_start', 'color_attrib_end'], ['&gray', 0, 255], ['Created 3D model', 'Attribute used for visualization: \'&gray\''], [], Instructions, PoseOut)
visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], PoseOut, ['color_attrib', 'lut'], ['&terrain', 'color1'], ['Created 3D model', 'Attribute used for visualization: \'&terrain\''], [], Instructions, PoseOut)
disp_end_of_program_message (WindowHandle3, 'black', 'true')

AttribName := [‘&gray’, ‘&terrain’]
xyz_attrib_to_object_model_3d (X, Y, Z, MultiChannelAttribImage, AttribName, ObjectModel3D)
这里’&gray’对应灰度图像,‘&terrain’对应label图像
‘color_attrib’这里可以设置为’&gray’或者’&terrain’
visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], Pose, [‘color_attrib’, ‘color_attrib_start’, ‘color_attrib_end’], [‘&gray’, 0, 255], [‘Created 3D model’, ‘Attribute used for visualization: ‘&gray’’], [], Instructions, PoseOut)
visualize_object_model_3d (WindowHandle3, ObjectModel3D, [], PoseOut, [‘color_attrib’, ‘lut’], [‘&terrain’, ‘color1’], [‘Created 3D model’, ‘Attribute used for visualization: ‘&terrain’’], [], Instructions, PoseOut)


http://www.kler.cn/a/541799.html

相关文章:

  • JAVA学习第一天
  • 【Windows】PowerShell 缓存区大小调节
  • 【STM32】ADC
  • git如何把多个commit合成一个
  • iOS AES/CBC/CTR加解密以及AES-CMAC
  • vscode卡住---回退版本解决
  • 图片下载不下来?即便点了另存为也无法下载?两种方法教你百分之百下载下来
  • Failed to build mysqlclient
  • 帝国CMS8.0版多访问端支持可选不绑定二级域名
  • 二、Golang Channel通信和控制题目
  • 数据分析对企业有什么价值
  • STM32 Unix时间戳
  • 从BERT到ChatGPT:大模型训练中的存储系统挑战与技术发展——论文泛读
  • NCRE全国计算机等级考试二级Python-50道基础编程题【带解析】
  • docker.service job docker.service/start failed with result ‘dependency‘
  • 最新版Chrome浏览器集成ActiveX控件之金山WpsDocFrame控件
  • 错误报告:非正常关机引发OTA升级失败:缓存丢失问题的排查与解决
  • uniapp 使用 npm + easycom 安装 uni-ui遇到的问题
  • 怎麼使用靜態住宅IP進行多社媒帳號管理
  • IDEA右侧看不到Maven窗口
  • 自主智能体:感知;认知与决策;行动;
  • react native学习【9】——动态路由
  • 40环状DNA序列的最小表示法Java版-青训营刷题
  • 计算机毕业设计——Springboot的简历系统
  • 基于JavaWeb的在线美食分享平台(源码+lw+部署文档+讲解),源码可白嫖!
  • Postgresql 开发环境搭建指南(WindowsLinux)