visualize the point cloud .obj file

3.1k views Asked by At

I have the error when visualizing the point cloud by using open3d.

My code is

import numpy as np import open3d as o3d

if name == "main":

print("Load a ply point cloud, print it, and render it")
pcd = o3d.io.read_point_cloud(r"D:\1. PSM 2020\TRY\ayuu\pointnet-master\Area_6_conferenceRoom_1_pred.obj")
print(pcd)
print(np.asarray(pcd.points))
o3d.visualization.draw_geometries([pcd])

And the error said that my file do not have point cloud

runfile('D:/1. PSM 2020/TRY/ayuu/pointnet-master/sem_seg/TRY2.py', wdir='D:/1. PSM 2020/TRY/ayuu/pointnet-master/sem_seg') Load a ply point cloud, print it, and render it [Open3D WARNING] Read geometry::PointCloud failed: unknown file extension for D:\1. PSM 2020\TRY\ayuu\pointnet-master\Area_6_conferenceRoom_1_pred.obj (format: auto). PointCloud with 0 points. []

But, if I visualize the point cloud using online 3d viewer, it will show the result.

enter image description here

1

There are 1 answers

0
Dilara Gokay On

You should use read_triangle_mesh instead of read_point_cloud for reading an obj file. See http://www.open3d.org/docs/0.9.0/tutorial/Basic/file_io.html for an example.