FOUND
Loading...
Searching...
No Matches
camera.hpp
1#ifndef SRC_COMMON_SPATIAL_CAMERA_HPP_
2#define SRC_COMMON_SPATIAL_CAMERA_HPP_
3
4#include "common/spatial/attitude-utils.hpp"
5
6#include "common/style.hpp"
7
8namespace found {
9
13
27class Camera {
28 public:
32 Camera(const Camera &) = default;
33
45 Camera(decimal focalLength,
46 int xResolution, int yResolution,
47 decimal xCenter, decimal yCenter,
48 decimal xPixelPitch, decimal yPixelPitch);
49
61 Camera(decimal focalLength, decimal pixelSize, int xResolution, int yResolution);
62
73 Vec2 CameraToPixelCoordinates(const Vec3 &) const;
74
94 Vec3 PixelToImageCoordinates(const Vec2 &) const;
95
96 // TODO: remove this is unecessary just use pre
104 bool InSensor(const Vec2 &vector) const;
105
111 const Mat3& GetCalibrationMatrix() const { return calibrationMatrix_; }
112
119
120 private:
128
129 // TODO: distortion
137 decimal xCenter_;
139 decimal yCenter_;
148};
149
150} // namespace found
151
152#endif // SRC_COMMON_SPATIAL_CAMERA_HPP_
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