View my account

Triangulation

Comments

10 comments

  • MartyX Grover

    Hi Torsten Wilhelm  Typically when using rs2_deproject_pixel_to_point with both depth and RGB streams enabled, depth-color alignment is first performed with the SDK's align_to instruction and then rs2_deproject_pixel_to_point is subsequently used afterwards.

    0
    Comment actions Permalink
  • Torsten Wilhelm

    Hello MartyG, Yes, I use align_to already.

    0
    Comment actions Permalink
  • MartyX Grover

    Thank you very much.  Could you provide more information about the statement As a starting point, I transform the camera origin to the world coordinate system please?  The rs2_transform_pixel_to_point instruction converts a 2D pixel to a 3D point whose depth origin should be the 0,0,0 coordinate of the camera's depth coordinate system.  So I would like to understand why the camera origin is first being transformed before rs2_pixel_to_point is performed.  Thanks!

    0
    Comment actions Permalink
  • Torsten Wilhelm

    I calibrate several cameras against a checkerboard. So the world CS is positioned on the checkerboard. The extrinsic matrix (obtained from krabsch calibration) transforms from camera CS to world CS. rs2_pixel_to_point() transforms from pixel CS to the respective camera CS. 

    My goal is to construct a 3D line for each keypoint that starts from the cameras optical center. So first I take the origin of the camera CS [0,0,0] and transform to world CS. Then I take the pixel position of the keypoint and transform to camera CS using rs2_pixel_to_point (at an arbitrary distance from the camera), then I transform this point to world CS. The two points should give a line intersecting with the pointcloud in that feature. 

    Can I upload images here?

    0
    Comment actions Permalink
  • Torsten Wilhelm

    I assume that aligning color and depth stream, I can use the extrinsic matrix for the rgb stream as well.

    0
    Comment actions Permalink
  • MartyX Grover

    There is an Insert Image icon on top of the comment writing box to select and insert an image file, or you can copy a section of an image in a paint package with a selection tool and paste it directly into the comment box with Ctrl-V.

     

    0
    Comment actions Permalink
  • Torsten Wilhelm

    Hello again,

    so here is an image of the extrinsic calibration:

    And here the keypoint detections in the rgb image:

    And the cumulative point cloud, the world CS and the 3 cameras with a line projected out towards the nose and the left shoulder. The triangulated points correspond to a smaller version of the person sitting in front of the point cloud. It suggests that the focal length (and principal point) used in rs2_pixel_to_point() are not correct.

    I align the frameset to the color stream. So the rgb intrinsics are the same as the depth intrinsics, which makes sense, I guess.

     

    0
    Comment actions Permalink
  • MartyX Grover

    As you are drawing lines over a point cloud, I wonder whether drawing 3D polylines might provide more accurate alignment of the lines to the pointcloud points.

    https://github.com/IntelRealSense/librealsense/issues/3868#issuecomment-487654994

    0
    Comment actions Permalink
  • Torsten Wilhelm

    Hello, I use Open3D for plotting were I generate a bunch of o3d.utility.Vector3dVector to visualize the triangulation lines. I'm sure the line plotting is correct, because the triangulated points are where the lines intersect. The error must be in the line calculation where I use intrinsics and extrinsics.

    0
    Comment actions Permalink
  • MartyG

    If two pointclouds are being "stitched" together into a single combined cloud then a more common approach for doing so in Open3D is ICP registration, as described in the link below.

    http://www.open3d.org/docs/latest/tutorial/Basic/icp_registration.html

    0
    Comment actions Permalink

Please sign in to leave a comment.