Items with no label
3338 Discussões

How to get depth raw data and into OPENCV matrix

fHsu9
Principiante
1.742 Visualizações

Hi,

I'm using a D435 camera. Is there a way to get the raw data (16-bit depth value) into OPENCV Mat?

Thanks!

0 Kudos
1 Responder
MartyG
Colaborador honorário III
691 Visualizações

There is a sample program for creating a .mat file from a colorized stream.

https://github.com/IntelRealSense/librealsense/tree/master/wrappers/opencv/imshow librealsense/wrappers/opencv/imshow at master · IntelRealSense/librealsense · GitHub

In this line mentioned in the article:

Mat image(Size(w, h), CV_8UC3, (void*)depth.get_data(), Mat::AUTO_STEP);

I think that if you wanted a non-colorized 8-bit stream, you would probably change the CV_8UC3 (an 8-bit colorized stream with 3 channels) to CV_16U

Responder