|
| FisheyeCameraT ()=default |
| Default constructor creating an invalid camera object. More...
|
|
| FisheyeCameraT (const FisheyeCameraT< T > &fisheyeCamera)=default |
| Copy constructor. More...
|
|
template<typename U > |
| FisheyeCameraT (const FisheyeCameraT< U > &fisheyeCamera) |
| Copy constructor for a fisheye camera with difference element data type than T. More...
|
|
| FisheyeCameraT (const unsigned int width, const unsigned int height, const T fovX) |
| Creates a new camera object with known field of view. More...
|
|
| FisheyeCameraT (const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY) |
| Creates a new camera object without distortion parameters. More...
|
|
template<typename TParameter > |
| FisheyeCameraT (const unsigned int width, const unsigned int height, const TParameter focalX, const TParameter focalY, const TParameter principalX, const TParameter principalY, const TParameter *radialDistortion, const TParameter *tangentialDistortion) |
| Creates a new camera object with distortion parameters. More...
|
|
template<typename TParameter > |
| FisheyeCameraT (const unsigned int width, const unsigned int height, const ParameterConfiguration parameterConfiguration, const TParameter *parameters) |
| Creates a new camera object with parameters with specific configuration. More...
|
|
bool | hasDistortionParameters () const |
| Returns whether this camera object has specified distortion parameters. More...
|
|
unsigned int | width () const |
| Returns the width of the camera image. More...
|
|
unsigned int | height () const |
| Returns the height of the camera image. More...
|
|
VectorT2< T > | principalPoint () const |
| Returns the coordinate of the principal point of the camera image in the pixel domain. More...
|
|
T | principalPointX () const |
| Returns the x-value of the principal point of the camera image in the pixel domain. More...
|
|
T | principalPointY () const |
| Returns the y-value of the principal point of the camera image in the pixel domain. More...
|
|
T | focalLengthX () const |
| Returns the horizontal focal length parameter. More...
|
|
T | focalLengthY () const |
| Returns the vertical focal length parameter. More...
|
|
T | inverseFocalLengthX () const |
| Returns the inverse horizontal focal length parameter. More...
|
|
T | inverseFocalLengthY () const |
| Returns the inverse vertical focal length parameter. More...
|
|
const T * | radialDistortion () const |
| Returns the six radial distortion parameters of the camera model. More...
|
|
const T * | tangentialDistortion () const |
| Returns the two tangential distortion parameters of the camera model. More...
|
|
T | fovX () const |
| Returns the field of view in x direction of the camera. More...
|
|
T | fovY () const |
| Returns the field of view in x direction of the camera. More...
|
|
T | fovDiagonal () const |
| Returns the diagonal field of view of the camera. More...
|
|
template<typename TParameter > |
void | copyParameters (unsigned int &width, unsigned int &height, std::vector< TParameter > ¶meters, ParameterConfiguration ¶meterConfiguration) const |
| Copies the parameters of this camera. More...
|
|
bool | isInside (const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const |
| Returns whether a given 2D image point lies inside the camera frame. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | distortNormalized (const VectorT2< T > &undistortedNormalized) const |
| Returns the normalized distorted position of a given undistorted normalized position. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | undistortNormalized (const VectorT2< T > &distortedNormalized) const |
| Returns the normalized undistorted position of a given distorted normalized position. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | projectToImage (const VectorT3< T > &worldObjectPoint) const |
| Projects a 3D object point into the camera's image of the fisheye camera. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &worldObjectPoint) const |
| Projects a 3D object point into the camera's image of the fisheye camera. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldObjectPoint) const |
| Projects a 3D object point to the 2D image plane of the fisheye camera by a given inverted (and flipped) extrinsic camera matrix. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT2< T > | projectToImageIF (const VectorT3< T > &cameraFlippedObjectPoint) const |
| Projects a 3D object point to the 2D image plane of the fisheye camera. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT3< T > | vector (const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const |
| Returns a unit vector (with length 1) starting at the camera's center and intersecting a given 2D point in the image. More...
|
|
template<bool tUseDistortionParameters = true> |
VectorT3< T > | vectorIF (const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const |
| Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane. More...
|
|
template<bool tUseDistortionParameters = true> |
LineT3< T > | ray (const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const |
| Returns a ray starting at the camera's center and intersecting a given 2D point in the image. More...
|
|
template<bool tUseDistortionParameters = true> |
LineT3< T > | ray (const VectorT2< T > &distortedImagePoint) const |
| Returns a ray starting at the camera's center and intersecting a given 2D point in the image. More...
|
|
template<bool tUseDistortionParameters = true> |
void | pointJacobian2x3IF (const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const |
| Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame. More...
|
|
bool | isEqual (const FisheyeCameraT< T > &fisheyeCamera, const T eps=NumericT< T >::eps()) const |
| Returns whether two camera profiles are identical up to a given epsilon. More...
|
|
bool | isValid () const |
| Returns whether this camera is valid. More...
|
|
bool | operator== (const FisheyeCameraT< T > &fisheyeCamera) const |
| Returns whether two fisheye cameras are identical. More...
|
|
bool | operator!= (const FisheyeCameraT< T > &fisheyeCamera) const |
| Returns whether two fisheye cameras are not identical. More...
|
|
FisheyeCameraT< T > & | operator= (const FisheyeCameraT< T > &fisheyeCamera)=default |
| Copy assignment operator. More...
|
|
| operator bool () const |
| Returns whether the camera holds valid parameters. More...
|
|
|
unsigned int | cameraWidth_ = 0u |
| Width of the camera image, in pixel. More...
|
|
unsigned int | cameraHeight_ = 0u |
| Height of the camera image, in pixel. More...
|
|
T | focalLengthX_ = T(0) |
| The horizontal focal length of the camera, with range (0, infinity) More...
|
|
T | focalLengthY_ = T(0) |
| The vertical focal length of the camera, with range (0, infinity) More...
|
|
T | invFocalLengthX_ = T(0) |
| The horizontal inverse focal length of the camera, with range (0, infinity) More...
|
|
T | invFocalLengthY_ = T(0) |
| The vertical inverse focal length of the camera, with range (0, infinity) More...
|
|
T | principalPointX_ = T(0) |
| The horizontal principal point of the camera, in pixels, with range [0, width()) More...
|
|
T | principalPointY_ = T(0) |
| The vertical principal point of the camera, in pixels, with range [0, width()) More...
|
|
bool | hasDistortionParameters_ = false |
| True, if the distortion parameters are defined. More...
|
|
T | radialDistortion_ [6] = {T(0), T(0), T(0), T(0), T(0), T(0)} |
| The six radial distortion parameters. More...
|
|
T | tangentialDistortion_ [2] = {T(0), T(0)} |
| The two tangential distortion parameters. More...
|
|
|
static T | fovX2Y (const T fovX, const T aspectRatio) |
| Calculates the vertical FOV from the horizontal FOV and the aspect ratio of the camera image. More...
|
|
static T | fovY2X (const T fovY, const T aspectRatio) |
| Calculates the horizontal FOV from the vertical FOV and the aspect ratio of the camera image. More...
|
|
static T | fieldOfViewToFocalLength (const unsigned int width, const T fovX) |
| Converts field of view (and width) to the corresponding focal length. More...
|
|
static VectorT2< T > | objectPoint2normalizedImagePoint (const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > &objectPoint) |
| Calculates the normalized image point (the normalized projected object point) for a of given object point with corresponding extrinsic camera matrix. More...
|
|
static VectorT2< T > | objectPoint2normalizedImagePointIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const VectorT3< T > &objectPoint) |
| Calculates the normalized image point (the normalized projected object point) for a given object point with corresponding inverse and flipped extrinsic camera matrix. More...
|
|
static void | objectPoints2normalizedImagePoints (const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, VectorT2< T > *normalizedImagePoints) |
| Calculates the normalized image points (the normalized projected object points) for a set of given object points with corresponding extrinsic camera matrix. More...
|
|
static void | objectPoints2normalizedImagePointsIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, VectorT2< T > *normalizedImagePoints) |
| Calculates the normalized image points (the normalized projected object points) for a set of given object points with corresponding inverse and flipped extrinsic camera matrix. More...
|
|
template<typename U = T> |
static SquareMatrixT3< U > | flipMatrix3 () |
| Returns the 3x3 transformation matrix flipping a transformation around the x-axis by 180 deg. More...
|
|
template<typename U = T> |
static HomogenousMatrixT4< U > | flipMatrix4 () |
| Returns the 4x4 transformation matrix flipping a transformation around the x-axis by 180 deg. More...
|
|
template<typename U = T> |
static QuaternionT< U > | flipQuaternion () |
| Returns the quaternion flipping a rotation around the x-axis by 180 deg. More...
|
|
template<typename U > |
static HomogenousMatrixT4< U > | flippedTransformationLeftSide (const HomogenousMatrixT4< U > &left_T_right) |
| Flips a transformation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static HomogenousMatrixT4< U > | flippedTransformationRightSide (const HomogenousMatrixT4< U > &left_T_right) |
| Flips a transformation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static HomogenousMatrixT4< U > | flippedTransformationLeftAndRightSide (const HomogenousMatrixT4< U > &left_T_right) |
| Flips a transformation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static SquareMatrixT3< U > | flippedTransformationLeftSide (const SquareMatrixT3< U > &left_R_right) |
| Flips a 3x3 rotation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static SquareMatrixT3< U > | flippedTransformationRightSide (const SquareMatrixT3< U > &left_R_right) |
| Flips a 3x3 rotation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static SquareMatrixT3< U > | flippedTransformationLeftAndRightSide (const SquareMatrixT3< U > &left_R_right) |
| Flips a 3x3 rotation matrix around the x-axis by 180 degree. More...
|
|
template<typename U > |
static QuaternionT< U > | flippedTransformationLeftSide (const QuaternionT< U > &left_Q_right) |
| Flips a quaternion around the x-axis by 180 degree. More...
|
|
template<typename U > |
static QuaternionT< U > | flippedTransformationRightSide (const QuaternionT< U > &left_Q_right) |
| Flips a quaternion around the x-axis by 180 degree. More...
|
|
template<typename U > |
static QuaternionT< U > | flippedTransformationLeftAndRightSide (const QuaternionT< U > &left_Q_right) |
| Flips a quaternion around the x-axis by 180 degree. More...
|
|
template<typename U > |
static HomogenousMatrixT4< U > | standard2InvertedFlipped (const HomogenousMatrixT4< U > &world_T_camera) |
| Transforms a standard homogenous 4x4 viewing (extrinsic camera) matrix into an inverted and flipped camera pose. More...
|
|
template<typename U > |
static HomogenousMatricesT4< U > | standard2InvertedFlipped (const HomogenousMatrixT4< U > *world_T_cameras, const size_t number) |
| Transforms standard homogenous 4x4 viewing (extrinsic camera) matrices into an inverted and flipped camera matrices. More...
|
|
template<typename U > |
static void | standard2InvertedFlipped (const HomogenousMatrixT4< U > *world_T_cameras, HomogenousMatrixT4< U > *flippedCameras_T_world, const size_t number) |
| Transforms standard homogenous 4x4 viewing (extrinsic camera) matrices into an inverted and flipped camera matrices. More...
|
|
template<typename U > |
static HomogenousMatricesT4< U > | standard2InvertedFlipped (const HomogenousMatricesT4< U > &world_T_cameras) |
| Transforms standard homogenous 4x4 viewing (extrinsic camera) matrices into an inverted and flipped camera matrices. More...
|
|
template<typename U > |
static SquareMatrixT3< U > | standard2InvertedFlipped (const SquareMatrixT3< U > &world_R_camera) |
| Transforms a standard 3x3 rotation matrix into an inverted and flipped rotation matrix. More...
|
|
template<typename U > |
static QuaternionT< U > | standard2InvertedFlipped (const QuaternionT< U > &world_Q_camera) |
| Transforms a standard rotation quaternion into an inverted and flipped rotation quaternion. More...
|
|
template<typename U > |
static HomogenousMatrixT4< U > | invertedFlipped2Standard (const HomogenousMatrixT4< U > &flippedCamera_T_world) |
| Transforms an inverted and flipped camera pose into a standard camera pose. More...
|
|
template<typename U > |
static HomogenousMatricesT4< U > | invertedFlipped2Standard (const HomogenousMatrixT4< U > *flippedCameras_T_world, const size_t number) |
| Transforms inverted and flipped camera matrices into standard viewing (extrinsic camera) matrices. More...
|
|
template<typename U > |
static void | invertedFlipped2Standard (const HomogenousMatrixT4< U > *flippedCameras_T_world, HomogenousMatrixT4< U > *world_T_cameras, const size_t number) |
| Transforms inverted and flipped camera matrices into standard viewing (extrinsic camera) matrices. More...
|
|
template<typename U > |
static HomogenousMatricesT4< U > | invertedFlipped2Standard (const HomogenousMatricesT4< U > &flippedCameras_T_world) |
| Transforms inverted and flipped camera matrices into standard viewing (extrinsic camera) matrices. More...
|
|
template<typename U > |
static SquareMatrixT3< U > | invertedFlipped2Standard (const SquareMatrixT3< U > &flippedCamera_R_world) |
| Transforms an inverted and flipped rotation matrix into a standard viewing rotation matrix. More...
|
|
template<typename U > |
static QuaternionT< U > | invertedFlipped2Standard (const QuaternionT< U > &flippedCamera_Q_world) |
| Transforms an inverted and flipped rotation quaternion into a standard viewing rotation quaternion. More...
|
|
static bool | isObjectPointInFrontIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint, const T epsilon=NumericT< T >::eps()) |
| Determines whether a given 3D object point lies in front of a camera while the location of the camera is defined by a 6-DOF pose. More...
|
|
static bool | isObjectPointInFrontIF (const SquareMatrixT3< T > &flippedCamera_R_world, const VectorT3< T > &objectPoint, const T epsilon=NumericT< T >::eps()) |
| Determines whether a given 3D object point lies in front of a camera while the location of the camera is defined by a 3-DOF orientation. More...
|
|
template<typename T>
class Ocean::FisheyeCameraT< T >
Class representing a fisheye camera.
The class holds the intrinsic and distortion parameters of a camera.
The camera holds:
1) Width and height of the camera image.
2) Intrinsic camera matrix:
| Fx 0 mx |
| 0 Fy my |
| 0 0 1 |
with mx and my as principal point,
and with Fx = f / sx, Fy = f / sy, with focus f and pixel sizes sx and sy.
3) Six radial distortion parameters k3, k5, k7, k9, k11, k13
4) Two tangential distortion parameters p1 and p2.
An undistorted image point (x, y), is transformed to the corresponding distorted image point (x', y') as follows:
x' = x_r + x_t
y' = y_r + y_t
radial distortion:
x_r = x * (theta + k3 * theta^3 + k5 * theta^5 + k7 * theta^7 + k9 * theta^9 + k11 * theta^11 + k13 * theta^13) / r
y_r = y * (theta + k3 * theta^3 + k5 * theta^5 + k7 * theta^7 + k9 * theta^9 + k11 * theta^11 + k13 * theta^13) / r
tangential distortion:
x_t = p1 * (2 * x_r^2 + radial^2) + p2 * 2 * x_r * y_r,
y_t = p2 * (2 * y_r^2 + radial^2) + p1 * 2 * x_r * y_r.
with
r = sqrt(x^2 + y^2)
theta = atan(r)
radial^2 = x_r^2 + y_r^2
With x, y undistorted normalized coordinates
With x', y' distorted normalized coordinates
- Template Parameters
-
T | The data type of a scalar, 'float' or 'double' |