LOST
0.0.1
LOST: Open-source Star Tracker
|
A full description of a camera. Enough information to reconstruct the camera matrix and then some. More...
#include <camera.hpp>
Public Member Functions | |
Camera (const Camera &)=default | |
Camera (decimal focalLength, decimal xCenter, decimal yCenter, int xResolution, int yResolution) | |
Camera (decimal focalLength, int xResolution, int yResolution) | |
Vec2 | SpatialToCamera (const Vec3 &) const |
Converts from a 3D point in space to a 2D point on the camera sensor. More... | |
Vec3 | CameraToSpatial (const Vec2 &) const |
Gives a point in 3d space that could correspond to the given vector, using the same coordinate system described for SpatialToCamera. More... | |
bool | InSensor (const Vec2 &vector) const |
Returns whether a given pixel is actually in the camera's field of view. More... | |
int | XResolution () const |
Width of the sensor in pixels. More... | |
int | YResolution () const |
Height of the sensor in pixels. More... | |
decimal | FocalLength () const |
Focal length in pixels. More... | |
decimal | Fov () const |
Horizontal field of view in radians. More... | |
void | SetFocalLength (decimal focalLength) |
A full description of a camera. Enough information to reconstruct the camera matrix and then some.
Definition at line 9 of file camera.hpp.
|
default |
|
inline |
xCenter,yCenter | The "principal point" of the camera. In an ideal camera, just half the resolution, but physical cameras often have a bit of offset. |
Definition at line 16 of file camera.hpp.
|
inline |
Definition at line 23 of file camera.hpp.
Gives a point in 3d space that could correspond to the given vector, using the same coordinate system described for SpatialToCamera.
Not all vectors returned by this function will necessarily have the same magnitude.
Definition at line 35 of file camera.cpp.
|
inline |
Focal length in pixels.
Definition at line 42 of file camera.hpp.
decimal lost::Camera::Fov | ( | ) | const |
Horizontal field of view in radians.
Definition at line 66 of file camera.cpp.
bool lost::Camera::InSensor | ( | const Vec2 & | vector | ) | const |
Returns whether a given pixel is actually in the camera's field of view.
Definition at line 51 of file camera.cpp.
|
inline |
Definition at line 46 of file camera.hpp.
Converts from a 3D point in space to a 2D point on the camera sensor.
Assumes that X is the depth direction and that it points away from the center of the sensor, i.e., any vector (x, 0, 0) will be at (xResolution/2, yResolution/2) on the sensor.
Definition at line 15 of file camera.cpp.
|
inline |
Width of the sensor in pixels.
Definition at line 38 of file camera.hpp.
|
inline |
Height of the sensor in pixels.
Definition at line 40 of file camera.hpp.