Items with no label
3335 Discussions

How to stream video in Matlab?

희정
Beginner
2,563 Views

HI, I am a realsense user, I have a D415.

I would like to stream video in Matlab.

I downloaded all of files in this site : https://github.com/intelrealsense/librealsense GitHub - IntelRealSense/librealsense: Intel® RealSense™ SDK

After I run 'depth_example.m' file in Matlab, I got an image file in Matlab. But I want to get streaming video not single frame of image.

Also I want to use ROI and get frame data in that streaming video.

0 Kudos
7 Replies
idata
Employee
1,311 Views

Hi maroo,

 

 

Thank you for your interest in the Intel RealSense D415 camera.

 

In order to get the video stream, you have to get the image acquisition toolbox:

 

https://uk.mathworks.com/products/imaq.html

 

If you want to get and set the ROI, you should use the functions in roi_sensor.m

 

 

Regards,

 

Alexandra

 

EAlta
Beginner
1,311 Views

Hi.....I have the same problem but with the D435 depth camera.

I alrready have the image acquisition toolbox and opened the interface but it doesnt detect the connected camera.

Do I have to download a controller from "add ons"?

0 Kudos
idata
Employee
1,311 Views

Hi edgar.altamirano,

 

This issue might be caused because your Matlab hardware adapters are recognizing only one device.

 

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.

Could you please confirm that on RealSense Viewer you see all the streams?

 

 

Regards,

 

Alexandra
EAlta
Beginner
1,311 Views

Yes, on realsense viewer I can see all the streams.

0 Kudos
idata
Employee
1,311 Views

Hi edgar.altamirano,

 

 

Did you follow the instructions from my previous message?

 

Is your camera detected now?

 

 

Regards,

 

Alexandra
0 Kudos
EAlta
Beginner
1,311 Views

I have found a way to stream video from the camera on matlab.

Now I need to align depth to color or viceversa. Do you know how to achieve this?

0 Kudos
VT000
Beginner
1,311 Views

Hello Alexandra,

I have a similar problem.

How can I extract the point cloud and RGB, XYZ arrays from "bag" file with Matlab, when I record a scene using RealSense Viewer in Win10? I am using RealSense D415&D435 and the data are stored in "bag" file.

I tried with matlab functions: rosbag, select, readMessages, but I can't extract the point cloud and the XYZ array of the scene/frame. I only got the RGB or the INFRA image data tih mentioned functions (the dimensions should be 640x480x3).

Or, how can I directly store the captured data as pointcloud1 message with XYZ and RGB arrays (307200x3 dimsnesions)?

I am using Win10 and Matlab. I need the point cloud data for image processing.

Can you help me? Also, I have the Matlab wrapper, but I can't extract the point cloud with the pointcloud_example function.

Thank you in advance.

0 Kudos
Reply