Python - 显示 3D 点云 [英] Python - Display 3D Point Cloud
问题描述
我有一个包含 3D 点云的 .PLY 文件:我想绘制它并在 Python 中对其进行可视化..PLY 文件只包含顶点而不包含面.
I have a .PLY file that contains a 3D Point Cloud: I want to plot it and visualize it in Python. The .PLY file contains ONLY vertex and NOT faces.
你能告诉我一个简单的 Python 库来处理 3D 点云的绘制吗?
重要的是要指出我对绘制网格不感兴趣,而只是对点云感兴趣.
It is important to remark that I am not interested in plotting a Mesh, but just the Point Cloud.
推荐答案
对于任何想简单方法在 Python 中读取和显示 PLY 点云的人,我的回答是自己的问题报告我发现在我的情况下最好的解决方案.
For anybody wondering for an easy way to read and display PLY point clouds in Python I answer my own question reporting what I've found to be the best solution in my case.
打开cmd并输入:
pip install open3d
这将在您的机器上安装 Open3D,然后您只需执行以下示例脚本即可读取和显示您的 PLY 点云:
This will install Open3D on your machine and you will then be able to read and display your PLY point clouds just by executing the following sample script:
import numpy as np
from open3d import *
def main():
cloud = read_point_cloud("cloud.ply") # Read the point cloud
draw_geometries([cloud]) # Visualize the point cloud
if __name__ == "__main__":
main()
这篇关于Python - 显示 3D 点云的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!