meyerls / pc-skeletor

Skeletonization of 3D Point Clouds
MIT License
150 stars 18 forks source link

Empty skeleton when running example #23

Open benjaminralex opened 8 months ago

benjaminralex commented 8 months ago

Hello,

When running the following example:

`import open3d as o3d import numpy as np

from pc_skeletor import Dataset

downloader = Dataset() trunk_pcd_path, branch_pcd_path = downloader.download_semantic_tree_dataset()

pcd_trunk = o3d.io.read_point_cloud(trunk_pcd_path) pcd_branch = o3d.io.read_point_cloud(branch_pcd_path) pcd = pcd_trunk + pcd_branch `

`from pc_skeletor import LBC

lbc = LBC(point_cloud=pcd, down_sample=0.008) lbc.extract_skeleton() lbc.extract_topology() lbc.visualize() lbc.show_graph(lbc.skeleton_graph) lbc.show_graph(lbc.topology_graph) lbc.save('./output') lbc.animate(init_rot=np.asarray([[1, 0, 0], [0, 0, 1], [0, 1, 0]]), steps=300, output='./output') `

I get these errors:

lbc.extract_topology() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/pc-skeletor/pc_skeletor/laplacian.py", line 282, in extract_topology self.skeleton = self.contracted_point_cloud.farthest_point_down_sample(num_samples=self.fps_points) AttributeError: 'open3d.cpu.pybind.geometry.PointCloud' object has no attribute 'farthest_point_down_sample

lbc.show_graph(lbc.skeleton_graph) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/pc-skeletor/pc_skeletor/base.py", line 59, in show_graph nx.draw_networkx(G=graph, pos=np.asarray(pos)[:, [0, 2]]) IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Are there any fixes for these?

Thanks!

meyerls commented 7 months ago

My first guess is that the open3d version is not correct (my bad that I did not specify any version). Please try pip install open3d==0.17.0