Ocean
Ocean::AnyCameraT< T > Class Template Referenceabstract

This class implements the abstract base class for all AnyCamera objects. More...

Inheritance diagram for Ocean::AnyCameraT< T >:

Public Types

typedef T TScalar
 The scalar data type of this object. More...
 

Public Member Functions

virtual ~AnyCameraT ()=default
 Destructs the AnyCamera object. More...
 
virtual AnyCameraType anyCameraType () const =0
 Returns the type of this camera. More...
 
virtual std::string name () const =0
 Returns the name of this camera. More...
 
virtual std::unique_ptr< AnyCameraT< T > > clone (const unsigned int width=0u, const unsigned int height=0u) const =0
 Returns a copy of this camera object. More...
 
virtual std::unique_ptr< AnyCameraT< float > > cloneToFloat (const unsigned int width=0u, const unsigned int height=0u) const =0
 Returns a copy of this camera object with float precision. More...
 
virtual std::unique_ptr< AnyCameraT< double > > cloneToDouble (const unsigned int width=0u, const unsigned int height=0u) const =0
 Returns a copy of this camera object with double precision. More...
 
virtual unsigned int width () const =0
 Returns the width of the camera image. More...
 
virtual unsigned int height () const =0
 Returns the height of the camera image. More...
 
virtual VectorT2< T > principalPoint () const =0
 Returns the coordinate of the principal point of the camera image in the pixel domain. More...
 
virtual T principalPointX () const =0
 Returns the x-value of the principal point of the camera image in the pixel domain. More...
 
virtual T principalPointY () const =0
 Returns the y-value of the principal point of the camera image in the pixel domain. More...
 
virtual T focalLengthX () const =0
 Returns the horizontal focal length parameter. More...
 
virtual T focalLengthY () const =0
 Returns the vertical focal length parameter. More...
 
virtual T inverseFocalLengthX () const =0
 Returns the inverse horizontal focal length parameter. More...
 
virtual T inverseFocalLengthY () const =0
 Returns the inverse vertical focal length parameter. More...
 
virtual T fovX () const =0
 Returns the field of view in x direction of the camera. More...
 
virtual T fovY () const =0
 Returns the field of view in x direction of the camera. More...
 
virtual bool isInside (const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const =0
 Returns whether a given 2D image point lies inside the camera frame. More...
 
virtual VectorT2< T > projectToImage (const VectorT3< T > &objectPoint) const =0
 Projects a 3D object point into the camera frame. More...
 
virtual VectorT2< T > projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &objectPoint) const =0
 Projects a 3D object point into the camera frame. More...
 
virtual void projectToImage (const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
 Projects several 3D object points into the camera frame at once. More...
 
virtual void projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
 Projects several 3D object points into the camera frame at once. More...
 
virtual VectorT2< T > projectToImageIF (const VectorT3< T > &objectPoint) const =0
 Projects a 3D object point into the camera frame. More...
 
virtual VectorT2< T > projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint) const =0
 Projects a 3D object point into the camera frame. More...
 
