1#ifndef SRC_COMMON_SPATIAL_CAMERA_HPP_
2#define SRC_COMMON_SPATIAL_CAMERA_HPP_
4#include "common/spatial/attitude-utils.hpp"
6#include "common/style.hpp"
45 Camera(decimal focalLength,
46 int xResolution,
int yResolution,
47 decimal xCenter, decimal yCenter,
48 decimal xPixelPitch, decimal yPixelPitch);
61 Camera(decimal focalLength, decimal pixelSize,
int xResolution,
int yResolution);
104 bool InSensor(
const Vec2 &vector)
const;
A Camera is a mutable object that represents a pinhole camera.
Definition camera.hpp:27
bool InSensor(const Vec2 &vector) const
Evaluates whether a vector can be seen in the camera.
Definition camera.cpp:59
const Mat3 & GetInverseCalibrationMatrix() const
Expose inverse camera calibration matrix (intrinsic matrix)
Definition camera.hpp:118
int xResolution_
The x resolution (pixels)
Definition camera.hpp:133
decimal yPixelPitch_
The y pixel pitch (m)
Definition camera.hpp:143
decimal xCenter_
The x center (pixels)
Definition camera.hpp:137
const Mat3 & GetCalibrationMatrix() const
Expose camera calibration matrix (intrinsic matrix)
Definition camera.hpp:111
int yResolution_
The y resolution (pixels)
Definition camera.hpp:135
Vec2 CameraToPixelCoordinates(const Vec3 &) const
Uses the pinhole camera model to map a 3D vector in the camera frame to a 2D point in pixel coordinat...
Definition camera.cpp:43
Mat3 calibrationMatrix_
The camera calibration matrix.
Definition camera.hpp:145
decimal focalLength_
The focal length (m)
Definition camera.hpp:131
Camera(const Camera &)=default
Copy Constructor for Camera.
decimal xPixelPitch_
The x pixel pitch (m)
Definition camera.hpp:141
Mat3 initCalibrationMatrix()
Computes and initializes the calibration matrix and the inverse calibration matrix from camera parame...
Definition camera.cpp:31
Mat3 inverseCalibrationMatrix_
The inverse camera calibration matrix.
Definition camera.hpp:147
decimal yCenter_
The y center (pixels)
Definition camera.hpp:139
Vec3 PixelToImageCoordinates(const Vec2 &) const
Maps a 2D point in pixel coordinates (row and column index of image matrix) to a point on the image p...
Definition camera.cpp:54