Replies: 4 comments 1 reply
-
Hi @damavand1 If you save depth frames from the RealSense Viewer tool in its 2D mode using the 'Snapshot' camera icon on the top of the stream panel then it will save depth as three files - a colorized PNG, a .raw file and a .csv file. Savig depth to a PNG file causes most of the depth information to be lost, which is not helpful when trying to import it into another tool and recover depth from it. A .raw file is an image format that preserves the depth information so that it can be read when loaded back into a script. A .csv file saves the depth data into a textual format that can be imported into database and spreadsheet packages. You can also save RGB frames in the Viewer as .jpg using the Snapshot icon at the top of the RGB stream panel. Depth images will be grayscale if saved using a self-created program script instead of the Viewer, as the Viewer applies a range of depth colorization options to its images by default. When creating your own program script, these colorization settings must be manually programmed into the script to obtain a depth image that resembles those of the Viewer. Another way to save depth is by recording a .bag format file. This is like a video recording of camera data that enables the depth information to be read by a program as though it is coming from a live camera. |
Beta Was this translation helpful? Give feedback.
-
The value of 1000 in Open3D apparently refers to the default depth scale. http://www.open3d.org/docs/0.8.0/python_api/open3d.geometry.RGBDImage.html?highlight=create%20rgbd The default depth scale of all RealSense 400 Series cameras (except the D405 model) is also 1000. In the RealSense SDK, the depth scale remains a fixed value as distance changes. A real-world distance in meters can be calculated in the SDK by multiplying the raw pixel depth value by the fixed depth scale value. For example, using 0.001 instead of 1000, a raw pixel depth value of 6500 x the fixed depth scale of 0.001 = 6.5 meters depth for that pixel. If the same principle holds true for the Open3D depth scale then I would expect the scale value 1000 to be used for all mm distances (1000, 1500, 2000, 2500, etc). I emphasize though that my knowledge of Open3D programming is limited. |
Beta Was this translation helpful? Give feedback.
-
how can i save depth image (to disk) from saved mm depth for each pixel sorted in short[] (short array) to a .PNG file using RealSense by C# or python ? is there any function and method to give me an array from pixel depth and store to disk ? |
Beta Was this translation helpful? Give feedback.
-
There is very little information available about using short[] with librealsense, but the C# scripting at #4201 may help you to achieve the sorting of depth data. You could then move on to looking at the problem of saving the data to PNG afterwards. |
Beta Was this translation helpful? Give feedback.
-
hi
(I have problem in theory not in code and programming)
I can successfully save RGB in .jpg file easily .
but about Depth image I don't know how can I save that for next usage e.g. using in open3d or other.
I'm confused because each pixel in depth image show distance and it means for max 4 meter we have 1 to 4*1000 mm
that means we have 4000 options for each pixel. now how can I save D for each pixel in a picture file.
tnx
Beta Was this translation helpful? Give feedback.
All reactions