virtual void projectToImageIF (const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
 Projects several 3D object points into the camera frame at once. More...
 
virtual void projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
 Projects several 3D object points into the camera frame at once. More...
 
virtual VectorT3< T > vector (const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const =0
 Returns a vector starting at the camera's center and intersecting a given 2D point in the image. More...
 
virtual void vector (const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const =0
 Determines vectors starting at the camera's center and intersecting given 2D points in the image. More...
 
virtual VectorT3< T > vectorIF (const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const =0
 Returns a vector starting at the camera's center and intersecting a given 2D point in the image. More...
 
virtual void vectorIF (const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const =0
 Returns vectors starting at the camera's center and intersecting a given 2D points in the image. More...
 
virtual LineT3< T > ray (const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const =0
 Returns a ray starting at the camera's center and intersecting a given 2D point in the image. More...
 
virtual LineT3< T > ray (const VectorT2< T > &distortedImagePoint) const =0
 Returns a ray starting at the camera's center and intersecting a given 2D point in the image. More...
 
virtual void pointJacobian2x3IF (const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const =0
 Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame. More...
 
virtual void pointJacobian2nx3IF (const VectorT3< T > *flippedCameraObjectPoints, const size_t numberObjectPoints, T *jacobians) const =0
 Calculates the 2n x 3 jacobian matrix for the 3D object point projection into the camera frame. More...
 
virtual bool isEqual (const AnyCameraT< T > &anyCamera, const T eps=NumericT< T >::eps()) const =0
 Returns whether two camera objects are identical up to a given epsilon. More...
 
virtual bool isValid () const =0
 Returns whether this camera is valid. More...
 
std::shared_ptr< AnyCameraT< float > > convert (const std::shared_ptr< AnyCameraT< double >> &anyCamera)
 
std::shared_ptr< AnyCameraT< double > > convert (const std::shared_ptr< AnyCameraT< float >> &anyCamera)
 

Static Public Member Functions

template<typename U >
static std::shared_ptr< AnyCameraT< T > > convert (const std::shared_ptr< AnyCameraT< U >> &anyCamera)
 Converts an AnyCamera object with arbitrary scalar type to another AnyCamera object with arbitrary scalar type. More...
 
- 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...
 

Protected Member Functions

 AnyCameraT ()=default
 Protected default constructor. More...
 
 AnyCameraT (const AnyCameraT< T > &anyCamera)=default
 Protected copy constructor. More...
 
 AnyCameraT (AnyCameraT< T > &&)=delete
 Disabled move constructor. More...
 
AnyCameraToperator= (const AnyCameraT &)=delete
 Disabled assign operator. More...
 
AnyCameraToperator= (AnyCameraT &&)=delete
 Disabled move operator. More...
 

Detailed Description

template<typename T>
class Ocean::AnyCameraT< T >

This class implements the abstract base class for all AnyCamera objects.

A custom camera object can be implemented by

  • simply deriving a new class from this base class
  • using the helper class AnyCameraWrappingT which helps reducing the implementation effort
    Template Parameters
    TThe data type of a scalar, 'float' or 'double'

Member Typedef Documentation

◆ TScalar

template<typename T >
typedef T Ocean::AnyCameraT< T >::TScalar

The scalar data type of this object.

Constructor & Destructor Documentation

◆ ~AnyCameraT()

template<typename T >
virtual Ocean::AnyCameraT< T >::~AnyCameraT ( )
virtualdefault

Destructs the AnyCamera object.

◆ AnyCameraT() [1/3]

template<typename T >
Ocean::AnyCameraT< T >::AnyCameraT ( )
protecteddefault

Protected default constructor.

◆ AnyCameraT() [2/3]

template<typename T >
Ocean::AnyCameraT< T >::AnyCameraT ( const AnyCameraT< T > &  anyCamera)
protecteddefault

Protected copy constructor.

Parameters
anyCameraThe object to copy

◆ AnyCameraT() [3/3]

template<typename T >
Ocean::AnyCameraT< T >::AnyCameraT ( AnyCameraT< T > &&  )
protecteddelete

Disabled move constructor.

Member Function Documentation

◆ anyCameraType()

template<typename T >
virtual AnyCameraType Ocean::AnyCameraT< T >::anyCameraType ( ) const
pure virtual

Returns the type of this camera.

Returns
The camera's type

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ clone()

template<typename T >
virtual std::unique_ptr<AnyCameraT<T> > Ocean::AnyCameraT< T >::clone ( const unsigned int  width = 0u,
const unsigned int  height = 0u 
) const
pure virtual

Returns a copy of this camera object.

The image resolution of the cloned camera must have the same aspect ratio as the current image resolution.

Parameters
widthThe width of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
heightthe height of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
Returns
New instance of this camera object

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ cloneToDouble()

template<typename T >
virtual std::unique_ptr<AnyCameraT<double> > Ocean::AnyCameraT< T >::cloneToDouble ( const unsigned int  width = 0u,
const unsigned int  height = 0u 
) const
pure virtual

Returns a copy of this camera object with double precision.

The image resolution of the cloned camera must have the same aspect ratio as the current image resolution.

Parameters
widthThe width of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
heightthe height of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
Returns
New instance of this camera object

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ cloneToFloat()

template<typename T >
virtual std::unique_ptr<AnyCameraT<float> > Ocean::AnyCameraT< T >::cloneToFloat ( const unsigned int  width = 0u,
const unsigned int  height = 0u 
) const
pure virtual

Returns a copy of this camera object with float precision.

The image resolution of the cloned camera must have the same aspect ratio as the current image resolution.

Parameters
widthThe width of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
heightthe height of the cloned camera in pixel, with range [1, infinity), 0 to use the current image resolution
Returns
New instance of this camera object

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ convert() [1/3]

std::shared_ptr< AnyCameraT< float > > Ocean::AnyCameraT< float >::convert ( const std::shared_ptr< AnyCameraT< double >> &  anyCamera)
inline

◆ convert() [2/3]

std::shared_ptr< AnyCameraT< double > > Ocean::AnyCameraT< double >::convert ( const std::shared_ptr< AnyCameraT< float >> &  anyCamera)
inline

◆ convert() [3/3]

template<typename T >
template<typename U >
std::shared_ptr< AnyCameraT< T > > Ocean::AnyCameraT< T >::convert ( const std::shared_ptr< AnyCameraT< U >> &  anyCamera)
static

Converts an AnyCamera object with arbitrary scalar type to another AnyCamera object with arbitrary scalar type.

In case both scalar types are identical, the object is simply returned. In case both scalar types are different, a clone is returned.

Parameters
anyCameraThe AnyCamera object to be converted, can be nullptr
Returns
The resulting AnyCamera object
Template Parameters
UThe scalar data type of the given AnyCamera object

◆ focalLengthX()

template<typename T >
virtual T Ocean::AnyCameraT< T >::focalLengthX ( ) const
pure virtual

Returns the horizontal focal length parameter.

Returns
Horizontal focal length parameter in pixel domain, with range (0, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ focalLengthY()

template<typename T >
virtual T Ocean::AnyCameraT< T >::focalLengthY ( ) const
pure virtual

Returns the vertical focal length parameter.

Returns
Vertical focal length parameter in pixel domain, with range (0, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ fovX()

template<typename T >
virtual T Ocean::AnyCameraT< T >::fovX ( ) const
pure virtual

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, 2 * PI]

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ fovY()

template<typename T >
virtual T Ocean::AnyCameraT< T >::fovY ( ) const
pure virtual

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, 2 * PI]

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ height()

template<typename T >
virtual unsigned int Ocean::AnyCameraT< T >::height ( ) const
pure virtual

Returns the height of the camera image.

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

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ inverseFocalLengthX()

template<typename T >
virtual T Ocean::AnyCameraT< T >::inverseFocalLengthX ( ) const
pure virtual

Returns the inverse horizontal focal length parameter.

Returns
Inverse horizontal focal length parameter in pixel domain, with range (0, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ inverseFocalLengthY()

template<typename T >
virtual T Ocean::AnyCameraT< T >::inverseFocalLengthY ( ) const
pure virtual

Returns the inverse vertical focal length parameter.

Returns
Inverse vertical focal length parameter in pixel domain, with range (0, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ isEqual()

template<typename T >
virtual bool Ocean::AnyCameraT< T >::isEqual ( const AnyCameraT< T > &  anyCamera,
const T  eps = NumericT< T >::eps() 
) const
pure virtual

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

The image resolution must always be identical.

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

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ isInside()

template<typename T >
virtual bool Ocean::AnyCameraT< T >::isInside ( const VectorT2< T > &  imagePoint,
const T  signedBorder = T(0) 
) const
pure virtual

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())

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ isValid()

template<typename T >
virtual bool Ocean::AnyCameraT< T >::isValid ( ) const
pure virtual

Returns whether this camera is valid.

Returns
True, if so

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ name()

template<typename T >
virtual std::string Ocean::AnyCameraT< T >::name ( ) const
pure virtual

Returns the name of this camera.

Returns
The camera's name

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ operator=() [1/2]

template<typename T >
AnyCameraT& Ocean::AnyCameraT< T >::operator= ( AnyCameraT< T > &&  )
protecteddelete

Disabled move operator.

Returns
Reference to this object

◆ operator=() [2/2]

template<typename T >
AnyCameraT& Ocean::AnyCameraT< T >::operator= ( const AnyCameraT< T > &  )
protecteddelete

Disabled assign operator.

Returns
Reference to this object

◆ pointJacobian2nx3IF()

template<typename T >
virtual void Ocean::AnyCameraT< T >::pointJacobian2nx3IF ( const VectorT3< T > *  flippedCameraObjectPoints,
const size_t  numberObjectPoints,
T *  jacobians 
) const
pure virtual

Calculates the 2n x 3 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 | <- for object point 0
| dfv / dx, dfv / dy, dfv / dz |
|           ...                |
| dfu / dx, dfu / dy, dfu / dz | <- for object point n - 1
| 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
flippedCameraObjectPointsThe 3D object points defined in relation to the inverted and flipped camera pose (camera looking into the positive z-space with y-axis pointing down).
numberObjectPointsThe number of given 3D object points, with range [1, infinity)
jacobiansThe resulting 2n x 3 Jacobian matrix, with 2 * numberObjectPoints * 3 elements, must be valid
See also
pointJacobian2x3IF().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ pointJacobian2x3IF()

template<typename T >
virtual void Ocean::AnyCameraT< T >::pointJacobian2x3IF ( const VectorT3< T > &  flippedCameraObjectPoint,
T *  jx,
T *  jy 
) const
pure virtual

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
See also
pointJacobian2nx3IF().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ principalPoint()

template<typename T >
virtual VectorT2<T> Ocean::AnyCameraT< T >::principalPoint ( ) const
pure virtual

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 (-infinity, infinity)x(-infinity, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ principalPointX()

template<typename T >
virtual T Ocean::AnyCameraT< T >::principalPointX ( ) const
pure virtual

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 (-infinity, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ principalPointY()

template<typename T >
virtual T Ocean::AnyCameraT< T >::principalPointY ( ) const
pure virtual

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 (-infinity, infinity)

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImage() [1/4]

template<typename T >
virtual VectorT2<T> Ocean::AnyCameraT< T >::projectToImage ( const HomogenousMatrixT4< T > &  world_T_camera,
const VectorT3< T > &  objectPoint 
) const
pure virtual

Projects a 3D object point into the camera frame.

Parameters
world_T_cameraThe camera pose, the default camera is looking into the negative z-space with y-axis up, transforming camera to world, must be valid
objectPointThe 3D object point to project, defined in world
Returns
The projected 2D image point

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImage() [2/4]

template<typename T >
virtual void Ocean::AnyCameraT< T >::projectToImage ( const HomogenousMatrixT4< T > &  world_T_camera,
const VectorT3< T > *  objectPoints,
const size_t  size,
VectorT2< T > *  imagePoints 
) const
pure virtual

Projects several 3D object points into the camera frame at once.

Parameters
world_T_cameraThe camera pose, the default camera is looking into the negative z-space with y-axis up, transforming camera to world, must be valid
objectPointsThe 3D object points to project, defined in world, must be valid
sizeThe number of object points, with range [1, infinity)
imagePointsThe resulting 2D image points, must be valid

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImage() [3/4]

template<typename T >
virtual VectorT2<T> Ocean::AnyCameraT< T >::projectToImage ( const VectorT3< T > &  objectPoint) const
pure virtual

Projects a 3D object point into the camera frame.

The projection is applied with a default camera pose, the camera is looking into the negative z-space with y-axis up.

Parameters
objectPointThe 3D object point to project, defined in world
Returns
The projected 2D image point

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImage() [4/4]

template<typename T >
virtual void Ocean::AnyCameraT< T >::projectToImage ( const VectorT3< T > *  objectPoints,
const size_t  size,
VectorT2< T > *  imagePoints 
) const
pure virtual

Projects several 3D object points into the camera frame at once.

The projection is applied with a default camera pose, the camera is looking into the negative z-space with y-axis up.

Parameters
objectPointsThe 3D object points to project, defined in world, must be valid
sizeThe number of object points, with range [1, infinity)
imagePointsThe resulting 2D image points, must be valid

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImageIF() [1/4]

template<typename T >
virtual VectorT2<T> Ocean::AnyCameraT< T >::projectToImageIF ( const HomogenousMatrixT4< T > &  flippedCamera_T_world,
const VectorT3< T > &  objectPoint 
) const
pure virtual

Projects a 3D object point into the camera frame.

Parameters
flippedCamera_T_worldThe inverted and flipped camera pose, the default camera is looking into the positive z-space with y-axis down, transforming world to flipped camera, must be valid
objectPointThe 3D object point to project, defined in world
Returns
The projected 2D image point

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImageIF() [2/4]

template<typename T >
virtual void Ocean::AnyCameraT< T >::projectToImageIF ( const HomogenousMatrixT4< T > &  flippedCamera_T_world,
const VectorT3< T > *  objectPoints,
const size_t  size,
VectorT2< T > *  imagePoints 
) const
pure virtual

Projects several 3D object points into the camera frame at once.

Parameters
flippedCamera_T_worldThe inverted and flipped camera pose, the default camera is looking into the positive z-space with y-axis down, transforming world to flipped camera, must be valid
objectPointsThe 3D object points to project, defined in world, must be valid
sizeThe number of object points, with range [1, infinity)
imagePointsThe resulting 2D image points, must be valid

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImageIF() [3/4]

template<typename T >
virtual VectorT2<T> Ocean::AnyCameraT< T >::projectToImageIF ( const VectorT3< T > &  objectPoint) const
pure virtual

Projects a 3D object point into the camera frame.

The projection is applied with a default (inverted) and flipped camera pose, the camera is looking into the positive z-space with y-axis down.

Parameters
objectPointThe 3D object point to project, defined in world
Returns
The projected 2D image point

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ projectToImageIF() [4/4]

template<typename T >
virtual void Ocean::AnyCameraT< T >::projectToImageIF ( const VectorT3< T > *  objectPoints,
const size_t  size,
VectorT2< T > *  imagePoints 
) const
pure virtual

Projects several 3D object points into the camera frame at once.

The projection is applied with a default (inverted) and flipped camera pose, the camera is looking into the positive z-space with y-axis down.

Parameters
objectPointsThe 3D object points to project, defined in world, must be valid
sizeThe number of object points, with range [1, infinity)
imagePointsThe resulting 2D image points, must be valid

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ ray() [1/2]

template<typename T >
virtual LineT3<T> Ocean::AnyCameraT< T >::ray ( const VectorT2< T > &  distortedImagePoint) const
pure virtual

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

The ray is determined for a 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())
Returns
The specified ray with direction pointing into the camera's negative z-space
See also
vector().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ ray() [2/2]

template<typename T >
virtual LineT3<T> Ocean::AnyCameraT< T >::ray ( const VectorT2< T > &  distortedImagePoint,
const HomogenousMatrixT4< T > &  world_T_camera 
) const
pure virtual

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

The ray is determined for a 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())
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
See also
vector().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ vector() [1/2]

template<typename T >
virtual VectorT3<T> Ocean::AnyCameraT< T >::vector ( const VectorT2< T > &  distortedImagePoint,
const bool  makeUnitVector = true 
) const
pure virtual

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

The vector is determined for a 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
Vector pointing into the negative z-space
See also
vectorIF(), ray().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ vector() [2/2]

template<typename T >
virtual void Ocean::AnyCameraT< T >::vector ( const VectorT2< T > *  distortedImagePoints,
const size_t  size,
VectorT3< T > *  vectors,
const bool  makeUnitVector = true 
) const
pure virtual

Determines vectors starting at the camera's center and intersecting given 2D points in the image.

The vectors are determined for a default camera looking into the negative z-space with y-axis up.

Parameters
distortedImagePoints2D (distorted) positions within the image, with range [0, width())x[0, height()), must be valid
sizeThe number of provided points, with range [1, infinity)
vectorsThe resulting vectors pointing into the negative z-space, one for each image point, must be valid
makeUnitVectorTrue, to return a vector with length 1; False, to return a vector with any length
See also
vectorIF(), ray().

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ vectorIF() [1/2]

template<typename T >
virtual VectorT3<T> Ocean::AnyCameraT< T >::vectorIF ( const VectorT2< T > &  distortedImagePoint,
const bool  makeUnitVector = true 
) const
pure virtual

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

The vector is determined for a 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
Vector pointing into the positive z-space

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ vectorIF() [2/2]

template<typename T >
virtual void Ocean::AnyCameraT< T >::vectorIF ( const VectorT2< T > *  distortedImagePoints,
const size_t  size,
VectorT3< T > *  vectors,
const bool  makeUnitVector = true 
) const
pure virtual

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

The vectors are determined for a default camera looking into the positive z-space with y-axis down.

Parameters
distortedImagePoints2D (distorted) positions within the image, with range [0, width())x[0, height()), must be valid
sizeThe number of provided points, with range [1, infinity)
vectorsThe resulting vectors pointing into the positive z-space, one for each image point, must be valid
makeUnitVectorTrue, to return a vector with length 1; False, to return a vector with any length

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.

◆ width()

template<typename T >
virtual unsigned int Ocean::AnyCameraT< T >::width ( ) const
pure virtual

Returns the width of the camera image.

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

Implemented in Ocean::AnyCameraWrappingT< T, TCameraWrapper >.


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