src/tools/benchmark_tool/benchmark_tool/kittiobjdetsdk/kitti_obj_detection_utils.py
def bbox_2d_from_3d_bbox_projection(bbox_3d_proj):
        """
        Provide a 2d bounding box that encloses the 3d bounding box projection into the plane.

        @param bbox_3d_proj: 2d coordinates on the plane of the 3d bounding box projection
        @type  bbox_3d_proj: numpy array 2xN
        @return: int/float - top left corner X axis coordinate, top left corner Y axis coordinate,
            bottom right corner X axis coordinate, bottom right corner Y axis coordinate
        """
        assert (bbox_3d_proj.shape[0] == 2)
        assert (bbox_3d_proj.shape[1] >= 0)

        top_left_corner = np.array([2**32, 2**32])
        bottom_right_corner = np.array([0, 0])

        for i in range(0, bbox_3d_proj.shape[1]):
            point = np.array([bbox_3d_proj[0, i], bbox_3d_proj[1, i]])

            if top_left_corner[0] > point[0]:
                top_left_corner[0] = point[0]

            if top_left_corner[1] > point[1]:
                top_left_corner[1] = point[1]

            if bottom_right_corner[0] < point[0]:
                bottom_right_corner[0] = point[0]

            if bottom_right_corner[1] < point[1]:
                bottom_right_corner[1] = point[1]

        # x1, y1, x2, y2
        return top_left_corner[0], top_left_corner[1], bottom_right_corner[0], \
            bottom_right_corner[1]

        Provide a 2d bounding box that encloses the 3d bounding box projection into the plane.

        @param bbox_3d_proj: 2d coordinates on the plane of the 3d bounding box projection
        @type  bbox_3d_proj: numpy array 2xN
        @return: int/float - top left corner X axis coordinate, top left corner Y axis coordinate,
            bottom right corner X axis coordinate, bottom right corner Y axis coordinate
        
Provide a 2d bounding box that encloses the 3d bounding box projection into the plane.
Provide a 2d bounding box that encloses the 3d bounding box projection into the plane .
def bbox_2d_from_3d_bbox_projection(bbox_3d_proj):
        assert (bbox_3d_proj.shape[0] == 2)
        assert (bbox_3d_proj.shape[1] >= 0)
        top_left_corner = np.array([2**32, 2**32])
        bottom_right_corner = np.array([0, 0])
        for i in range(0, bbox_3d_proj.shape[1]):
            point = np.array([bbox_3d_proj[0, i], bbox_3d_proj[1, i]])
            if top_left_corner[0] > point[0]:
                top_left_corner[0] = point[0]
            if top_left_corner[1] > point[1]:
                top_left_corner[1] = point[1]
            if bottom_right_corner[0] < point[0]:
                bottom_right_corner[0] = point[0]
            if bottom_right_corner[1] < point[1]:
                bottom_right_corner[1] = point[1]
        return top_left_corner[0], top_left_corner[1], bottom_right_corner[0], \
            bottom_right_corner[1]
def bbox_2d_from_3d_bbox_projection ( bbox_3d_proj ) : assert ( bbox_3d_proj . shape [ 0 ] == 2 ) assert ( bbox_3d_proj . shape [ 1 ] >= 0 ) top_left_corner = np . array ( [ 2 ** 32 , 2 ** 32 ] ) bottom_right_corner = np . array ( [ 0 , 0 ] ) for i in range ( 0 , bbox_3d_proj . shape [ 1 ] ) : point = np . array ( [ bbox_3d_proj [ 0 , i ] , bbox_3d_proj [ 1 , i ] ] ) if top_left_corner [ 0 ] > point [ 0 ] : top_left_corner [ 0 ] = point [ 0 ] if top_left_corner [ 1 ] > point [ 1 ] : top_left_corner [ 1 ] = point [ 1 ] if bottom_right_corner [ 0 ] < point [ 0 ] : bottom_right_corner [ 0 ] = point [ 0 ] if bottom_right_corner [ 1 ] < point [ 1 ] : bottom_right_corner [ 1 ] = point [ 1 ] return top_left_corner [ 0 ] , top_left_corner [ 1 ] , bottom_right_corner [ 0 ] , bottom_right_corner [ 1 ]
Provide a 2d bounding box that encloses the 3d bounding box projection into the plane.
Provide a 2d bounding box that encloses the 3d bounding box projection into the plane .
"""
        Provide a 2d bounding box that encloses the 3d bounding box projection into the plane.

        @param bbox_3d_proj: 2d coordinates on the plane of the 3d bounding box projection
        @type  bbox_3d_proj: numpy array 2xN
        @return: int/float - top left corner X axis coordinate, top left corner Y axis coordinate,
            bottom right corner X axis coordinate, bottom right corner Y axis coordinate
        """ # x1, y1, x2, y2
int/float - top left corner X axis coordinate, top left corner Y axis coordinate,
bottom right corner X axis coordinate, bottom right corner Y axis coordinate
int / float - top left corner X axis coordinate top left corner Y axis coordinate bottom right corner X axis coordinate bottom right corner Y axis coordinate
bbox_3d_proj
2d coordinates on the plane of the 3d bounding box projection
2d coordinates on the plane of the 3d bounding box projection