Namespace contains utility functions for camera.
More...
|
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) |
|
Namespace contains utility functions for camera.
◆ GetAspectRatio()
float ROS2::CameraUtils::GetAspectRatio |
( |
float |
width, |
|
|
float |
height |
|
) |
| |
Function computes aspect ratio of the image.
- Parameters
-
width | Width of the image in pixels |
height | Height 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
-
height | Height of the image in pixels. |
width | Width of the image in pixels |
verticalFieldOfViewDeg | Vertical 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
-
height | Height of the image in pixels. |
height | Height of the image in pixels. |
verticalFieldOfViewDeg | Vertical field of view of the camera in degrees. |
farDist | Far clipping plane distance in meters. |
nearDist | Near clipping plane distance in meters. |
- Returns
- projection matrix for the rendering.