-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert raw depth data to rs.object #10770
Comments
Hi @pixml27 If your goal is to convert a numpy array to rs2::frame format in Python, this has previously been explored by RealSense users but remains an unsolved problem unfortunately as far as I am aware, as described in #2551 and #5784 Whilst the RealSense SDK's software device interface can be used, it works best with C++ and has been shown to have difficulties with using it in Python scripts. cv::mat to rs2::frame is feasible, as advised by a RealSense team member at #2634 (though the scripting is C++). |
@MartyG-RealSense thank you for you answer! I need to use two functions: first and second |
Raw 16-bit 'pixel depth' values (uint16_t) like those in the above image can be multiplied by the depth unit scale of the camera to convert them to the real-world distance in meters. For all 400 Series models except the D405 the default depth unit scale is 0.001 and does not changed unless altered deliberately by the program or by user input. For example, for a raw depth value of 3735, multiplying it by 0.001 gives a real-world distance of 3.375 meters. If the get_distance() instruction is used though then you do not have to multiply by the depth scale as the instruction does it for you and provides the result in meters. #9939 should be a helpful reference for Python scripting for get_distance and for information about the difference between uint16t * depth scale and obtaining depth in meters with get_distance() |
@MartyG-RealSense Thanks for the tips and links - they helped a lot! |
Hi @pixml27 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Issue Description
Hi guys!
We are trying to repeat this example
However, we don't have access to live cameras, all we have is stored infrared images, depth images and raw depth data.
Our only problem is we can't apply filters to the depth image because we have raw data and not an rs2::frame object.
So, is there a way to convert the numpy array loaded from the xxx_Depth.raw file into the rs.stream.depth object that is being used here?
The text was updated successfully, but these errors were encountered: