librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

RGBD frame alignment w/o free functions

Open upxela opened this issue 8 years ago • 2 comments

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model D400
Firmware Version 5.10.03
Operating System & Version Win 10
Kernel Version (Linux Only) (e.g. 4.14.13)
Platform PC
SDK Version 2.16
Language python

Issue Description

I have a set of depth and rgb images that are synced and I am trying to align them. #1274 explains how to use the free functions to project points from depth image to rgb. These functions require the extrinsics/intrinsics of the camera in a special pyrealsense2 class. I was wondering if there was a method for me to obtain the same results without using these functions and using the classes, essentially storing the extrinsics and intrinsics as ordinary arrays to obtain the same alignment method.

upxela avatar Oct 25 '18 19:10 upxela

[Realsense Customer Engineering Team Comment] For the aligned image, You can try the python example. https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/align-depth2color.py

For intrinsics/extrinsics, Please try to add these code after profile = pipeline.start(config) in align-depth2color.py

depth_video_profile = profile.get_stream(rs2.stream.depth).as_video_stream_profile() color_video_profile = profile.get_stream(rs2.stream.color).as_video_stream_profile()

depth_video_profile.get_intrinsics() color_video_profile.get_intrinsics() depth_video_profile.get_extrinsics_to(color_video_profile)

I was looking for a similar solution. Couldn't find a way to save / load them. Solutions I've used in the past:

  1. Manually extract the intrinsic / extrinsic parameters, store them and later load them back into new objects to use the functions
  2. Take the function's source and re-write it to get the values using a different method (needed a Matlab function at the time)

laughingrice avatar Nov 02 '18 19:11 laughingrice