利用算子read_object_model_3d来实现,支持以下格式:
- 'om3':
- 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'.
- 'dxf':
- AUTOCAD format. See below for details about reading this file format. The default file extension for this format is 'dxf'.
- 'off':
- 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'.
- 'ply':
- 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'.
- 'obj':
- 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'.
- 'stl',
- 'stl_binary',
- 'stl_ascii':
- 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参数定义如下:
- Unit Scaling factor
- m 1
- dm 0.1
- cm 0.01
- mm 0.001
- µm, microns 1e-6
- nm 1e-9
- km 1000
- in 0.0254
- ft 0.3048
- yd 0.9144
复制代码
具体代码如下:
- dev_close_window ()
- dev_open_window (0, 0, 400, 500, 'black', WindowHandle)
- *读取单帧点云ply文件
- read_object_model_3d('D:/3DMVS/Data/Image_20190613112209544.ply', 'mm', 'convert_to_triangles', 'true', ObjectModel3D, Status)
- Instructions[0] := 'Rotate: Left button'
- Instructions[1] := 'Zoom: Shift + left button'
- Instructions[2] := 'Move: Ctrl + left button'
- Message := 'Hik3D PointCloud'
- *可视化模型并且显示
- visualize_object_model_3d (WindowHandle, ObjectModel3D, [], [], [], [], Message, [], Instructions, PoseOut)
- dev_clear_window ()
复制代码
效果图象:
ply文件下载:
Image_20190613112209544.rar
(4.35 KB, 下载次数: 76)
|