设置首页收藏本站
开启左侧

Halcon读取海康机器人生成的ply点云数据文件

[复制链接]
Criss 发表于 2018-10-30 10:52:02 | 显示全部楼层 |阅读模式
格式解析:
  1. ply
  2. format ascii 1.0           { ascii/binary, format version number }
  3. comment made by Greg Turk  { comments keyword specified, like all lines }
  4. comment this file is a cube
  5. element vertex 8           { define "vertex" element, 8 of them in file }
  6. property float x           { vertex contains float "x" coordinate }
  7. property float y           { y coordinate is also a vertex property }
  8. property float z           { z coordinate, too }
  9. element face 6             { there are 6 "face" elements in the file }
  10. property list uchar int vertex_index { "vertex_indices" is a list of ints }
  11. end_header                 { delimits the end of the header }
  12. 0 0 0                      { start of vertex list }
  13. 0 0 1
  14. 0 1 1
  15. 0 1 0
  16. 1 0 0
  17. 1 0 1
  18. 1 1 1
  19. 1 1 0
  20. 4 0 1 2 3                  { start of face list }
  21. 4 7 6 5 4
  22. 4 0 4 5 1
  23. 4 1 5 6 2
  24. 4 2 6 7 3
  25. 4 3 7 4 0
复制代码
直接上代码:
  1. read_object_model_3d ('C:/Users/Criss/Desktop/1-42 NO1.ply', 'mm', [], [], ObjectModel3D, Status)
  2. *获取顶点数目
  3. get_object_model_3d_params (ObjectModel3D, 'num_points', NumPoints)

  4. *获取每个坐标系数据
  5. get_object_model_3d_params (ObjectModel3D, 'point_coord_x', CoordX)
  6. get_object_model_3d_params (ObjectModel3D, 'point_coord_y', CoordY)
  7. get_object_model_3d_params (ObjectModel3D, 'point_coord_z', CoordZ)
  8. write_tuple (CoordX, 'CoordX.tup')
  9. write_tuple (CoordY, 'CoordY.tup')
  10. write_tuple (CoordZ, 'CoordZ.tup')

  11. *模拟图像显示交互
  12. visualize_object_model_3d (3600, ObjectModel3D, [], [], [], [], [], [], [], PoseOut)
复制代码
文件下载:
链接:https://pan.baidu.com/s/1n8gJSpXE3DAP9PhkYphu2A
提取码:8jvj
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
liuhongliang 发表于 2023-4-8 17:30:27 | 显示全部楼层
感谢大佬分享
奖励计划已经开启,本站鼓励作者发布最擅长的技术内容和资源,流量变现就在现在,[点我]加入吧~~~Go
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表