Ocean
Ocean::FisheyeCameraT< T > Class Template Reference

Class representing a fisheye camera. More...

Inheritance diagram for Ocean::FisheyeCameraT< T >:

Public Types

enum  ParameterConfiguration {
  PC_UNKNOWN , PC_3_PARAMETERS_ONE_FOCAL_LENGTH , PC_4_PARAMETERS , PC_11_PARAMETERS_ONE_FOCAL_LENGTH ,
  PC_12_PARAMETERS
}
 Definition of individual parameter configurations. More...
 
typedef T Type
 Definition of the used data type. More...
 

Public Member Functions

 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...
 
principalPointX () const
 Returns the x-value of the principal point of the camera image in the pixel domain. More...
 
principalPointY () const
 Returns the y-value of the principal point of the camera image in the pixel domain. More...
 
focalLengthX () const
 Returns the horizontal focal length parameter. More...
 
focalLengthY () const
 Returns the vertical focal length parameter. More...
 
inverseFocalLengthX () const
 Returns the inverse horizontal focal length parameter. More...
 
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...
 
fovX () const
 Returns the field of view in x direction of the camera. More...
 
fovY () const
 Returns the field of view in x direction of the camera. More...
 
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 > &parameters, ParameterConfiguration &parameterConfiguration) 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...
 

Protected Member Functions

VectorT2< T > tangentialFreeDistortion (const VectorT2< T > &distortedNormalized) const
 Calculates the tangential-free distortion of a normalized (distorted) image point. More...
 

Static Protected Member Functions

static OCEAN_FORCE_INLINE void jacobianDistortNormalized2x2 (const T x, const T y, const T *radialDistortion, const T *tangentialDistortion, T *jx, T *jy)
 Determines the 2x2 Jacobian of distorting a normalized image point in a fisheye camera with radial and tangential distortion. More...
 

Protected Attributes

unsigned int cameraWidth_ = 0u
 Width of the camera image, in pixel. More...
 
unsigned int cameraHeight_ = 0u
 Height of the camera image, in pixel. More...
 
focalLengthX_ = T(0)
 The horizontal focal length of the camera, with range (0, infinity) More...
 
focalLengthY_ = T(0)
 The vertical focal length of the camera, with range (0, infinity) More...
 
invFocalLengthX_ = T(0)
 The horizontal inverse focal length of the camera, with range (0, infinity) More...
 
invFocalLengthY_ = T(0)
 The vertical inverse focal length of the camera, with range (0, infinity) More...
 
principalPointX_ = T(0)
 The horizontal principal point of the camera, in pixels, with range [0, width()) More...
 
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...
 
radialDistortion_ [6] = {T(0), T(0), T(0), T(0), T(0), T(0)}
 The six radial distortion parameters. More...
 
tangentialDistortion_ [2] = {T(0), T(0)}
 The two tangential distortion parameters. More...
 

Friends

template<typename U >
class FisheyeCameraT
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::CameraT< T >
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...
 

Detailed Description

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
TThe data type of a scalar, 'float' or 'double'

Member Typedef Documentation

◆ Type

template<typename T >
typedef T Ocean::FisheyeCameraT< T >::Type

Definition of the used data type.

Member Enumeration Documentation

◆ ParameterConfiguration

Definition of individual parameter configurations.

Enumerator
PC_UNKNOWN 

An unknown parameter configuration.

PC_3_PARAMETERS_ONE_FOCAL_LENGTH 

3 parameters with order: focal length (one identical value for horizontal and vertical direction), horizontal principal point, vertical principal point

PC_4_PARAMETERS 

4 parameters with order: horizontal focal length, vertical focal length, horizontal principal point, vertical principal point

PC_11_PARAMETERS_ONE_FOCAL_LENGTH 

11 parameters with order: focal length (one identical value for horizontal and vertical direction), horizontal principal point, vertical principal point, six radial distortion parameters k3, k5, k7, k9, k11, k13 two tangential distortion parameters p1, p2

PC_12_PARAMETERS 

