deepgoyal19 / Corner-Detection-and-Edge-Detection-in-Point-Clouds

Machine Learning use in edge and corner detection in point clouds
MIT License
6 stars 0 forks source link

Use own .ply pointcloud results in wrong shape / dimension #1

Open piw-bot opened 4 months ago

piw-bot commented 4 months ago

I'm using my own point cloud in the .ply format. I use open3d to convert it to a Numpy Array:

pcd=o3d.io.read_point_cloud("pointcloud.ply")
data = np.asarray(pcd.points)

data has now the shape of (x, 3) but from what I understand it needs to have the shape (x, 6).

How do I proceed?

It gives this error when I just try to run it:

Traceback (most recent call last):
  File "C:\main.py", line 213, in <module>
    angle_xy.append(compute_angle(normals[i], xy_plane_normal))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\main.py", line 26, in compute_angle
    dot_product = np.dot(unit_vector1, unit_vector2)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: shapes (0,) and (3,) not aligned: 0 (dim 0) != 3 (dim 0)
deepgoyal19 commented 4 months ago

I will update the code by this weekend so it is more clear for users. Currently, the point cloud should have 9 columns- x, y, z, r ,g, b, Nx, Ny, Nz.

Your input data must include points coordinates and their normal vectors.

piw-bot commented 3 months ago

any updates?