def lidar_to_camera(points, r_rect, velo2cam):
    points_shape = list(points.shape[:(- 1)])
    if (points.shape[(- 1)] == 3):
        points = np.concatenate([points, np.ones((points_shape + [1]))], axis=(- 1))
    camera_points = (points @ (r_rect @ velo2cam).T)
    return camera_points[..., :3]
def lidar_to_camera(points, r_rect, velo2cam):
    points_shape = list(points.shape[:(- 1)])
    if (points.shape[(- 1)] == 3):
        points = np.concatenate([points, np.ones((points_shape + [1]))], axis=(- 1))
    camera_points = (points @ (r_rect @ velo2cam).T)
    return camera_points[..., :3]