Items with no label
3335 Discussions

Colorize Depth Frame in MATLAB

ASriv7
New Contributor I
1,406 Views

How do you colorize a depth frame in MATLAB? Simply using "colormap jet" doesn't work.

I came across https://github.com/IntelRealSense/librealsense/blob/c8ee8fa1912b9297df13bfe097d527667fe0afba/src/proc/colorizer.h this and https://github.com/IntelRealSense/librealsense/blob/efe67a9e7b69c7a8c3657456543b1a220095d08b/src/proc/colorizer.cpp this in the source code, but is there an easier way to do it in MATLAB?

0 Kudos
4 Replies
MartyG
Honored Contributor III
379 Views

Are you trying to align the color and depth frames to create a combined RGBD image in MATLAB, please?

If so, the discussion linked to below about creating such a MATLAB setup with Pyrealsense2 and an SR300 may be of interest.

https://github.com/IntelRealSense/librealsense/issues/1231 Pyrealsense2: Question about 3D reconstruction problem · Issue # 1231 · IntelRealSense/librealsense · GitHub

0 Kudos
ASriv7
New Contributor I
379 Views

No, I'm just trying to display the depth raw data in the coloured form shown by RealSense Viewer.

0 Kudos
MartyG
Honored Contributor III
379 Views

You are trying to color-code the depth image with MATLAB, like the colorized speckled depth image with the number scale beside it in the RealSense Viewer? That would be a Disparity Map.

MATLAB documentation on disparity mapping

https://uk.mathworks.com/help/vision/ref/disparity.html Disparity map between stereo images - MATLAB disparity- MathWorks United Kingdom

Example tutorial (others can be found by googling for 'disparity map matlab')

http://mccormickml.com/assets/StereoVision/Stereo%20Vision%20-%20Mathworks%20Example%20Article.pdf http://mccormickml.com/assets/StereoVision/Stereo%20Vision%20-%20Mathworks%20Example%20Article.pdf

0 Kudos
AAvis
Beginner
379 Views

Hi Leponzo,

Could you share with us how did you import the Depth image to MATLAB environment? In which format did you record the Depth image and how (which tool)?

0 Kudos
Reply