#include <camera.hpp>
A Camera is a mutable object that represents a Camera. All camera dimensions are in SI
- Note
- This object contains enough information to reconstruct a Camera Matrix
◆ Camera() [1/3]
found::Camera::Camera |
( |
const Camera & |
| ) |
|
|
default |
◆ Camera() [2/3]
found::Camera::Camera |
( |
decimal |
focalLength, |
|
|
decimal |
xCenter, |
|
|
decimal |
yCenter, |
|
|
int |
xResolution, |
|
|
int |
yResolution |
|
) |
| |
|
inline |
Creates a Camera object off of real Camera parameters
- Parameters
-
focalLength | The focal length of the camera |
xCenter,yCenter | The "principal point" of the camera. |
xResolution | The resolution of the camera in the x-direction |
yResolution | The resolution of the camera in the y-direction |
◆ Camera() [3/3]
found::Camera::Camera |
( |
decimal |
focalLength, |
|
|
int |
xResolution, |
|
|
int |
yResolution |
|
) |
| |
|
inline |
Creates a Camera object off of ideal Camera parameters
- Parameters
-
focalLength | The focal length of the camera |
xResolution | The resolution of the camera in the x-direction |
yResolution | The resolution of the camera in the y-direction |
- Note
- In an ideal camera, the x and y centers are just half the resolution, but physical cameras often have a bit of offset.
◆ CameraToSpatial()
Vec3 found::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.
- Parameters
-
vector | The vector on the camera to convert to a 3D vector |
- Returns
- A vector in 3d space corresponding to the given vector, with x-component equal to 1
- Note
- Not all vectors returned by this function will necessarily have the same magnitude.
- 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!
◆ FocalLength()
decimal found::Camera::FocalLength |
( |
| ) |
const |
|
inline |
Returns the focal length of this camera
- Returns
- The focal length of this
◆ Fov()
decimal found::Camera::Fov |
( |
| ) |
const |
Provides the Field of View (FOV) of this Camera
- Returns
- The FOV of this, in radians
◆ InSensor()
bool found::Camera::InSensor |
( |
const Vec2 & |
vector | ) |
const |
Evaluates whether a vector can be seen in the camera
- Parameters
-
vector | The vector to evaluate |
- Returns
- true iff vector could be seen in this camera
◆ SetFocalLength()
void found::Camera::SetFocalLength |
( |
decimal |
focalLength | ) |
|
|
inline |
Sets the focal length of this
- Parameters
-
focalLength | The focal length to give this camera |
◆ SpatialToCamera()
Vec2 found::Camera::SpatialToCamera |
( |
const Vec3 & |
vector | ) |
const |
Converts from a 3D point in space to a 2D point on the camera sensor.
- Parameters
-
vector | A 3D vector to convert to a vector on the camera |
- Returns
- The 2D Vector that represents the 3D vector on the camera
- Note
- 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.
◆ XResolution()
int found::Camera::XResolution |
( |
| ) |
const |
|
inline |
Returns the X resolution of this camera
- Returns
- the X resolution of this
◆ YResolution()
int found::Camera::YResolution |
( |
| ) |
const |
|
inline |
Returns the Y resolution of this camera
- Returns
- the Y resolution of this
The documentation for this class was generated from the following files: