Items with no label
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
3338 Discussões

How can I use the depth camera of RS300 with MATLAB?

DAtia
Principiante
2.930 Visualizações

When I try to open the depth camera with MATLAB, I get green image.

Is there a way to work with the depth camera in MATLAB?

Thanks.

3 Respostas
MartyG
Colaborador honorário III
1.576 Visualizações

There is not much information on the RealSense forums about using the camera with MATLAB. RealSense expert Samontab's opinion was that a direct streaming of the camera data into MATLAB was not viable, and you should instead "use the RealSense SDK to get the correct depth value and export it into MATLAB."

https://software.intel.com/forums/realsense/topic/561647 Streaming Depth into Matlab

Intel support staff member Jesus Garcia's thoughts on the issue were that "The [RealSense] SDK team does not support Matlab integration." Which is another way of saying, I guess, that you need to export the data into MATLAB somehow. A support member on the MATLAB forum confirmed that - at the time of writing his message in October 2015 - that MATLAB did not yet support RealSense.

Here's a link to somebody else who had a green image when trying to stream a RealSense depth image into MATLAB.

http://stackoverflow.com/questions/33328675/how-do-i-interpret-an-intel-realsense-camera-depth-map-in-matlab How do I interpret an Intel Realsense camera depth map in MATLAB? - Stack Overflow

A developer on GitHub has apparently written an adapter to get MATLAB to work with RealSense streams, though it was written for the SR300's predecessor the F200 so I cannot guarantee it will work.

https://github.com/gameinskysky/RealSenseImaq GitHub - gameinskysky/RealSenseImaq: Real Sense Adaptor

SL4
Novato
1.576 Visualizações

I have managed to do it. Try to use "imaqtool" in matlab to get the depth data directly. If you use the function "imshow" to display one image directly, it may be too dark. Thus I try to multiplied by a constant 100 to show the image.

Here is my code.

% 2017-03-31 by LSS

clc; clear;

% vidDepth = imaq.VideoDevice('winvideo', 2);

% vidColor = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480');

vidDepth = imaq.VideoDevice('winvideo', 1, 'Z16 _628x469');

vidColor = imaq.VideoDevice('winvideo', 2);

hVideoDepth = vision.VideoPlayer;

hVideoDepth.Name = 'depth';

hVideoColor = vision.VideoPlayer;

hVideoColor.Name = 'color';

nFrames = 0;

while (nFrames < 500)

DepthFrame = 100 * step(vidDepth);

step(hVideoDepth, DepthFrame);

step(hVideoColor, step(vidColor));

nFrames = nFrames + 1;

end

release(vidDepth);

release(vidColor);

release(hVideoDepth);

release(hVideoColor);

close all force;

fprintf('end\n');

MartyG
Colaborador honorário III
1.576 Visualizações

Awesome, thanks so much for sharing your experience and your script

Responder