Modify data of pyrealsense2 frame
Say I have a pyrealsense2.depth_frame but I want to modify the depth data somehow. Is there any way to modify/update the depth frame? This is so I can further process the depth frame using for example pyrealsense2.pointcloud.compute().
-
It sounds as though what you may have in mind is post-processing. Intel have published a tutorial on setting up post-processing filters in Python.
https://github.com/IntelRealSense/librealsense/blob/jupyter/notebooks/depth_filters.ipynb
More information on RealSense post-processing filters can be found here:
https://github.com/IntelRealSense/librealsense/blob/master/doc/post-processing-filters.md
-
The best approach may be to set multiple filter types and configure the balance of their values so that it has the overall effect on your output image that you are seeking. The RealSense Viewer takes a multi-filter approach like this, with most of the available pre-made filters (though not all of them) enabled by default in the "Post Processing" section of its options side-panel when the Viewer program is launched.
Another way to alter the processing priorities is to use a Custom Preset configuration (also known as a 'json'). This allows you to take a balanced approach to settings or weigh the balance in favor of a particular aspect of the image (e.g better hole filling or better accuracy) whilst reducing the priority of other aspects.
https://github.com/IntelRealSense/librealsense/wiki/D400-Series-Visual-Presets
A quick way to test different Custom Presets in the Viewer is to left-click on the drop-down menu near the top of the options panel called "Custom", which allows you to immediately select and apply other Custom Preset configuration types from the menu.
As well as the pre-made presets, you can create your own custom preset (json). An easy way to test this is to set values in the RealSense Viewer and then use the json file export button on the toolbar at the top of the options side-panel. Jsons can be plain text files too if you prefer to define them that way.
Please sign in to leave a comment.
Comments
3 comments