Main Content

extr2pose

Convert extrinsics to camera pose

    Description

    example

    cameraPose = extr2pose(camExtrinsics) returns the camera pose, cameraPose, in world coordinates, given the camera extrinsics.

    Examples

    collapse all

    Create a 3-D rigid geometric transformation from a rotation matrix and a translation vector.

    rotationMatrix = eye(3);
    translationVector = [0 0 -10];
    tform = rigidtform3d(rotationMatrix,translationVector);

    Compute the camera pose in world coordinates.

    cameraPose = extr2pose(tform)
    cameraPose = 
      rigidtform3d with properties:
    
        Dimensionality: 3
                     R: [3×3 double]
           Translation: [0 0 10]
                     A: [4×4 double]
    
    

    Input Arguments

    collapse all

    Camera extrinsics, specified as a rigidtform3d object. The extrinsics are a transformation from world coordinates to camera coordinates that enables you to transform points from the world coordinate system to the camera coordinate system.

    Output Arguments

    collapse all

    Camera pose in world coordinates, returned as a rigidtform3d object. cameraPose is the inverse of camExtrinsics as calculated using the invert function.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2022b

    expand all