Camera

struct Intrinsics

Intrinsics of a camera.

Represents the intrinsic parameters of a camera, which include the focal lengths, optical center coordinates, and image dimensions.

Public Functions

explicit Intrinsics() = default

Default constructor.

explicit Intrinsics(double focal_length_x, double focal_length_y, double optical_center_x, double optical_center_y, size_t width, size_t height)

Construct the intrinsics with the given parameters.

Parameters:
  • focal_length_x – The focal length along the x-axis in pixels.

  • focal_length_y – The focal length along the y-axis in pixels.

  • optical_center_x – The x-coordinate of the optical center in pixels.

  • optical_center_y – The y-coordinate of the optical center in pixels.

  • width – The image width in pixels.

  • height – The image height in pixels.

void save(const std::filesystem::path &file) const

Save an intrinsic calibration to a file.

Eigen::Matrix3d as_matrix() const

Return the intrinsics as a 3x3 matrix.

The matrix is parameterized as: [f_x 0 c_x] [ 0 f_y c_y] [ 0 0 1 ]

Returns:

Eigen::Matrix3d The intrinsics as a 3x3 matrix.

Public Members

double focal_length_x

The focal length along the x-axis [px].

double focal_length_y

The focal length along the y-axis [px].

double optical_center_x

The x-coordinate of the optical center [px].

double optical_center_y

The y-coordinate of the optical center [px].

size_t width

The image width [px].

size_t height

The image height [px].

Public Static Functions

static Intrinsics load_from_file(const std::filesystem::path &file)

Load an intrinsic calibration from a file.

class Camera : public jacobi::Element

Camera element.

The Camera class extends the Element class and includes parameters for the camera model and its intrinsic properties. The class allows for specifying the camera’s model name, its intrinsics, and its position in 3D space.

Public Functions

explicit Camera() = default

Default constructor.

explicit Camera(const std::string &model, const std::string &name, const Frame &origin, const Intrinsics &intrinsics)

Construct a camera with the given model, name, origin, and intrinsics.

Parameters:
  • model – The model name of the camera.

  • name – The unique name of the camera.

  • origin – The pose of the camera.

  • intrinsics – The intrinsic parameters of the camera.

Public Members

std::string model

The model name of the camera.

Intrinsics intrinsics

The camera intrinsics.