Point Cloud transformation using Python

1.3k views Asked by At

I have a point cloud with around 75 million points and I have already read the data files using laspy and they are stored in an array that looks like [x y z] where x values are in a column, y values are in a column and z values are in another column. I also have a derived 3x3 Rotation Matrix and a 3x1 Translation vector. When I am transforming the point cloud I am using the formula y=R@x+t however, this method is taking too long as it is being applied to all 75 million points

I was wondering if there is quicker way to apply the derived transformation parameters to my point cloud? Such as using any functions from laspy modules or other point cloud modules that make it easier to do this transformation?

I tried to individually apply the transformation to every point but it took a very long time. Are there any other ways to do this

1

There are 1 answers

6
D.Manasreh On

I am not sure if laspy outputs that data as NumPy arrays. If it doesn't then you would first convert your list of points into a numpy array. Next you can simply apply the transformation to the full matrix. You can try something like this:

point_cloud_array = np.array(point_cloud)
transformed_point_cloud = rotation_matrix @ point_cloud_array + translation_vector

It would be great if you provide more details so that we can help you better.

Edit: If you want a ready package, check out this tutorial. https://medium.com/@rdadlaney/basics-of-3d-point-cloud-data-manipulation-in-python-95b0a1e1941e