12 parameters with order: horizontal focal length, vertical focal length, horizontal principal point, vertical principal point, six radial distortion parameters k3, k5, k7, k9, k11, k13 two tangential distortion parameters p1, p2

Constructor & Destructor Documentation

◆ FisheyeCameraT() [1/7]

template<typename T >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( )
default

Default constructor creating an invalid camera object.

◆ FisheyeCameraT() [2/7]

template<typename T >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( const FisheyeCameraT< T > &  fisheyeCamera)
default

Copy constructor.

Parameters
fisheyeCameraThe fisheye camera profile to be copied

◆ FisheyeCameraT() [3/7]

template<typename T >
template<typename U >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( const FisheyeCameraT< U > &  fisheyeCamera)
inlineexplicit

Copy constructor for a fisheye camera with difference element data type than T.

Parameters
fisheyeCameraThe fisheye camera profile to be copied
Template Parameters
UThe element data type of the given fisheye camera

◆ FisheyeCameraT() [4/7]

template<typename T >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( const unsigned int  width,
const unsigned int  height,
const T  fovX 
)
inline

Creates a new camera object with known field of view.

Parameters
widthThe width of the camera image (in pixel), with range [1, infinity)
heightThe height of the camera image (in pixel), with range [1, infinity)
fovXField of view in x-direction (in radian), with range (0, PI]

◆ FisheyeCameraT() [5/7]

template<typename T >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( const unsigned int  width,
const unsigned int  height,
const T  focalX,
const T  focalY,
const T  principalX,
const T  principalY 
)
inline

Creates a new camera object without distortion parameters.

Parameters
widthThe width of the camera image (in pixel), with range [1, infinity)
heightThe height of the camera image (in pixel), with range [1, infinity)
focalXFocal parameter of the horizontal axis, with range (0, infinity)
focalYFocal parameter of the vertical axis, with range (0, infinity)
principalXPrincipal point of the horizontal axis (in pixel)
principalYPrincipal point of the vertical axis (in pixel)

◆ FisheyeCameraT() [6/7]

template<typename T >
template<typename TParameter >
Ocean::FisheyeCameraT< T >::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 
)
inline

Creates a new camera object with distortion parameters.

Parameters
widthThe width of the camera image (in pixel), with range [1, infinity)
heightThe height of the camera image (in pixel), with range [1, infinity)
focalXFocal parameter of the horizontal axis, with range (0, infinity)
focalYFocal parameter of the vertical axis, with range (0, infinity)
principalXPrincipal point of the horizontal axis (in pixel), with range (0, width)
principalYPrincipal point of the vertical axis (in pixel), with range (0, height)
radialDistortionSix radial distortion values, with order k3, k5, k7, k9, k11, 13, must be valid
tangentialDistortionTwo tangential distortion values, with order p1, p2, must be valid
Template Parameters
TParameterThe scalar data type in which the intrinsic camera parameters are provided, will be converted to 'T' internally, 'float' or 'double'

◆ FisheyeCameraT() [7/7]

template<typename T >
template<typename TParameter >
Ocean::FisheyeCameraT< T >::FisheyeCameraT ( const unsigned int  width,
const unsigned int  height,
const ParameterConfiguration  parameterConfiguration,
const TParameter *  parameters 
)
inline

Creates a new camera object with parameters with specific configuration.

Parameters
widthThe width of the camera image (in pixel), with range [1, infinity)
heightThe height of the camera image (in pixel), with range [1, infinity)
parameterConfigurationThe configuration of the given parameter, must be valid
parametersThe parameters matching with the specific configuration, must be valid
Template Parameters
TParameterThe scalar data type in which the intrinsic camera parameters are provided, will be converted to 'T' internally, 'float' or 'double'

Member Function Documentation

◆ copyParameters()

template<typename T >
template<typename TParameter >
void Ocean::FisheyeCameraT< T >::copyParameters ( unsigned int &  width,
unsigned int &  height,
std::vector< TParameter > &  parameters,
ParameterConfiguration parameterConfiguration 
) const

Copies the parameters of this camera.

