Open 3D Engine ROS2 Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ROS2::CameraUtils Namespace Reference

Namespace contains utility functions for camera. More...

Functions

float GetAspectRatio (float width, float height)
 
AZ::Matrix3x3 MakeCameraIntrinsics (int width, int height, float verticalFieldOfViewDeg)
 
AZ::Matrix4x4 MakeClipMatrix (int width, int height, float verticalFieldOfViewDeg, float nearDist=0.1f, float farDist=100.0f)
 

Detailed Description

Namespace contains utility functions for camera.

Function Documentation

◆ GetAspectRatio()

float ROS2::CameraUtils::GetAspectRatio ( float  width,
float  height 
)

Function computes aspect ratio of the image.

Parameters
widthWidth of the image in pixels
heightHeight of the image in pixels.
Returns
Aspect ratio of the image.

◆ MakeCameraIntrinsics()

AZ::Matrix3x3 ROS2::CameraUtils::MakeCameraIntrinsics ( int  width,
int  height,
float  verticalFieldOfViewDeg 
)

Function computes 3x3 projection matrix (pinhole model) from camera config.

Parameters
heightHeight of the image in pixels.
widthWidth of the image in pixels
verticalFieldOfViewDegVertical field of view of the camera in degrees.
Returns
projection matrix for computer vision applications.

◆ MakeClipMatrix()

AZ::Matrix4x4 ROS2::CameraUtils::MakeClipMatrix ( int  width,
int  height,
float  verticalFieldOfViewDeg,
float  nearDist = 0.1f,
float  farDist = 100.0f 
)

Function computes 4x4 projection matrix (frustum model) from camera config.

Parameters
heightHeight of the image in pixels.
heightHeight of the image in pixels.
verticalFieldOfViewDegVertical field of view of the camera in degrees.
farDistFar clipping plane distance in meters.
nearDistNear clipping plane distance in meters.
Returns
projection matrix for the rendering.