python 3d库_pyntcloud是一个用于处理3D点云的Python库

Making point clouds fun again

68747470733a2f2f696d672e736869656c64732e696f2f6c67746d2f67726164652f707974686f6e2f672f646161766f6f2f70796e74636c6f75642e7376673f6c6f676f3d6c67746d266c6f676f57696474683d313829

badge.svg

68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f70796e74636c6f75642f62616467652f3f76657273696f6e3d6c6174657374

68747470733a2f2f616e61636f6e64612e6f72672f636f6e64612d666f7267652f70796e74636c6f75642f6261646765732f76657273696f6e2e737667

68747470733a2f2f616e61636f6e64612e6f72672f636f6e64612d666f7267652f70796e74636c6f75642f6261646765732f706c6174666f726d732e737667

68747470733a2f2f616e61636f6e64612e6f72672f636f6e64612d666f7267652f70796e74636c6f75642f6261646765732f6c6963656e73652e737667

68747470733a2f2f6d7962696e6465722e6f72672f62616467652e737667

pyntcloud_logo.png

pyntcloud is a Python 3 library for working with 3D point clouds leveraging the power of the Python scientific stack.

Examples (We encourage you to try out the examples by launching Binder.)

Installation

conda install pyntcloud -c conda-forge

Or:

pip install pyntcloud

Quick Overview

You can access most of pyntcloud's functionality from its core class: PyntCloud.

With PyntCloud you can perform complex 3D processing operations with minimum lines of code. For example you can:

Load a PLY point cloud from disk.

Add 3 new scalar fields by converting RGB to HSV.

Build a grid of voxels from the point cloud.

Build a new point cloud keeping only the nearest point to each occupied voxel center.

Save the new point cloud in numpy's NPZ format.

With the following concise code:

from pyntcloud import PyntCloud

cloud = PyntCloud.from_file("some_file.ply")

cloud.add_scalar_field("hsv")

voxelgrid_id = cloud.add_structure("voxelgrid", n_x=32, n_y=32, n_z=32)

new_cloud = cloud.get_sample("voxelgrid_nearest", voxelgrid_id=voxelgrid_id, as_PyntCloud=True)

new_cloud.to_file("out_file.npz")

Integration with other libraries

pyntcloud offers seamless integration with other 3D processing libraries.

You can create / convert PyntCloud instances from / to many 3D processing libraries using the from_instance / to_instance methods:

import open3d as o3d

from pyntcloud import PyntCloud

# FROM Open3D

original_triangle_mesh = o3d.io.read_triangle_mesh("diamond.ply")

cloud = PyntCloud.from_instance("open3d", original_triangle_mesh)

# TO Open3D

cloud = PyntCloud.from_file("diamond.ply")

converted_triangle_mesh = cloud.to_instance("open3d", mesh=True) # mesh=True by default

import pyvista as pv

from pyntcloud import PyntCloud

# FROM PyVista

original_point_cloud = pv.read("diamond.ply")

cloud = PyntCloud.from_instance("pyvista", original_point_cloud)

# TO PyVista

cloud = PyntCloud.from_file("diamond.ply")

converted_triangle_mesh = cloud.to_instance("pyvista", mesh=True)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值