热点推荐

查看: 63|回复: 0
收起左侧

[资料] Halcon读取.ply格式文件并且显示3D模型

[复制链接]
  • TA的每日心情
    点赞
    昨天 17:28
  • 签到天数: 37 天

    连续签到: 1 天

    [LV.5]常住居民I

    13

    主题

    47

    帖子

    531

    积分

    Rank: 3

    积分
    531
    发表于 6 天前 | 显示全部楼层 |阅读模式

    51Halcon诚邀您的加入,专注于机器视觉开发与应用技术,我们一直都在努力!

    您需要 登录 才可以下载或查看,没有帐号?会员注册

    x
    本帖最后由 Princess 于 2019-6-13 11:40 编辑

    利用算子read_object_model_3d来实现,支持以下格式:
    1. 'om3':
    2. HALCON format for 3D object model. Files with this format can be written by write_object_model_3d. The default file extension for this format is 'om3'.

    3. 'dxf':
    4. AUTOCAD format. See below for details about reading this file format. The default file extension for this format is 'dxf'.

    5. 'off':
    6. Object File Format. This is a simple ASCII-based format that can hold 3D points and polygons. The binary OFF format is not supported. The default file extension for this format is 'off'.

    7. 'ply':
    8. Polygon File Format (also Stanford Triangle Format). This is a simple format that can hold 3D points, point normals, and polygons. HALCON supports both the ASCII and the binary version of the format. The default file extension for this format is 'ply'.

    9. 'obj':
    10. OBJ file format, also 'Wavefront OBJ-Format'. This is an ASCII-based format that can hold 3D points, polygons, normals, texture coordinates, materials and other information. HALCON supports points ('v'-lines) and polygonal faces ('f'-lines). Other entities are ignored. The default file extension for this format is 'obj'.

    11. 'stl',
    12. 'stl_binary',
    13. 'stl_ascii':
    14. STL file format, also 'Stereolithography format', 'SurfaceTesselationLanguage ', 'StandardTriangulationLanguage', and 'StandardTesselationLanguage'. This format stores triangles and triangle normals. However, as triangle normals are not supported by HALCON 3D object models, only triangles are read while the triangle normals are ignored. Normals are recomputed from the triangles if required. HALCON reads both the ASCII and the binary version of this format. If 'stl' is set, HALCON will autodetect the type. Setting the type to 'stl_binary' or 'stl_ascii' will enforce the corresponding format. The default file extension for this format is 'stl'.
    复制代码

    Scale参数定义如下:
    1. Unit         Scaling factor
    2. m         1
    3. dm         0.1
    4. cm         0.01
    5. mm         0.001
    6. µm, microns         1e-6
    7. nm         1e-9
    8. km         1000
    9. in         0.0254
    10. ft         0.3048
    11. yd         0.9144
    复制代码

    具体代码如下:
    1. dev_close_window ()
    2. dev_open_window (0, 0, 400, 500, 'black', WindowHandle)
    3. *读取单帧点云ply文件
    4. read_object_model_3d('D:/3DMVS/Data/Image_20190613112209544.ply', 'mm', 'convert_to_triangles', 'true', ObjectModel3D, Status)

    5. Instructions[0] := 'Rotate: Left button'
    6. Instructions[1] := 'Zoom:   Shift + left button'
    7. Instructions[2] := 'Move:   Ctrl  + left button'

    8. Message := 'Hik3D PointCloud'
    9. *虚拟化模型并且显示
    10. visualize_object_model_3d (WindowHandle, ObjectModel3D, [], [], [], [], Message, [], Instructions, PoseOut)
    11. dev_clear_window ()
    复制代码

    效果图象:
    QQ截图20190613113439.png

    ply文件下载:
    Image_20190613112209544.rar (4.35 KB, 下载次数: 0)

    发帖求助前要善用论坛搜索功能,那里可能会有你要找的答案;

    如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子分类或者标题前面加上【已解决】

    回报帮助你解决问题的坛友,右下角【免费评分】赠与对方视觉币和热心值,伸手党遭人唾弃,做一个热心并受欢迎的人!

    您需要登录后才可以回帖 会员登录 | 会员注册

    本版积分规则

    经营性网站备案信息 经营性网站
    备案信息

    中国互联网举报中心 中国互联网
    举报中心

    中国文明网传播文明 中国文明网
    传播文明

    诚信网站

    深圳市市场监督管理局企业主体身份公示 工商网监
    电子标识