UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::PerspectiveCamera Struct Reference

Perspective camera model for ray-generation and projection. More...

#include <lib/vision/include/ufo/vision/camera/perspective.hpp>

Public Member Functions

float fx () const noexcept
 
float fy () const noexcept
 
void lookAt (Vec3f center, Vec3f const &target, Vec3f const &up)
 Orients the camera so it looks from center toward target.
 
Mat4f projection () const
 
Image< Ray3frays () const
 
template<class ExecutionPolicy >
Image< Ray3frays (ExecutionPolicy &&policy) const
 
Mat4f view () const
 

Public Attributes

float far_clip
 Distance to the far clipping plane.
 
PerspectiveIntrinsics intrinsics
 The intrinsic parameters of the camera.
 
float near_clip
 Distance to the near clipping plane.
 
Transform3f pose
 Camera-to-world pose transform.
 

Friends

bool operator== (PerspectiveCamera const &, PerspectiveCamera const &) noexcept=default
 

Detailed Description

Perspective camera model for ray-generation and projection.

PerspectiveCamera stores the intrinsic parameters and the extrinsic pose (camera-to-world transform) needed to:

  • build a 4×4 view or projection matrix (view(), projection()),
  • cast a dense Image<Ray3f> of world-space rays through every pixel (rays(), rays(policy)).

The pose convention is camera-to-world: pose is the transform that maps a point from camera space to world space.

Coordinate conventions

  • Camera space: Right-handed OpenCV convention (+X Right, +Y Down, +Z Forward).
  • NDC space: x ∈ [-1, 1], y ∈ [-1, 1], z ∈ [0, 1].
  • Image space: (row, col) with (0,0) at the top-left corner.

Definition at line 92 of file perspective.hpp.

Member Function Documentation

◆ fx()

float ufo::PerspectiveCamera::fx ( ) const
inlinenoexcept

Definition at line 194 of file perspective.hpp.

◆ fy()

float ufo::PerspectiveCamera::fy ( ) const
inlinenoexcept

Definition at line 201 of file perspective.hpp.

◆ lookAt()

void ufo::PerspectiveCamera::lookAt ( Vec3f  center,
Vec3f const &  target,
Vec3f const &  up 
)
inline

Orients the camera so it looks from center toward target.

Parameters
[in]centerThe new camera position in world space.
[in]targetThe point in world space to look at.
[in]upThe world-space up vector.

Definition at line 116 of file perspective.hpp.

◆ projection()

Mat4f ufo::PerspectiveCamera::projection ( ) const
inline

Definition at line 121 of file perspective.hpp.

◆ rays() [1/2]

Image< Ray3f > ufo::PerspectiveCamera::rays ( ) const
inline

Definition at line 133 of file perspective.hpp.

◆ rays() [2/2]

template<class ExecutionPolicy >
Image< Ray3f > ufo::PerspectiveCamera::rays ( ExecutionPolicy &&  policy) const
inline

Definition at line 136 of file perspective.hpp.

◆ view()

Mat4f ufo::PerspectiveCamera::view ( ) const
inline

Definition at line 131 of file perspective.hpp.

Member Data Documentation

◆ far_clip

float ufo::PerspectiveCamera::far_clip

Distance to the far clipping plane.

Definition at line 108 of file perspective.hpp.

◆ intrinsics

PerspectiveIntrinsics ufo::PerspectiveCamera::intrinsics

The intrinsic parameters of the camera.

Definition at line 100 of file perspective.hpp.

◆ near_clip

float ufo::PerspectiveCamera::near_clip

Distance to the near clipping plane.

Definition at line 104 of file perspective.hpp.

◆ pose

Transform3f ufo::PerspectiveCamera::pose

Camera-to-world pose transform.

Definition at line 96 of file perspective.hpp.


The documentation for this struct was generated from the following file: