src/tools/benchmark_tool/benchmark_tool/kittiobjdetsdk/kitti_obj_detection_utils.py
def project_to_camera(points_3d, proj_matrix):
        """
        Project the provided 3d points into the camera image plane using a projection matrix.

        @param points_3d: The point in 3d space to be projected into the plane
        @type  points_3d: numpy array 3xN
        @param proj_matrix: The projection matrix
        @type  proj_matrix: numpy array 3x4
        @return: numpy array 2xN
        """
        assert (points_3d.shape[0] == 3)
        # (3xn) => (4xn)
        n = points_3d.shape[1]
        ones = np.ones((1, n))
        points_3d = np.vstack([points_3d[0, :], points_3d[1, :],
                               points_3d[2, :], ones])

        # Project to the 2d plane
        # (3x4) dot (4xn) = (3xn)
        projection_2d = np.dot(proj_matrix, points_3d)

        # normalize along z axis
        projection_2d[0, :] /= projection_2d[2, :]
        projection_2d[1, :] /= projection_2d[2, :]

        return projection_2d[0:2, :]

        Project the provided 3d points into the camera image plane using a projection matrix.

        @param points_3d: The point in 3d space to be projected into the plane
        @type  points_3d: numpy array 3xN
        @param proj_matrix: The projection matrix
        @type  proj_matrix: numpy array 3x4
        @return: numpy array 2xN
        
Project the provided 3d points into the camera image plane using a projection matrix.
Project the provided 3d points into the camera image plane using a projection matrix .
def project_to_camera(points_3d, proj_matrix):
        assert (points_3d.shape[0] == 3)
        n = points_3d.shape[1]
        ones = np.ones((1, n))
        points_3d = np.vstack([points_3d[0, :], points_3d[1, :],
                               points_3d[2, :], ones])
        projection_2d = np.dot(proj_matrix, points_3d)
        projection_2d[0, :] /= projection_2d[2, :]
        projection_2d[1, :] /= projection_2d[2, :]
        return projection_2d[0:2, :]
def project_to_camera ( points_3d , proj_matrix ) : assert ( points_3d . shape [ 0 ] == 3 ) n = points_3d . shape [ 1 ] ones = np . ones ( ( 1 , n ) ) points_3d = np . vstack ( [ points_3d [ 0 , : ] , points_3d [ 1 , : ] , points_3d [ 2 , : ] , ones ] ) projection_2d = np . dot ( proj_matrix , points_3d ) projection_2d [ 0 , : ] /= projection_2d [ 2 , : ] projection_2d [ 1 , : ] /= projection_2d [ 2 , : ] return projection_2d [ 0 : 2 , : ]
Project the provided 3d points into the camera image plane using a projection matrix.
Project the provided 3d points into the camera image plane using a projection matrix .
"""
        Project the provided 3d points into the camera image plane using a projection matrix.

        @param points_3d: The point in 3d space to be projected into the plane
        @type  points_3d: numpy array 3xN
        @param proj_matrix: The projection matrix
        @type  proj_matrix: numpy array 3x4
        @return: numpy array 2xN
        """ # (3xn) => (4xn) # Project to the 2d plane # (3x4) dot (4xn) = (3xn) # normalize along z axis
numpy array 2xN
numpy array 2xN
points_3d
The point in 3d space to be projected into the plane
The point in 3d space to be projected into the plane
proj_matrix
The projection matrix
The projection matrix