For better visualization, you can do the following conversion
// For color framecv::cvtColor(colorMat, colorMat, cv::COLOR_BGR2RGB);// For depth framedepthMat.convertTo(depthMat, CV_8U,255.0/1024.0);cv::applyColorMap(depthMat, depthMat, cv::COLORMAP_JET);// For IR frameirMat.convertTo(irMat, CV_8U,255.0/1024.0);
Tutorial - Python
After connect to camera and start each sensor (color, depth and IR). Read the video frames
Convert video frame to OpenCV format which is numpy array
# Color framecolorMat = np.fromstring(colorFrame.get_buffer_as_uint8(), dtype=np.uint8).reshape(480, 640, 3)# Depth framedepthMat = np.fromstring(depthFrame.get_buffer_as_uint16(), dtype=np.uint16).reshape(480, 640)# IR frameirMat = np.fromstring(irFrame.get_buffer_as_uint16(), dtype=np.uint16).reshape(480, 640)
For better visualization, you can do the following conversion
# For color framecolorMat = cv2.cvtColor(colorMat, cv2.COLOR_BGR2RGB)# For depth framedepthMat = np.uint8(depthMat.astype(float) *255/1024)depthMat = cv2.applyColorMap(depthMat, cv2.COLORMAP_JET)# For IR frameirMat = np.uint8(irMat.astype(float) *255/1024)