Shooting and saving videos with RealSense d435 using MATLAB
I don't know how to shoot and save video with intel RealSense d435 depth and color cameras using MATLAB.
"Depth_example" and "depth_view_example" can be saved if they are still images, but I don't know how to shoot a video and save it.
Please let me know.
-
Hello, if you need a live depth image like the one in the 2D mode of the RealSense Viewer (not a 3D point cloud) then the RealSense MATLAB wrapper script in the link below may be helpful.
https://github.com/IntelRealSense/librealsense/issues/9056#issuecomment-855930210
-
There are a limited number of references available about using RealSense with MATLAB for live capture. The RealSense MATLAB wrapper provides an example program called capture_example.m for capturing and rendering multiple streams. Since the MATLAB wrapper's programming language is almost 1:1 with the SDK's C++ API, it may be possible to add capture to file to that project.
https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/capture_example.m
A RealSense user also shared their script for generating an RGB point cloud (again, not saving the streams).
https://community.intel.com/t5/Items-with-no-label/MATLAB-RGB-point-cloud/td-p/584717
-
Hello MartyG
When I run "capture_example.m" I get the following errorThe output argument "profile" (and probably other arguments as well) was not assigned during the call to "realsense / pipeline / get_active_profile".
Error: realsense.capture_example / StartUpFunc (line 180)
SProf = app.RsPipeLine.get_active_profile ();Has occurred. How can I get rid of this error?
-
It is referring to this line of the script:
https://github.com/IntelRealSense/librealsense/blob/master/wrappers/matlab/capture_example.m#L180
The command get_active_profile() checks the available stream profiles that are available for depth, color, etc.
If the profiles cannot be retrieved then that would suggest to me some kind of failure in the pipeline start, such as a disconnection of the camera. Are you able to run other MATLAB examples successfully?
-
There is the Image Acquisition Toolbox for MATLAB. My understanding is that it does not have official support for RealSense cameras specifically but can access the camera through generic settings. A member of MATLAB's support forum also suggested that a custom adaptor could be created for a RealSense camera.
Image Acquisition Toolbox
https://www.mathworks.com/products/image-acquisition.html
Using generic settings
The following advice was provided in a past RealSense case:
On Matlab, go to Home tab -> Add-Ons-> Get Hardware Support Packages -> MATLAB Support Package for USB Webcams and Image Acquisition Toolbox Support Package for OS Generic Video Interface.
Creating a custom adaptor
Please sign in to leave a comment.
Comments
8 comments