def mask_depth_image(depth_image, min_depth, max_depth):
    ' mask out-of-range pixel to zero '
    (ret, depth_image) = cv2.threshold(depth_image, min_depth, 100000, cv2.THRESH_TOZERO)
    (ret, depth_image) = cv2.threshold(depth_image, max_depth, 100000, cv2.THRESH_TOZERO_INV)
    depth_image = np.expand_dims(depth_image, 2)
    return depth_image
mask out-of-range pixel to zero
def mask_depth_image(depth_image, min_depth, max_depth):
    '  '
    (ret, depth_image) = cv2.threshold(depth_image, min_depth, 100000, cv2.THRESH_TOZERO)
    (ret, depth_image) = cv2.threshold(depth_image, max_depth, 100000, cv2.THRESH_TOZERO_INV)
    depth_image = np.expand_dims(depth_image, 2)
    return depth_image