intrinsicToWorld

Class: imref3d

Convert from intrinsic to world coordinates

Syntax

[xWorld, yWorld, zWorld] = intrinsicToWorld(R,xIntrinsic,yIntrinsic,zIntrinsic)

Description

[xWorld, yWorld, zWorld] = intrinsicToWorld(R,xIntrinsic,yIntrinsic,zIntrinsic) maps point locations from the intrinsic system (xIntrinsic, yIntrinsic, zIntrinsic) to the world system (xWorld, yWorld, zWorld) based on the relationship defined by the spatial referencing object R. If the input includes values that fall outside the limits of the image in the intrinsic system, the intrinsicToWorld method extrapolates worldX, worldY, and worldZ outside the bounds of the image in the world system.

Input Arguments

R

Spatial referencing object, imref3d, associated with an image.

xIntrinsic

Coordinate in X dimension in intrinsic system, specified as a numeric scalar or vector

yIntrinsic

Coordinate in Y dimension in intrinsic system, specified as a numeric scalar or vector

zIntrinsic

Coordinate in Z dimension in intrinsic system, specified as a numeric scalar or vector

Output Arguments

xWorld

Coordinates along the X dimension in world system, returned as a numeric scalar or vector the same size as xIntrinsic.

yWorld

Coordinates along the Y dimension in world system, returned as a numeric scalar or vector the same size as xIntrinsic.

zWorld

Coordinates along the Z dimension in world system, returned as a numeric scalar or vector the same size as xIntrinsic

Examples

expand all

Convert Intrinsic Coordinates to World Coordinates

Read an image.

 I = imread('peppers.png');

Create an imref3d object and associate it with the image.

 R = imref3d(size(I))
R = 

 imref3d

  Properties:
           XWorldLimits: [0.5000 512.5000]
           YWorldLimits: [0.5000 384.5000]
           ZWorldLimits: [0.5000 3.5000]
              ImageSize: [384 512 3]
    PixelExtentInWorldX: 1
    PixelExtentInWorldY: 1
    PixelExtentInWorldZ: 1
    ImageExtentInWorldX: 512
    ImageExtentInWorldY: 384
    ImageExtentInWorldZ: 3
       XIntrinsicLimits: [0.5000 512.5000]
       YIntrinsicLimits: [0.5000 384.5000]
       ZIntrinsicLimits: [0.5000 3.5000]

Convert intrinsic coordinates to world coordinates. In this example, intrinsic coordinates align with world coordinates.

[x y z] = intrinsicToWorld(R,5,5,3)
x =

     5


y =

     5


z =

     3
Was this topic helpful?