Halcon学习笔记:select_points_object_model_3d(3D对象模型阀值分割)

Halcon学习笔记:select_points_object_model_3d 3D对象模型阀值分割

  • This example program shows how to use the operators

  • connection_object_model_3d and select_object_model_3d

  • in HALCON. First, a threshold is applied to the 3D object

  • model. Then, the connected components are calculated

  • based on the geometric distance. Finally, the connected

  • components are selected by their volume and diameter and

  • the result is displayed.

  • 这个示例程序展示了如何在HALCON中使用connection_object_model_3d和select_object_model_3d操作符。

  • 首先,对3D对象模型应用一个阈值。然后,根据几何距离计算连通分量。

  • 最后,根据连接部件的体积和直径选择连接部件并显示结果。


源码:

dev_update_off ()
dev_close_window ()
* 1、加载X,Y, z数据,缩放到米,并生成一个3D对象模型
ImagePath := 'time_of_flight/'
read_image (Image, ImagePath + 'engine_cover_xyz_01')
* 缩放图像的灰度值
* 将图像放大一个给定的倍数
scale_image (Image, Image, .001, .0)
zoom_image_factor (Image, Image, 2, 2, 'constant')
decompose3 (Image, X, Y, Z)
xyz_to_object_model_3d (X, Y, Z, ObjectModel3DID)
* 2、计算模型的网格(Delaunay三角测量)
*'segmentation',准备一个3D对象模型(如果要对同一操作多次使用3D对象模型,这样做会更快)
prepare_object_model_3d (ObjectModel3DID, 'segmentation', 'true', [], [])
* 
* 3、准备可视化并显示3D对象模型
create_pose (0.058, -0.165, 0.660, 345.0, 355.0, 356.0, 'Rp+T', 'gba', 'point', Pose)
* 
* Instructions for visualize_object_model_3d
Instructions[0] := 'Rotate: Left button'
Instructions[1] := 'Zoom:   Shift + left button'
Instructions[2] := 'Move:   Ctrl  + left button'
* Configuration
gen_cam_par_area_scan_division (0.01, 0, 7e-6, 7e-6, 352, 288, 710, 576, CamParam)
GenParamName := ['color','disp_pose','alpha']
GenParamValue :
  • 4
    点赞
  • 43
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值