Main Content

pose2extr

Convert camera pose to extrinsics

    Description

    example

    camExtrinsics = pose2extr(cameraPose) returns the camera extrinsics, or the transformation from world coordinates to camera coordinates, for a camera with pose cameraPose in world coordinates.

    Examples

    collapse all

    Create a camera pose from a 3-D orientation matrix and location vector.

    orientation = eye(3);
    location = [0 0 10];
    cameraPose = rigidtform3d(orientation,location);

    Compute the transformation from world coordinates to camera coordinates.

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

    Input Arguments

    collapse all

    Orientation and location of the camera in world coordinates, specified as a rigidtform3d object.

    Output Arguments

    collapse all

    Camera extrinsics, returned 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. camExtrinsics is the inverse of cameraPose 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