Closed JZhu1208 closed 3 years ago
Hi @JZhu1208 In the 2D mode of the RealSense Viewer, the panel of each stream type that is currently enabled has a row of icons at the top of it. They include options to Pause the stream and also to export a Snapshot in PNG image format.
You can use the Pause option to pause the live stream (or so so with the space bar of the keyboard) and then use the camera-shaped Snapshot option to export the current frame.
When saving a Snapshot from the Depth or Infrared stream, additional files are automatically created in .raw format (a 'depth matrix' image format that preserves depth information) and .csv format (a textual file that can be opened in database and spreadsheet software).
If you require more than one frame then you can use the Record option at the top of the Viewer's options side-panel to record a bag file. This is like a video recording of camera data that captures all of the streams that are currently enabled when the recording begins. Left-clicking on the Record option starts the recording and left-clicking again on the option ends the recording.
When recording is enabled, a blinking red light appears in the top corner of the stream panel appears, and disappears when the recording is closed.
Once a bag file recording has been created then you can replay it by drag-and-dropping the bag file into the center panel of the Viewer, or by going to the Add Source option at the top of the side-panel and selecting Load Recorded Sequence from its drop-down menu.
You can convert a bag file into a range of different formats using the RealSense SDK's rs-convert tool.
https://github.com/IntelRealSense/librealsense/tree/master/tools/convert
If you have installed the RealSense SDK on your Windows computer, a pre-made executable version of rs-convert that can be launched immediately is located in the SDK's Tools folder. rs-convert exe should be launched in the Command Prompt from the Tools folder. Instructions for doing so are provided below.
Go to the Tools folder. You can locate this easily on Windows by right-clicking on the RealSense Viewer program launch icon that the SDK installer will have placed on the Windows desktop and selecting the Open file location menu option.
In the address bar at the top of the Tools folder window, left-click on the end of the address text-box to convert it to the Windows-format address C://Program Files (x86)/Intel RealSense SDK 2.0/Tools
Copy the contents of the address box with CTRL-C and go to the Command Prompt window. You can find the Command Prompt by typing command into the search box at the bottom of the Windows screen, next to the corner button where the computer is shut down.
Type cd followed by a space and use CTRL-V to paste the address into the Command Prompt window and press return. The directory will change to the Tools folder.
Input the rs-convert conversion command. See the documentation for the rs-convert tool for information on structuring a bag conversion command.
In the 3D point cloud mode of the Viewer, you can export point-cloud data as a .ply point cloud file using the Export option that can be found at the top of the Viewer window when in 3D mode
Hi,
Thank you very much for your patient answers. Following your instructions, I have successfully saved the color image and depth map.
Encountered a new problem, is it possible to save the depth map as a file in .pfm format?
It's excellent news @JZhu1208 that you were able to achieve saving the color image and depth map.
Regarding saving the depth map as a .pfm file, I do not know of a way to export directly to pfm using a librealsense script. The SDK can export in the .raw format though (an image format that preserves depth detail), and there is a tool called Filestar that can perform raw to pfm conversion.
Hello MartyG, thanks for the quick response.
I successfully used Filestar to convert raw files to pfm files. But since I don't have a .pfm display software, I use Filestar to convert the raw file to png to verify the correctness.
At this time, some problems appeared. The first image is capture by RealSense Viewer, it shows the correct depth map. The second image is converted by Filestar, it seems to have some errors (I am not sure if it should be called an error). On this question, do you have any experience?
I have no reference for what a 'correct' pfm depth image derived from RealSense data should look like in order to do a comparison, unfortunately. There is an interesting non-RealSense discussion in the link below though about another case in which a pfm image did not meet expectations of what it should look like.
I read the non-realsense discussion. But I think it is different from the problem I encountered. What I want to understand now is that the depth map (.png)captured by RealSense Viewer is different from the depth map converted from .raw files to .png files by Filestar. The first image is capture by RealSense Viewer, it shows the correct depth map. The second image is converted by Filestar.
Depth data that is exported as a PNG from the RealSense SDK loses most of its depth information, as described in the link below.
https://github.com/IntelRealSense/librealsense/issues/3640
A .raw image's structure preserves the depth information though:
Hi @JZhu1208 Do you require further assistance with this case, please? Thanks!
Thank you for your help. Regarding this question, I don’t think I need help anymore. You can close this issue. Thank you!
You are very welcome @JZhu1208 - thanks for the update! As suggested, I will close the issue as you are satisifed with the outcome.
Hello,
I am a beginner to Intel RealSense L515, I connect the camera to the computer, and I can view the color image and depth map in the RealSense viewer. I want to know how to save them as .jpg or .png or other formats? Thank you
Sincerely