Skip to content

Empty skeleton when running example #23

@benjaminralex

Description

@benjaminralex

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions