Contenu principal

extr2pose

R2026b

Convert extrinsics to camera pose

Since R2022b

    Description

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

    example

    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
           Translation: [0 0 10]
                     R: [3×3 double]
    
                     A: [1     0     0     0
                         0     1     0     0
                         0     0     1    10
                         0     0     0     1]
    
    

    Input Arguments

    collapse all

    Camera extrinsics, specified as a scalar or array of rigidtform3d or se3 objects. 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 scalar or array of rigidtform3d or se3 objects of the same size as the input camExtrinsics. Each element of cameraPose is the inverse of the corresponding element of camExtrinsics, as calculated using the invert function.

    Extended Capabilities

    expand all

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

    GPU Code Generation
    Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

    Version History

    Introduced in R2022b

    expand all