LOST  0.0.1
LOST: Open-source Star Tracker
lost::Camera Class Reference

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)
 

Detailed Description

A full description of a camera. Enough information to reconstruct the camera matrix and then some.

Definition at line 9 of file camera.hpp.

Constructor & Destructor Documentation

◆ Camera() [1/3]

lost::Camera::Camera ( const Camera )
default

◆ Camera() [2/3]

lost::Camera::Camera ( decimal  focalLength,
decimal  xCenter,
decimal  yCenter,
int  xResolution,
int  yResolution 
)
inline
Parameters
xCenter,yCenterThe "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.

◆ Camera() [3/3]

lost::Camera::Camera ( decimal  focalLength,
int  xResolution,
int  yResolution 
)
inline

Definition at line 23 of file camera.hpp.

Member Function Documentation

◆ CameraToSpatial()

Vec3 lost::Camera::CameraToSpatial ( const Vec2 vector) const

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.

Returns
A vector in 3d space corresponding to the given vector, with x-component equal to 1
Warning
Other functions rely on the fact that returned vectors are placed one unit away (x-component equal to 1). Don't change this behavior!

Definition at line 35 of file camera.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FocalLength()

decimal lost::Camera::FocalLength ( ) const
inline

Focal length in pixels.

Definition at line 42 of file camera.hpp.

Here is the caller graph for this function:

◆ Fov()

decimal lost::Camera::Fov ( ) const

Horizontal field of view in radians.

Definition at line 66 of file camera.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InSensor()

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.

Here is the caller graph for this function:

◆ SetFocalLength()

void lost::Camera::SetFocalLength ( decimal  focalLength)
inline

Definition at line 46 of file camera.hpp.

◆ SpatialToCamera()

Vec2 lost::Camera::SpatialToCamera ( const Vec3 vector) const

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.

Here is the caller graph for this function:

◆ XResolution()

int lost::Camera::XResolution ( ) const
inline

Width of the sensor in pixels.

Definition at line 38 of file camera.hpp.

Here is the caller graph for this function:

◆ YResolution()

int lost::Camera::YResolution ( ) const
inline

Height of the sensor in pixels.

Definition at line 40 of file camera.hpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: