A Camera is a mutable object that represents a pinhole camera.
More...
#include <camera.hpp>
|
|
| Camera (const Camera &)=default |
| | Copy Constructor for Camera.
|
| |
| | Camera (decimal focalLength, int xResolution, int yResolution, decimal xCenter, decimal yCenter, decimal xPixelPitch, decimal yPixelPitch) |
| | Creates a Camera object off of real Camera parameters.
|
| |
| | Camera (decimal focalLength, decimal pixelSize, int xResolution, int yResolution) |
| | Creates a Camera object off of ideal Camera parameters.
|
| |
| 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 coordinates (row and column index of image matrix).
|
| |
| 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 plane.
|
| |
| bool | InSensor (const Vec2 &vector) const |
| | Evaluates whether a vector can be seen in the camera.
|
| |
| const Mat3 & | GetCalibrationMatrix () const |
| | Expose camera calibration matrix (intrinsic matrix)
|
| |
| const Mat3 & | GetInverseCalibrationMatrix () const |
| | Expose inverse camera calibration matrix (intrinsic matrix)
|
| |
|
| Mat3 | initCalibrationMatrix () |
| | Computes and initializes the calibration matrix and the inverse calibration matrix from camera parameters.
|
| |
|
|
decimal | focalLength_ |
| | The focal length (m)
|
| |
|
int | xResolution_ |
| | The x resolution (pixels)
|
| |
|
int | yResolution_ |
| | The y resolution (pixels)
|
| |
|
decimal | xCenter_ |
| | The x center (pixels)
|
| |
|
decimal | yCenter_ |
| | The y center (pixels)
|
| |
|
decimal | xPixelPitch_ |
| | The x pixel pitch (m)
|
| |
|
decimal | yPixelPitch_ |
| | The y pixel pitch (m)
|
| |
|
Mat3 | calibrationMatrix_ |
| | The camera calibration matrix.
|
| |
|
Mat3 | inverseCalibrationMatrix_ |
| | The inverse camera calibration matrix.
|
| |
A Camera is a mutable object that represents a pinhole camera.
- Precondition
- Camera dimensions are in SI
- Note
- Follows the convention as laid out in Fundamentals of Space OpNav (Christian, 2026)
- The optical center (hole in pinhole camera model) is located at the origin (0, 0, 0)
- The x-axis points to the right
- The y-axis points down
- The z-axis points along the camera's optical axis (depth)
- The virtual image plane is located at z = 1
- The detector plane is located at z = -focalLength
◆ Camera() [1/2]
| found::Camera::Camera |
( |
decimal |
focalLength, |
|
|
int |
xResolution, |
|
|
int |
yResolution, |
|
|
decimal |
xCenter, |
|
|
decimal |
yCenter, |
|
|
decimal |
xPixelPitch, |
|
|
decimal |
yPixelPitch |
|
) |
| |
Creates a Camera object off of real 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 |
| xCenter,yCenter | The "principal point" of the camera. |
| xPixelPitch | The physical size of a pixel in the x-direction (in meters) |
| yPixelPitch | The physical size of a pixel in the y-direction (in meters) |
◆ Camera() [2/2]
| found::Camera::Camera |
( |
decimal |
focalLength, |
|
|
decimal |
pixelSize, |
|
|
int |
xResolution, |
|
|
int |
yResolution |
|
) |
| |
Creates a Camera object off of ideal Camera parameters.
- Parameters
-
| focalLength | The focal length of the camera |
| pixelSize | The physical size of a pixel (in meters) |
| 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.
◆ CameraToPixelCoordinates()
| Vec2 found::Camera::CameraToPixelCoordinates |
( |
const Vec3 & |
vector | ) |
const |
Uses the pinhole camera model to map a 3D vector in the camera frame to a 2D point in pixel coordinates (row and column index of image matrix).
- 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
- Any vector (x, 0, 0), x > 0, will be projected onto the principal point of the sensor.
◆ GetCalibrationMatrix()
| const Mat3 & found::Camera::GetCalibrationMatrix |
( |
| ) |
const |
|
inline |
Expose camera calibration matrix (intrinsic matrix)
- Returns
- The camera calibration matrix
◆ GetInverseCalibrationMatrix()
| const Mat3 & found::Camera::GetInverseCalibrationMatrix |
( |
| ) |
const |
|
inline |
Expose inverse camera calibration matrix (intrinsic matrix)
- Returns
- The inverse camera calibration matrix
◆ initCalibrationMatrix()
| Mat3 found::Camera::initCalibrationMatrix |
( |
| ) |
|
|
private |
Computes and initializes the calibration matrix and the inverse calibration matrix from camera parameters.
- Returns
- The camera calibration matrix
◆ 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
◆ PixelToImageCoordinates()
| Vec3 found::Camera::PixelToImageCoordinates |
( |
const Vec2 & |
vector | ) |
const |
Maps a 2D point in pixel coordinates (row and column index of image matrix) to a point on the image plane.
This is techinally a mapping from a 2D homogenous vector to another 2D homogenous vector, but the returned vector can be interpreted as a 3D vector where the x-componet, optical axis direction, is equal to 1.
- 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. Assumes that X is the depth direction and that it points normal to the camera sensor in the direction of the scene. Coordinate system: X=out, Y=left, Z=up. This coordinate frame has the distinct advantage that there is an identity rotation into equatorial coordinates when right-ascension, declination, and roll are all zero.
- 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!
The documentation for this class was generated from the following files:
- src/common/spatial/camera.hpp
- src/common/spatial/camera.cpp