Parameters
widthThe resulting width of the camera, in pixel, with range [0, infinity)
heightThe resulting height of the camera, in pixel, with range [0, infinity)
parametersThe resulting parameters of the camera
parameterConfigurationThe resulting configuration of the resulting parameters

◆ distortNormalized()

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< T >::distortNormalized ( const VectorT2< T > &  undistortedNormalized) const

Returns the normalized distorted position of a given undistorted normalized position.

Parameters
undistortedNormalizedUndistorted normalized position to be distorted
Returns
Resulting distorted normalized position
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta

◆ focalLengthX()

template<typename T >
T Ocean::FisheyeCameraT< T >::focalLengthX
inline

Returns the horizontal focal length parameter.

Returns
Horizontal focal length parameter

◆ focalLengthY()

template<typename T >
T Ocean::FisheyeCameraT< T >::focalLengthY
inline

Returns the vertical focal length parameter.

Returns
Vertical focal length parameter

◆ fovDiagonal()

template<typename T >
T Ocean::FisheyeCameraT< T >::fovDiagonal

Returns the diagonal field of view of the camera.

Returns
Diagonal field of view (in radian), with range (0, PI]

◆ fovX()

template<typename T >
T Ocean::FisheyeCameraT< T >::fovX

Returns the field of view in x direction of the camera.

The fov is the sum of the left and right part of the camera.

Returns
Field of view (in radian), with range (0, PI]

x = Fx * X / Z + mx

(x - mx) / Fx = X / Z

◆ fovY()

template<typename T >
T Ocean::FisheyeCameraT< T >::fovY

Returns the field of view in x direction of the camera.

The fov is the sum of the top and bottom part of the camera.

Returns
Field of view (in radian), with range (0, PI)

y = Fy * Y / Z + my

(y - my) / Fy = Y / Z

◆ hasDistortionParameters()

template<typename T >
bool Ocean::FisheyeCameraT< T >::hasDistortionParameters
inline

Returns whether this camera object has specified distortion parameters.

Returns
True, if so

◆ height()

template<typename T >
unsigned int Ocean::FisheyeCameraT< T >::height
inline

Returns the height of the camera image.

Returns
Height of the camera image, in pixel, with range [0, infinity)

◆ inverseFocalLengthX()

template<typename T >
T Ocean::FisheyeCameraT< T >::inverseFocalLengthX
inline

Returns the inverse horizontal focal length parameter.

Returns
Inverse horizontal focal length parameter

◆ inverseFocalLengthY()

template<typename T >
T Ocean::FisheyeCameraT< T >::inverseFocalLengthY
inline

Returns the inverse vertical focal length parameter.

Returns
Inverse vertical focal length parameter

◆ isEqual()

template<typename T >
bool Ocean::FisheyeCameraT< T >::isEqual ( const FisheyeCameraT< T > &  fisheyeCamera,
const T  eps = NumericT<T>::eps() 
) const

Returns whether two camera profiles are identical up to a given epsilon.

The image resolution must always be identical.

Parameters
fisheyeCameraThe second camera profile to be used for comparison, can be invalid
epsThe epsilon threshold to be used, with range [0, infinity)
Returns
True, if so

◆ isInside()

template<typename T >
bool Ocean::FisheyeCameraT< T >::isInside ( const VectorT2< T > &  imagePoint,
const T  signedBorder = T(0) 
) const
inline

Returns whether a given 2D image point lies inside the camera frame.

Optional an explicit border can be defined to allow points slightly outside the camera image, or further inside the image.
Defined a negative border size to allow image points outside the camera frame, or a positive border size to prevent points within the camera frame but close to the boundary.

