View my account

Save point cloud as .ply but rotated

Comments

3 comments

  • MartyX Grover

    Hi Gueganj  As you want to rotate the cloud data and not just change the viewpoint that the cloud is observed from, it sounds as though that an affine transform is what you need.  It is typically used to orient multiple point clouds to the same rotation and position so that they can be 'stitched' together into a single cloud.

    The RealSense SDK instruction rs2_transform_point_to_point is an example of an affine transform, as described in the Python case in the link below.

    https://github.com/IntelRealSense/librealsense/issues/5583 

    0
    Comment actions Permalink
  • Gueganj

    Hi MartyG, I understand your answer and what I want to do is exactly an affine transform (that is basically just a matrix multiplication) but what I am struggling to do is to make it works with the librealsense. From my understanding, rs2_transform_point_to_point() takes as input a extrinsics structure and a float[3] (the point to transform) and I want to interface this with 

    pc = rs.pointcloud()
    pc.map_to(image_frame)
    points = pc.calculate(depth_frame)
    points.export_to_ply('point_cloud.ply', image_frame)

    This code lines does not use float[3] variables but some kind of pyrealsense2.frame object (image_frame, depth_frame and points) and pyrealsense2.pyrealsense2.pointcloud object (pc) .... Also I have checked the source code on github and the documentation but I cannot really find good details/explanation on how to do it 

     

    Thank you for your help !

     

    0
    Comment actions Permalink
  • MartyX Grover

    There are limited references available on the subject of using rs2_transform_point_to_point for affine transformation of a point cloud.  The link below may be helpful in advancing the discussion.

    https://github.com/IntelRealSense/librealsense/issues/8333#issuecomment-778252600

    0
    Comment actions Permalink

Please sign in to leave a comment.