Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0 

    @param float_img_buff: ROS Image to translate

    @type img: ros image

    @return a Opencv RGB image

def depthToRGB8(float_img_buff, encoding):
    '''
    Translates from Distance Image format to RGB. Inf values are represented by NaN, when converting to RGB, NaN passed to 0 

    @param float_img_buff: ROS Image to translate

    @type img: ros image

    @return a Opencv RGB image

    '''
    gray_image = None
    if (encoding[-3:-2]== "U"):
        gray_image = float_img_buff
    else:    
        float_img = np.zeros((float_img_buff.shape[0], float_img_buff.shape[1], 1), dtype = "float32")
        float_img.data = float_img_buff.data
        gray_image=cv2.convertScaleAbs(float_img, alpha=255/MAXRANGE)


    cv_image = cv2.cvtColor(gray_image, cv2.COLOR_GRAY2RGB)

    return cv_image