Parameters
imagePointImage point to be checked, must be valid
signedBorderThe optional border increasing or decreasing the rectangle in which the image point must be located, in pixels, with range (-infinity, std::min(width() / 2, height() / 2)
Returns
True, if the image point lies in the ranges [0, width())x[0, height())

◆ isValid()

template<typename T >
bool Ocean::FisheyeCameraT< T >::isValid
inline

Returns whether this camera is valid.

Returns
True, if so

◆ jacobianDistortNormalized2x2()

template<typename T >
OCEAN_FORCE_INLINE void Ocean::FisheyeCameraT< T >::jacobianDistortNormalized2x2 ( const T  x,
const T  y,
const T *  radialDistortion,
const T *  tangentialDistortion,
T *  jx,
T *  jy 
)
staticprotected

Determines the 2x2 Jacobian of distorting a normalized image point in a fisheye camera with radial and tangential distortion.

The resulting jacobian has the following form:

| dfx / dx, dfx / dy |
| dfy / dx, dfy / dy |
Parameters
xThe horizontal coordinate of the normalized image point to be distorted
yThe vertical coordinate of the normalized image point to be distorted
radialDistortionThe six radial distortion parameters, must be valid
tangentialDistortionThe two radial distortion parameters, must be valid
jxFirst row of the jacobian, with 2 column entries, must be valid
jySecond row of the jacobian, with 2 column entries, must be valid

◆ operator bool()

template<typename T >
Ocean::FisheyeCameraT< T >::operator bool
inlineexplicit

Returns whether the camera holds valid parameters.

Returns
True, if so

◆ operator!=()

template<typename T >
bool Ocean::FisheyeCameraT< T >::operator!= ( const FisheyeCameraT< T > &  fisheyeCamera) const
inline

Returns whether two fisheye cameras are not identical.

Parameters
fisheyeCameraThe second fisheye camera to be check
Returns
True, if so

◆ operator=()

template<typename T >
FisheyeCameraT<T>& Ocean::FisheyeCameraT< T >::operator= ( const FisheyeCameraT< T > &  fisheyeCamera)
default

Copy assignment operator.

Parameters
fisheyeCameraThe fisheye camera profile to be copied
Returns
A reference to this object

◆ operator==()

template<typename T >
bool Ocean::FisheyeCameraT< T >::operator== ( const FisheyeCameraT< T > &  fisheyeCamera) const

Returns whether two fisheye cameras are identical.

Parameters
fisheyeCameraThe second fisheye camera to be check
Returns
True, if so

◆ pointJacobian2x3IF()

template<typename T >
template<bool tUseDistortionParameters>
void Ocean::FisheyeCameraT< T >::pointJacobian2x3IF ( const VectorT3< T > &  flippedCameraObjectPoint,
T *  jx,
T *  jy 
) const
inline

Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.

The resulting jacobian matrix has the following layout:

| dfu / dx, dfu / dy, dfu / dz |
| dfv / dx, dfv / dy, dfv / dz |
with projection function
q = f(p)
q_u = fu(p), q_y = fv(p)
with 2D image point q = (q_u, q_v) and 3D object point p = (x, y, z)
Parameters
flippedCameraObjectPointThe 3D object point defined in relation to the inverted and flipped camera pose (camera looking into the positive z-space with y-axis pointing down).
jxThe resulting first row of the Jacobian matrix, must contain three elements, must be valid
jyThe resulting second row of the Jacobian matrix, must contain three elements, must be valid
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta

◆ principalPoint()

template<typename T >
VectorT2< T > Ocean::FisheyeCameraT< T >::principalPoint
inline

Returns the coordinate of the principal point of the camera image in the pixel domain.

Returns
The 2D location of the principal point, with range [0, width)x[0, height)

◆ principalPointX()

template<typename T >
T Ocean::FisheyeCameraT< T >::principalPointX
inline

Returns the x-value of the principal point of the camera image in the pixel domain.

Returns
x-value of the principal point, with range [0, width)

◆ principalPointY()

template<typename T >
T Ocean::FisheyeCameraT< T >::principalPointY
inline

Returns the y-value of the principal point of the camera image in the pixel domain.

Returns
y-value of the principal point, with range [0, height)

◆ projectToImage() [1/2]

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< T >::projectToImage ( const HomogenousMatrixT4< T > &  world_T_camera,
const VectorT3< T > &  worldObjectPoint 
) const
inline

Projects a 3D object point into the camera's image of the fisheye camera.

The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates (world from camera).
The default viewing direction of the camera is into the negative z-space with x-axis to the right, and y-axis upwards.

Parameters
world_T_cameraThe extrinsic camera matrix, must be valid
worldObjectPoint3D object point which is located in the world
Returns
Resulting 2D image point within the camera frame
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
projectToImageIF().

◆ projectToImage() [2/2]

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< T >::projectToImage ( const VectorT3< T > &  worldObjectPoint) const
inline

Projects a 3D object point into the camera's image of the fisheye camera.

The 3D object point must be defined in relation to the (standard) camera coordinate system.
The default viewing direction of the standard camera is into the negative z-space with x-axis to the right, and y-axis upwards.

Parameters
worldObjectPoint3D object point which is located in the world
Returns
Resulting 2D image point within the camera frame
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
projectToImageIF().

◆ projectToImageIF() [1/2]

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< 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.

The inverted (and flipped) extrinsic matrix transforms a 3D point given in 3D world coordinates into 3D (flipped) camera coordinates (flipped camera from world).
The default viewing direction of the flipped camera is into the positive z-space with x-axis to the right, and y-axis downwards.

Parameters
flippedCamera_T_worldInverted and flipped extrinsic camera matrix, must be valid
worldObjectPoint3D object point which is located in the world
Returns
Resulting 2D image point within the camera frame
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
projectToImage().

◆ projectToImageIF() [2/2]

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< T >::projectToImageIF ( const VectorT3< T > &  cameraFlippedObjectPoint) const

Projects a 3D object point to the 2D image plane of the fisheye camera.

The 3D object point must be defined in relation to the (flipped) camera coordinate system.
The default viewing direction of the flipped camera is into the positive z-space with x-axis to the right, and y-axis downwards.

Parameters
cameraFlippedObjectPoint3D object point which is located in the flipped camera coordinate system
Returns
Resulting 2D image point within the camera frame
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
projectToImage().

◆ radialDistortion()

template<typename T >
const T * Ocean::FisheyeCameraT< T >::radialDistortion
inline

Returns the six radial distortion parameters of the camera model.

Returns
The six radial distortion parameters, with order k3, k5, k7, k9, k11, k13

◆ ray() [1/2]

template<typename T >
template<bool tUseDistortionParameters>
LineT3< T > Ocean::FisheyeCameraT< T >::ray ( const VectorT2< T > &  distortedImagePoint) const
inline

Returns a ray starting at the camera's center and intersecting a given 2D point in the image.

Parameters
distortedImagePoint2D (distorted) position within the image, with range [0, width())x[0, height())
Returns
The specified ray with direction pointing into the camera's negative z-space
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
vector().

◆ ray() [2/2]

template<typename T >
template<bool tUseDistortionParameters>
LineT3< T > Ocean::FisheyeCameraT< T >::ray ( const VectorT2< T > &  distortedImagePoint,
const HomogenousMatrixT4< T > &  world_T_camera 
) const
inline

Returns a ray starting at the camera's center and intersecting a given 2D point in the image.

Parameters
distortedImagePoint2D (distorted) position within the image, with range [0, width())x[0, height())
world_T_cameraThe pose of the camera, the extrinsic camera matrix, must be valid
Returns
The specified ray with direction pointing into the camera's negative z-space
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
vector().

◆ tangentialDistortion()

template<typename T >
const T * Ocean::FisheyeCameraT< T >::tangentialDistortion
inline

Returns the two tangential distortion parameters of the camera model.

Returns
The two tangential distortion parameters, with order p1, p2

◆ tangentialFreeDistortion()

template<typename T >
VectorT2< T > Ocean::FisheyeCameraT< T >::tangentialFreeDistortion ( const VectorT2< T > &  distortedNormalized) const
protected

Calculates the tangential-free distortion of a normalized (distorted) image point.

Parameters
distortedNormalizedThe distorted normalized image point from which the tangential distortion will be removed
Returns
The normalized image point containing radial distortion only

◆ undistortNormalized()

template<typename T >
template<bool tUseDistortionParameters>
VectorT2< T > Ocean::FisheyeCameraT< T >::undistortNormalized ( const VectorT2< T > &  distortedNormalized) const

Returns the normalized undistorted position of a given distorted normalized position.

Parameters
distortedNormalizedDistorted normalized position to be undistorted
Returns
Resulting undistorted normalized position
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta

◆ vector()

template<typename T >
template<bool tUseDistortionParameters>
VectorT3< T > Ocean::FisheyeCameraT< T >::vector ( const VectorT2< T > &  distortedImagePoint,
const bool  makeUnitVector = true 
) const
inline

Returns a unit vector (with length 1) starting at the camera's center and intersecting a given 2D point in the image.

The vector is determined for the default camera looking into the negative z-space with y-axis up.

Parameters
distortedImagePoint2D (distorted) position within the image, with range [0, width())x[0, height())
makeUnitVectorTrue, to return a vector with length 1; False, to return a vector with any length
Returns
Unit vector pointing into the negative z-space
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
vectorIF(), ray().

◆ vectorIF()

template<typename T >
template<bool tUseDistortionParameters>
VectorT3< T > Ocean::FisheyeCameraT< T >::vectorIF ( const VectorT2< T > &  distortedImagePoint,
const bool  makeUnitVector = true 
) const
inline

Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane.

The vector is determined for the default camera looking into the positive z-space with y-axis down.

Parameters
distortedImagePoint2D (distorted) position within the image, with range [0, width())x[0, height())
makeUnitVectorTrue, to return a vector with length 1; False, to return a vector with any length
Returns
Normalized vector into the negative z-space
Template Parameters
tUseDistortionParametersTrue, to use the camera's distortion parameter; False, to just scale the normalized image due to theta
See also
vector().

◆ width()

template<typename T >
unsigned int Ocean::FisheyeCameraT< T >::width
inline

Returns the width of the camera image.

Returns
Width of the camera image, in pixel, with range [0, infinity)

Friends And Related Function Documentation

◆ FisheyeCameraT

template<typename T >
template<typename U >
friend class FisheyeCameraT
friend

Field Documentation

◆ cameraHeight_

template<typename T >
unsigned int Ocean::FisheyeCameraT< T >::cameraHeight_ = 0u
protected

Height of the camera image, in pixel.

◆ cameraWidth_

template<typename T >
unsigned int Ocean::FisheyeCameraT< T >::cameraWidth_ = 0u
protected

Width of the camera image, in pixel.

◆ focalLengthX_

template<typename T >
T Ocean::FisheyeCameraT< T >::focalLengthX_ = T(0)
protected

The horizontal focal length of the camera, with range (0, infinity)

◆ focalLengthY_

template<typename T >
T Ocean::FisheyeCameraT< T >::focalLengthY_ = T(0)
protected

The vertical focal length of the camera, with range (0, infinity)

◆ hasDistortionParameters_

template<typename T >
bool Ocean::FisheyeCameraT< T >::hasDistortionParameters_ = false
protected

True, if the distortion parameters are defined.

◆ invFocalLengthX_

template<typename T >
T Ocean::FisheyeCameraT< T >::invFocalLengthX_ = T(0)
protected

The horizontal inverse focal length of the camera, with range (0, infinity)

◆ invFocalLengthY_

template<typename T >
T Ocean::FisheyeCameraT< T >::invFocalLengthY_ = T(0)
protected

The vertical inverse focal length of the camera, with range (0, infinity)

◆ principalPointX_

template<typename T >
T Ocean::FisheyeCameraT< T >::principalPointX_ = T(0)
protected

The horizontal principal point of the camera, in pixels, with range [0, width())

◆ principalPointY_

template<typename T >
T Ocean::FisheyeCameraT< T >::principalPointY_ = T(0)
protected

The vertical principal point of the camera, in pixels, with range [0, width())

◆ radialDistortion_

template<typename T >
T Ocean::FisheyeCameraT< T >::radialDistortion_[6] = {T(0), T(0), T(0), T(0), T(0), T(0)}
protected

The six radial distortion parameters.

◆ tangentialDistortion_

template<typename T >
T Ocean::FisheyeCameraT< T >::tangentialDistortion_[2] = {T(0), T(0)}
protected

The two tangential distortion parameters.


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