Ocean
|
Definition of a pinhole camera model. More...
Data Structures | |
class | DistortionLookup |
This class encapsulates a lookup table for camera distortion offsets allowing for faster un-distortion of image points (which is than an approximated position only). More... | |
Public Types | |
enum | OptimizationStrategy { OS_NONE = 0 , OS_FOCAL_LENGTH = 1 , OS_FOCAL_LENGTHS = 2 , OS_INTRINSIC_PARAMETERS = 4 , OS_FOCAL_LENGTHS_DISTORTION = 6 , OS_SYMMETRIC_INTRINSIC_PARAMETERS_DISTORTIONS = 7 , OS_INTRINSIC_PARAMETERS_DISTORTIONS = 8 , OS_DISTORTION = 0x1000 | 4 , OS_INTRINSIC_PARAMETERS_RADIAL_DISTORTION = 0x1000 | 6 } |
Definition of individual optimization strategies for camera parameters. More... | |
typedef T | TScalar |
The scalar data type of this object. More... | |
typedef std::pair< T, T > | DistortionPair |
Definition of a pair of distortion values. More... | |
Public Member Functions | |
PinholeCameraT ()=default | |
Standard constructor. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const PinholeCameraT< T > &camera) | |
Creates a new camera object with specified frame dimension and intrinsic camera parameters best matching to a given reference camera profile with different frame dimension. More... | |
PinholeCameraT (const T subFrameLeft, const T subFrameTop, const unsigned int subFrameWidth, const unsigned int subFrameHeight, const PinholeCameraT< T > &camera) | |
Creates a new sub-frame camera profile based on a camera profile of the entire camera frame. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY) | |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY, const DistortionPair &radial, const DistortionPair &tangential) | |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const T *parameters, const bool radialDistortion=true, const bool tangentialDistortion=true) | |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters. More... | |
PinholeCameraT (const SquareMatrixT3< T > &intrinsic) | |
Creates a new PinholeCameraT<T> object by a given projection matrix with the intrinsic camera parameters. More... | |
PinholeCameraT (const SquareMatrixT3< T > &intrinsic, const unsigned int width, const unsigned int height) | |
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix and width and height of the camera. More... | |
PinholeCameraT (const SquareMatrixT3< T > &intrinsic, const unsigned int width, const unsigned int height, const DistortionPair &radial, const DistortionPair &tangential) | |
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix, the width and height and the radial distortion parameters. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const T fovX) | |
Creates a new PinholeCameraT<T> object by the given width, height and field of view of a camera. More... | |
PinholeCameraT (const unsigned int width, const unsigned int height, const T fovX, const T principalX, const T principalY) | |
Creates a new PinholeCameraT<T> object by the given frame dimensions, the ideal field of view, and the camera's principal point. More... | |
template<typename U > | |
PinholeCameraT (const PinholeCameraT< U > &pinholeCamera, const bool copyDistortionParameters=true) | |
Copy constructor for a pinhole camera with difference element data type than T. More... | |
const SquareMatrixT3< T > & | intrinsic () const |
Returns the intrinsic camera matrix. More... | |
const SquareMatrixT3< T > & | invertedIntrinsic () const |
Returns the inverted intrinsic camera matrix. More... | |
const DistortionPair & | radialDistortion () const |
Returns the pair of radial distortion parameters. More... | |
const DistortionPair & | tangentialDistortion () const |
Returns the pair of tangential distortion parameters. 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... | |
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 | fovXLeft () const |
Returns the left field of view in x direction. More... | |
T | fovXRight () const |
Returns the right field of view in x direction. More... | |
T | fovYTop () const |
Returns the top field of view in y direction. More... | |
T | fovYBottom () const |
Returns the bottom field of view in y direction. More... | |
T | fovDiagonal () const |
Returns the diagonal field of view of the camera. More... | |
bool | rotation (const VectorT2< T > &undistortedPosition, T &angleX, T &angleY) const |
Gets two rotation parameters of the viewing ray for a given undistorted 2D position in the camera image. More... | |
void | copyElements (T *arrayValues, const bool copyRadialDistortion=true, const bool copyTangentialDistortion=true) const |
Copies the elements of this camera to an array with 4 to 8 floating point values. More... | |
bool | setIntrinsic (const SquareMatrixT3< T > &intrinsic) |
Sets the intrinsic camera matrix. More... | |
void | setRadialDistortion (const DistortionPair &radial) |
Sets the radial distortion parameters. More... | |
void | setTangentialDistortion (const DistortionPair &tangential) |
Sets the tangential distortion parameters. More... | |
void | applyZoomFactor (const T relativeZoom) |
Applies a given (relative) zoom factor which mainly multiplies the focal length parameters by the given factor. More... | |
bool | isDistortionPlausible (const T symmetricFocalLengthRatio=T(1.05), const T modelAccuracy=T(0.001), const T symmetricDistortionRatio=T(1.08)) const |
Checks whether the distortion of this camera is plausible. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | undistort (const VectorT2< T > &distorted, const unsigned int iterations=10u, const T zoom=T(1)) const |
Returns the undistorted position of a given distorted position defined in pixel coordinates. More... | |
VectorT2< T > | undistortDamped (const VectorT2< T > &distorted, const T dampingFactor=T(1), const unsigned int iterations=10u, const T zoom=T(1)) const |
Returns the undistorted position of a given distorted position defined in pixel coordinates. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | distort (const VectorT2< T > &undistorted) const |
Returns the distorted position of a given undistorted position defined in pixel coordinates. More... | |
VectorT2< T > | distortDamped (const VectorT2< T > &undistorted, const T dampingFactor=T(1), const T zoom=T(1)) const |
Returns the distorted position of a given undistorted position defined in pixel coordinates. 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... | |
T | calculateAngleBetween (const VectorT2< T > &first, const VectorT2< T > &second) const |
Returns the viewing angle between two undistorted points on the camera's image plane. More... | |
T | calculateCosBetween (const VectorT2< T > &first, const VectorT2< T > &second) const |
Returns the cosine of the viewing angle between two undistorted points on the camera's image plane. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | imagePoint2normalizedImagePoint (const VectorT2< T > &imagePoint, const bool undistortImagePoint) const |
Calculates the normalized image point corresponding to a given (distorted) image point. More... | |
VectorT2< T > | imagePoint2normalizedImagePointDamped (const VectorT2< T > &imagePoint, const bool undistortImagePoint) const |
Calculates the normalized image point corresponding to a given (distorted) image point. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | normalizedImagePoint2imagePoint (const VectorT2< T > &normalizedImagePoint, const bool distortImagePoint) const |
Calculates the image point corresponding to a given normalized image point. More... | |
template<bool tUseBorderDistortionIfOutside> | |
void | normalizedImagePoints2imagePoints (const VectorT2< T > *normalizedImagePoints, const size_t numberNormalizedImagePoints, const bool distortImagePoints, VectorT2< T > *imagePoints) const |
Calculates the image points corresponding to a set of given normalized image points. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &worldObjectPoint, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D object point to the 2D image plane of the camera by a given camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
BoxT2< T > | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const BoxT3< T > &worldObjectBox, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D box to the 2D image plane of the camera by a given camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
TriangleT2< T > | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const TriangleT3< T > &worldObjectTriangle, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D triangle to the 2D image plane of the camera by a given camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
void | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *worldObjectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T zoom=T(1)) const |
Projects a set of 3D object points onto an image plane of the camera by a given camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
LineT2< T > | projectToImage (const HomogenousMatrixT4< T > &world_T_camera, const LineT3< T > &worldLine, const bool distortProjectedLine, const T zoom=T(1)) const |
Projects a 3D line onto an image plane of the camera by a given camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose. More... | |
template<bool tDistortImagePoint, bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldObjectPoint, const T zoom=T(1)) const |
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
BoxT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const BoxT3< T > &worldObjectBox, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D box to the 2D image plane of the camera by a given inverse camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
TriangleT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const TriangleT3< T > &worldObjectTriangle, const bool distortImagePoint, const T zoom=T(1)) const |
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | projectToImageIF (const VectorT2< T > &normalizedObjectPoint, const bool distortImagePoint, const T zoom=T(1)) const |
Transforms a normalized object point (a 3D object point transformed by the inverted and flipped extrinsic camera matrix) into the camera pixel coordinate system. More... | |
template<bool tUseBorderDistortionIfOutside> | |
void | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > *worldObjectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T zoom=T(1)) const |
Projects a set of 3D object points onto an image plane of the camera by a given inverse camera pose. More... | |
template<bool tUseBorderDistortionIfOutside> | |
LineT2< T > | projectToImageIF (const HomogenousMatrixT4< T > &flippedCamera_T_world, const LineT3< T > &worldLine, const bool distortProjectedLine, const T zoom=T(1)) const |
Projects a 3D line onto an image plane of the camera by a given inverse camera pose. More... | |
VectorT2< T > | projectToImageDamped (const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D object point to the 2D image plane of the camera by a given extrinsic camera matrix. More... | |
BoxT2< T > | projectToImageDamped (const HomogenousMatrixT4< T > &extrinsic, const BoxT3< T > &objectBox, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix. More... | |
TriangleT2< T > | projectToImageDamped (const HomogenousMatrixT4< T > &extrinsic, const TriangleT3< T > &objectTriangle, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera matrix. More... | |
void | projectToImageDamped (const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a set of 3D object points onto an image plane of the camera by a given extrinsic camera matrix. More... | |
VectorT2< T > | projectToImageDampedIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D object point to the 2D image plane of the camera by a given inverse extrinsic camera matrix. More... | |
BoxT2< T > | projectToImageDampedIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const BoxT3< T > &objectBox, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix. More... | |
TriangleT2< T > | projectToImageDampedIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const TriangleT3< T > &objectTriangle, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a 3D triangle to the 2D image plane of the camera by a given inverse extrinsic camera matrix. More... | |
void | projectToImageDampedIF (const HomogenousMatrixT4< T > &invertedFlippedExtrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T dampingFactor=T(1), const T zoom=T(1)) const |
Projects a set of 3D object points onto an image plane of the camera by a given inverse extrinsic camera matrix. More... | |
VectorT3< T > | vector (const VectorT2< T > &position, 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... | |
VectorT3< T > | vector (const VectorT2< T > &position, const T zoom, 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... | |
VectorT3< T > | vectorToPlane (const VectorT2< T > &position, const T distance) const |
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane. More... | |
VectorT3< T > | vectorToPlane (const VectorT2< T > &position, const T distance, const T zoom) const |
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane. More... | |
VectorT3< T > | vectorIF (const VectorT2< T > &position, 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... | |
VectorT3< T > | vectorIF (const VectorT2< T > &position, const T zoom, const bool makeUnitVector) 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... | |
LineT3< T > | ray (const VectorT2< T > &position, const HomogenousMatrixT4< T > &world_T_camera, const T zoom=T(1)) const |
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane. More... | |
LineT3< T > | ray (const VectorT2< T > &position, const VectorT3< T > &world_t_camera, const QuaternionT< T > &world_Q_camera, const T zoom=T(1)) const |
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane. More... | |
SquareMatrixT4< T > | frustumMatrix (const T nearDistance, const T farDistance) const |
Returns the 4x4 frustum projection matrix corresponding to this camera. More... | |
HomogenousMatrixT4< T > | transformationMatrixIF (const HomogenousMatrixT4< T > &iFlippedExtrinsic, const T zoom=T(1)) const |
Returns a 4x4 homogenous transformation matrix (corresponding to a 3x4 matrix) that covers an extrinsic (inverted and flipped) camera matrix and the intrinsic projection matrix of this camera object. More... | |
bool | isEqual (const PinholeCameraT< T > &camera, const T eps=NumericT< T >::eps()) const |
Returns whether two camera profiles are identical up to a given epsilon. More... | |
template<typename U , bool tUseDistortionParameters> | |
void | pointJacobian2x3IF (const VectorT3< U > &flippedCameraObjectPoint, U *jx, U *jy) const |
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame. More... | |
bool | isValid () const |
Returns whether this camera is valid. More... | |
bool | operator== (const PinholeCameraT< T > &camera) const |
Returns whether two camera objects are identical up to a small epsilon. More... | |
bool | operator!= (const PinholeCameraT< T > &camera) const |
Returns whether two camera objects are not identical up to a small epsilon. More... | |
operator bool () const | |
Returns whether the camera holds valid parameters. More... | |
Private Member Functions | |
void | calculateInverseIntrinsic () |
Determines the inverse of the intrinsic camera matrix. More... | |
template<bool tUseBorderDistortionIfOutside> | |
VectorT2< T > | distortNormalized (const VectorT2< T > &undistortedNormalized, const T invZoom) const |
Returns the distorted position of a given undistorted normalized position. More... | |
VectorT2< T > | distortNormalizedDamped (const VectorT2< T > &undistortedNormalized, const T dampingFactor, const T invZoom) const |
Returns the distorted position of a given undistorted normalized position. More... | |
VectorT2< T > | dampedNormalized (const VectorT2< T > &normalized, const T dampingFactor, const T invZoom) const |
Determines the damped normalized coordinate for a given normalized coordinate. More... | |
VectorT2< T > | dampedNormalized (const VectorT2< T > &normalized, const T dampingFactor, const T leftNormalizedBorder, const T rightNormalizedBorder, const T topNormalizedBorder, const T bottomNormalizedBorder) const |
Determines the damped normalized coordinate for a given normalized coordinate. More... | |
Private Attributes | |
SquareMatrixT3< T > | intrinsics_ = SquareMatrixT3<T>(false) |
Intrinsic camera matrix. More... | |
SquareMatrixT3< T > | invertedIntrinsics_ = SquareMatrixT3<T>(false) |
Inverted intrinsic camera matrix. More... | |
unsigned int | width_ = 0u |
Width of the camera image (in pixels). More... | |
unsigned int | height_ = 0u |
Height of the camera image (in pixels). More... | |
DistortionPair | radialDistortion_ = DistortionPair(T(0), T(0)) |
Pair of radial distortion parameters for r^2 and r^4. More... | |
DistortionPair | tangentialDistortion_ = DistortionPair(T(0), T(0)) |
Pair of tangential distortion parameters. More... | |
Friends | |
template<typename U > | |
class | PinholeCameraT |
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... | |
Definition of a pinhole camera model.
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) Two radial distortion parameters k1, and k2 for r^2 and r^4: 4) Two tangential distortion parameters p1 and p2. An distortion free (undistorted) image point is transformed to the corresponding distorted image position as follows: x' = x + x * (k1 * r^2 + k2 * r^4) + p1 * 2 * x * y + p2 * (r^2 + 2 * x^2), y' = y + y * (k1 * r^2 + k2 * r^4) + p2 * 2 * x * y + p1 * (r^2 + 2 * y^2). With: Undistorted and normalized image coordinates (x, y) and distorted and normalized image coordinates (x', y'), r^2 is defined by: r^2 = (x^2 + y^2), while r^4 = (x^2 + y^2)^2. The normalized image coordinate is obtained from a 3D object point by application of the perspective division. Normalized image coordinates may be transformed into the pixel coordinate system by applying the focal length and the principal point.
This class provides several distort, undistort or projection functions of image points or object points.
Points lying outside the camera frame, may be distorted or undistorted due to the given position or due to the nearest position lying on the camera frame's border.
The larger the distance to the principal point of the camera, the more irregular the un-/distortion of the distortion model of this camera.
T | The data type of a scalar, 'float' or 'double' |
typedef std::pair<T, T> Ocean::PinholeCameraT< T >::DistortionPair |
Definition of a pair of distortion values.
typedef T Ocean::PinholeCameraT< T >::TScalar |
The scalar data type of this object.
enum Ocean::PinholeCameraT::OptimizationStrategy |
Definition of individual optimization strategies for camera parameters.
|
default |
Standard constructor.
Creates a new PinholeCameraT<T> object with all internal parameters as zero. The resulting camera object is invalid.
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const PinholeCameraT< T > & | camera | ||
) |
Creates a new camera object with specified frame dimension and intrinsic camera parameters best matching to a given reference camera profile with different frame dimension.
Beware: The dimension aspect ratio between the new camera and the given reference camera profile should be almost similar.
width | The width of the camera dimension in pixel, with range [1, infinity) |
height | The height of the camera dimension in pixel, with range [1, infinity) |
camera | The camera profile that is used to adopt the intrinsic (and distortion) parameters |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const T | subFrameLeft, |
const T | subFrameTop, | ||
const unsigned int | subFrameWidth, | ||
const unsigned int | subFrameHeight, | ||
const PinholeCameraT< T > & | camera | ||
) |
Creates a new sub-frame camera profile based on a camera profile of the entire camera frame.
subFrameLeft | The horizontal start position of the sub-frame within the original camera frame, in pixel, with range (-infinity, infinity) |
subFrameTop | The vertical start position of the sub-frame within the original camera frame, in pixel, with range (-infinity, infinity) |
subFrameWidth | The width of the sub-frame in pixel, with range [1, infinity) |
subFrameHeight | The height of the sub-frame in pixel, with range [1, infinity) |
camera | The original camera profile for which a sub-frame camera profile will be created |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const T | focalX, | ||
const T | focalY, | ||
const T | principalX, | ||
const T | principalY | ||
) |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
focalX | The focal parameter of the horizontal axis |
focalY | The focal parameter of the vertical axis |
principalX | The principal point of the horizontal axis (in pixel) |
principalY | The principal point of the vertical axis (in pixel) |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const T | focalX, | ||
const T | focalY, | ||
const T | principalX, | ||
const T | principalY, | ||
const DistortionPair & | radial, | ||
const DistortionPair & | tangential | ||
) |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
focalX | The focal parameter of the horizontal axis |
focalY | The focal parameter of the vertical axis |
principalX | The principal point of the horizontal axis (in pixel) |
principalY | The principal point of the vertical axis (in pixel) |
radial | The pair of radial distortion parameter for r^2 and r^4 |
tangential | The tangential distortion parameters |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const T * | parameters, | ||
const bool | radialDistortion = true , |
||
const bool | tangentialDistortion = true |
||
) |
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
parameters | The four to eight intrinsic and distortion parameters of the camera focalLegnthX(), focalLengthY(), principalPointX(), principalPointY(), radialDistortion().first, radialDistortion().second, tangentialDistortion().first, tangentialDistortion().second |
radialDistortion | True, if parameter[4] and parameter[5] exist and store radial distortion parameters, must be 'True' if tangentialDistortion is 'True' |
tangentialDistortion | True, if parameter[6] and parameter[7] exist and store tangential distortion parameters |
|
explicit |
Creates a new PinholeCameraT<T> object by a given projection matrix with the intrinsic camera parameters.
intrinsic | The matrix with intrinsic camera parameter. |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const SquareMatrixT3< T > & | intrinsic, |
const unsigned int | width, | ||
const unsigned int | height | ||
) |
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix and width and height of the camera.
intrinsic | The intrinsic camera matrix |
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const SquareMatrixT3< T > & | intrinsic, |
const unsigned int | width, | ||
const unsigned int | height, | ||
const DistortionPair & | radial, | ||
const DistortionPair & | tangential | ||
) |
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix, the width and height and the radial distortion parameters.
intrinsic | The intrinsic camera matrix |
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
radial | The radial distortion parameters (r^2 and r^4) |
tangential | The tangential distortion parameters |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const T | fovX | ||
) |
Creates a new PinholeCameraT<T> object by the given width, height and field of view of a camera.
This camera has no radial distortion.
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
fovX | The field of view in x-direction, in radian, with range (0, PI) |
Ocean::PinholeCameraT< T >::PinholeCameraT | ( | const unsigned int | width, |
const unsigned int | height, | ||
const T | fovX, | ||
const T | principalX, | ||
const T | principalY | ||
) |
Creates a new PinholeCameraT<T> object by the given frame dimensions, the ideal field of view, and the camera's principal point.
The provided field of view is expected to be the ideal field of view (if the camera would have a principal point in the perfect center of the image).
This camera has no radial distortion.
width | The width of the camera image, in pixel, with range [1, infinity) |
height | The height of the camera image, in pixel, with range [1, infinity) |
fovX | The camera's ideal field of view in x-direction, in radian, with range (0, PI) |
principalX | The horizontal principal point within the camera frame, in pixel, with range (-infinity, infinity) |
principalY | The vertical principal point within the camera frame, in pixel, with range (-infinity, infinity) |
|
inlineexplicit |
Copy constructor for a pinhole camera with difference element data type than T.
pinholeCamera | The pinhole camera profile to be copied |
copyDistortionParameters | True, to copy the distortion parameters; False, create a new pinhole camera without distortion parameters |
U | The element data type of the given pinhole camera |
void Ocean::PinholeCameraT< T >::applyZoomFactor | ( | const T | relativeZoom | ) |
Applies a given (relative) zoom factor which mainly multiplies the focal length parameters by the given factor.
relativeZoom | The (realtive) zoom factor to apply, with range (0, infinity) |
T Ocean::PinholeCameraT< T >::calculateAngleBetween | ( | const VectorT2< T > & | first, |
const VectorT2< T > & | second | ||
) | const |
Returns the viewing angle between two undistorted points on the camera's image plane.
first | The first undistorted point |
second | The second undistorted point |
T Ocean::PinholeCameraT< T >::calculateCosBetween | ( | const VectorT2< T > & | first, |
const VectorT2< T > & | second | ||
) | const |
Returns the cosine of the viewing angle between two undistorted points on the camera's image plane.
first | The first undistorted point |
second | The second undistorted point |
|
inlineprivate |
Determines the inverse of the intrinsic camera matrix.
This function must be invoked immediately after the intrinsic matrix has changed.
The calculation is identical to the multiplication between the inverted camera matrix and the position vector.
Inverse camera matrix: | 1/Fx 0 -mx/Fx |
| 0 1/Fy -my/Fy |
| 0 0 1 |
void Ocean::PinholeCameraT< T >::copyElements | ( | T * | arrayValues, |
const bool | copyRadialDistortion = true , |
||
const bool | copyTangentialDistortion = true |
||
) | const |
Copies the elements of this camera to an array with 4 to 8 floating point values.
The resulting values are stored in the following order: focalLegnthX(), focalLengthY(), principalPointX(), principalPointY(), radialDistortion().first, radialDistortion().second, tangentialDistortion().first, tangentialDistortion().second.
arrayValues | The array with 4 to 8 floating point values receiving the camera data |
copyRadialDistortion | True, if the array holds at least 6 elements so that the radial parameters will be copied too, must be 'True' if tangentialDistortion is 'True' |
copyTangentialDistortion | True, if the array holds at least 8 elements so that the tangential parameters will be copied too |
|
private |
Determines the damped normalized coordinate for a given normalized coordinate.
The damping is applied to coordinates outside the camera frame.
The damping has an asymptotic pattern so that a damped coordinate never reaches a boundary (specified by the dampingFactor).
normalized | The normalized coordinate for which the damped coordinate will be calculated |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
invZoom | The optional the inverse zoom factor (1/zoom) of the camera, with range (0, infinity), with 1 the default zoom factor |
|
private |
Determines the damped normalized coordinate for a given normalized coordinate.
The damping is applied to coordinates outside the camera frame.
The damping has an asymptotic pattern so that a damped coordinate never reaches a boundary (specified by the dampingFactor).
normalized | The normalized coordinate for which the damped coordinate will be calculated |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
leftNormalizedBorder | The left border of camera frame in normalized coordinates, respecting a possible zoom factor already |
rightNormalizedBorder | The right border of the camera frame in normalized coordinates, respecting a possible zoom factor already |
topNormalizedBorder | The top border of the camera frame in normalized coordinates, respecting a possible zoom factor already |
bottomNormalizedBorder | The bottom border of the camera frame in normalized coordinates, respecting a possible zoom factor already |
VectorT2< T > Ocean::PinholeCameraT< T >::distort | ( | const VectorT2< T > & | undistorted | ) | const |
Returns the distorted position of a given undistorted position defined in pixel coordinates.
The distorted position is calculated by the usage of the internal distortion parameters of this camera object:
dx = x + x * (k1 * r^2 + k2 * r^4) + p1 * 2 * x * y + p2 * (r^2 + 2 * x^2), dy = y + y * (k1 * r^2 + k2 * r^4) + p2 * 2 * x * y + p1 * (r^2 + 2 * y^2).
With (dx, dy) the distorted normalized point coordinates, (x, y) the undistorted normalized point coordinates,
and dcx = Fx * dx + mx, dcy = Fy * dy + my the distorted pixel coordinates.
undistorted | The undistorted position to be distorted in pixel coordinates |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
VectorT2<T> Ocean::PinholeCameraT< T >::distortDamped | ( | const VectorT2< T > & | undistorted, |
const T | dampingFactor = T(1) , |
||
const T | zoom = T(1) |
||
) | const |
Returns the distorted position of a given undistorted position defined in pixel coordinates.
This function applies a damping for the distortion outside the camera frame so that the quadratic and quartic radii do not have such a significant impact.
The damping has an asymptotic pattern and so that distortion is based on normalized coordinates never reaching a specified boundary.
The distorted position is calculated by the usage of the internal distortion parameters of this camera object:
dx = x + x * (k1 * r^2 + k2 * r^4) + p1 * 2 * x * y + p2 * (r^2 + 2 * x^2), dy = y + y * (k1 * r^2 + k2 * r^4) + p2 * 2 * x * y + p1 * (r^2 + 2 * y^2).
With (dx, dy) the distorted normalized point coordinates, (x, y) the undistorted normalized point coordinates,
and dcx = Fx * dx + mx, dcy = Fy * dy + my the distorted pixel coordinates.
undistorted | The undistorted position to be distorted in pixel coordinates |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
private |
Returns the distorted position of a given undistorted normalized position.
The distorted position is calculated by the usage of the internal distortion parameters of this camera object:
x' = x + x * (k1 * r^2 + k2 * r^4) + p1 * 2 * x * y + p2 * (r^2 + 2 * x^2), y' = y + y * (k1 * r^2 + k2 * r^4) + p2 * 2 * x * y + p1 * (r^2 + 2 * y^2).
undistortedNormalized | The undistorted normalized position to be distorted |
invZoom | The optional the inverse zoom factor (1/zoom) of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
private |
Returns the distorted position of a given undistorted normalized position.
This function applies a damping for the distortion outside the camera frame so that the quadratic and quartic radii do not have such a significant impact.
The damping has an asymptotic pattern and so that distortion is based on normalized coordinates never reaching a specified boundary.
The distorted position is calculated by the usage of the internal distortion parameters of this camera object:
dx = x + x * (k1 * r^2 + k2 * r^4) + p1 * 2 * x * y + p2 * (r^2 + 2 * x^2), dy = y + y * (k1 * r^2 + k2 * r^4) + p2 * 2 * x * y + p1 * (r^2 + 2 * y^2).
With (dx, dy) the distorted normalized point coordinates and (x, y) the undistorted normalized point coordinates.
undistortedNormalized | The undistorted normalized position to be distorted |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
invZoom | The optional the inverse zoom factor (1/zoom) of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Returns the horizontal focal length parameter.
|
inline |
Returns the vertical focal length parameter.
T Ocean::PinholeCameraT< T >::fovDiagonal | ( | ) | const |
Returns the diagonal field of view of the camera.
T Ocean::PinholeCameraT< T >::fovX | ( | ) | const |
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.
T Ocean::PinholeCameraT< T >::fovXLeft | ( | ) | const |
Returns the left field of view in x direction.
T Ocean::PinholeCameraT< T >::fovXRight | ( | ) | const |
Returns the right field of view in x direction.
T Ocean::PinholeCameraT< T >::fovY | ( | ) | const |
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.
T Ocean::PinholeCameraT< T >::fovYBottom | ( | ) | const |
Returns the bottom field of view in y direction.
T Ocean::PinholeCameraT< T >::fovYTop | ( | ) | const |
Returns the top field of view in y direction.
SquareMatrixT4<T> Ocean::PinholeCameraT< T >::frustumMatrix | ( | const T | nearDistance, |
const T | farDistance | ||
) | const |
Returns the 4x4 frustum projection matrix corresponding to this camera.
The frustum matrix is defined to point into negative z axis and does not provide any distortion parameters.
nearDistance | The positive distance to the near clipping plane |
farDistance | The positive distance to the far clipping plane |
|
inline |
Returns whether this camera object has specified distortion parameters.
|
inline |
Returns the height of the camera image.
VectorT2< T > Ocean::PinholeCameraT< T >::imagePoint2normalizedImagePoint | ( | const VectorT2< T > & | imagePoint, |
const bool | undistortImagePoint | ||
) | const |
Calculates the normalized image point corresponding to a given (distorted) image point.
imagePoint | The image point (that might be distorted) |
undistortImagePoint | True, to force the un-distortion of the image point using the distortion parameters of this camera object |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Calculates the normalized image point corresponding to a given (distorted) image point.
This function applies a damping for the distortion outside the camera frame so that the quadratic and quartic radii do not have such a significant impact.
imagePoint | The image point (that might be distorted) |
undistortImagePoint | True, to force the un-distortion of the image point using the distortion parameters of this camera object |
|
inline |
Returns the intrinsic camera matrix.
|
inline |
Returns the inverse horizontal focal length parameter.
|
inline |
Returns the inverse vertical focal length parameter.
|
inline |
Returns the inverted intrinsic camera matrix.
bool Ocean::PinholeCameraT< T >::isDistortionPlausible | ( | const T | symmetricFocalLengthRatio = T(1.05) , |
const T | modelAccuracy = T(0.001) , |
||
const T | symmetricDistortionRatio = T(1.08) |
||
) | const |
Checks whether the distortion of this camera is plausible.
The check is based on two individual criteria. First, we check whether we can distort and un-distort the corner points of the camera frame to almost the same position in the camera frame.
Second we check whether the distortion is almost symmetric by checking that the distances between the distorted corner points of the camera frame and the (virtual) center of the camera frame are almost identical.
symmetricFocalLengthRatio | The symmetric tolerance ratio between the horizontal and vertical focal length values of the camera, with range (1, infinity) |
modelAccuracy | The accuracy of the distortion model function, measuring the maximal offset between the distorted position of an undistorted position, in percent of the frame size, with range (0, 1) |
symmetricDistortionRatio | The symmetric tolerance ratio between the camera frame's center and the distorted corner positions in percent, with range (1, infinity) |
bool Ocean::PinholeCameraT< T >::isEqual | ( | const PinholeCameraT< T > & | camera, |
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.
camera | The second camera profile to be used for comparison, can be invalid |
eps | The epsilon threshold to be used, with range [0, infinity) |
|
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.
|
inline |
Returns whether this camera is valid.
VectorT2< T > Ocean::PinholeCameraT< T >::normalizedImagePoint2imagePoint | ( | const VectorT2< T > & | normalizedImagePoint, |
const bool | distortImagePoint | ||
) | const |
Calculates the image point corresponding to a given normalized image point.
normalizedImagePoint | The normalized image point (projected 3D object point without adjustment of focal length and principal point) |
distortImagePoint | True, to force the distortion of the normalized image point using the distortion parameters of this camera object |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
void Ocean::PinholeCameraT< T >::normalizedImagePoints2imagePoints | ( | const VectorT2< T > * | normalizedImagePoints, |
const size_t | numberNormalizedImagePoints, | ||
const bool | distortImagePoints, | ||
VectorT2< T > * | imagePoints | ||
) | const |
Calculates the image points corresponding to a set of given normalized image points.
normalizedImagePoints | The set of normalized image points (projected 3D object points without adjustment of focal length and principal point) |
numberNormalizedImagePoints | The number of normalized image points |
distortImagePoints | True, to force the distortion of the normalized image point using the distortion parameters of this camera object |
imagePoints | The resulting image points, make sure that enough memory is provided |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inlineexplicit |
Returns whether the camera holds valid parameters.
|
inline |
Returns whether two camera objects are not identical up to a small epsilon.
camera | The second camera object |
bool Ocean::PinholeCameraT< T >::operator== | ( | const PinholeCameraT< T > & | camera | ) | const |
Returns whether two camera objects are identical up to a small epsilon.
camera | The second camera object |
|
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)
flippedCameraObjectPoint | The 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). |
jx | The resulting first row of the Jacobian matrix, must contain three elements, must be valid |
jy | The resulting second row of the Jacobian matrix, must contain three elements, must be valid |
U | The data type of the scalar element either 'float' or 'double' |
tUseDistortionParameters | True, to use the camera profile's distortion parameters when calculating the Jacobian; False, to skip the distortion parameters |
|
inline |
Returns the coordinate of the principal point of the camera image in the pixel domain.
|
inline |
Returns the x-value of the principal point of the camera image in the pixel domain.
|
inline |
Returns the y-value of the principal point of the camera image in the pixel domain.
|
inline |
Projects a 3D box to the 2D image plane of the camera by a given camera pose.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Further this function can apply a specific zoom to the intrinsic camera matrix.
world_T_camera | The pose of the camera, must be valid |
worldObjectBox | The 3D box to project, defined in world, must be valid |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a 3D line onto an image plane of the camera by a given camera pose.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Further this function can apply a specific zoom to the intrinsic camera matrix.
world_T_camera | The pose of the camera, must be valid |
worldLine | The 3D line to be projected, defined in world, with unit length direction |
distortProjectedLine | True, to distort the projected 3D line (a very rough approximation only) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a 3D triangle to the 2D image plane of the camera by a given camera pose.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Further this function can apply a specific zoom to the intrinsic camera matrix.
world_T_camera | The pose of the camera, must be valid |
worldObjectTriangle | The 3D triangle to project, defined in world, must be valid |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a 3D object point to the 2D image plane of the camera by a given camera pose.
This function may not apply the distortion parameters if the distortion-free projected image point lies outside the camera image.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Further this function can apply a specific zoom to the intrinsic camera matrix.
world_T_camera | The pose of the camera, must be valid |
worldObjectPoint | The 3D object point to project, defined in world |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a set of 3D object points onto an image plane of the camera by a given camera pose.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Further this function can apply a specific zoom to the intrinsic camera matrix.
world_T_camera | The pose of the camera, must be valid |
worldObjectPoints | The 3D object points to project, defined in world |
numberObjectPoints | The number of object points to project, with range [0, infinity) |
distortImagePoints | True, to force the distortion of the image point using the distortion parameters of this camera object |
imagePoints | The resulting image points, make sure that enough memory is provided |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
extrinsic | The extrinsic camera matrix |
objectBox | The 3D box to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera matrix.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
extrinsic | The extrinsic camera matrix |
objectTriangle | The 3D triangle to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Projects a 3D object point to the 2D image plane of the camera by a given extrinsic camera matrix.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
extrinsic | The extrinsic camera matrix |
objectPoint | The 3D object point to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Projects a set of 3D object points onto an image plane of the camera by a given extrinsic camera matrix.
The extrinsic matrix transforms a 3D point given in camera coordinates into 3D world coordinates.
The viewing direction of the camera is along the negative z-axis.
The extrinsic matrix will be flipped and inverted internally.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
extrinsic | The extrinsic camera matrix |
objectPoints | The set of 3D object points to project |
numberObjectPoints | The number of object points to project |
distortImagePoints | True, to force the distortion of the image point using the distortion parameters of this camera object |
imagePoints | The resulting image points, make sure that enough memory is provided |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
BoxT2<T> Ocean::PinholeCameraT< T >::projectToImageDampedIF | ( | const HomogenousMatrixT4< T > & | iFlippedExtrinsic, |
const BoxT3< T > & | objectBox, | ||
const bool | distortImagePoint, | ||
const T | dampingFactor = T(1) , |
||
const T | zoom = T(1) |
||
) | const |
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
iFlippedExtrinsic | The inverted and flipped extrinsic camera matrix |
objectBox | The 3D box to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
TriangleT2<T> Ocean::PinholeCameraT< T >::projectToImageDampedIF | ( | const HomogenousMatrixT4< T > & | iFlippedExtrinsic, |
const TriangleT3< T > & | objectTriangle, | ||
const bool | distortImagePoint, | ||
const T | dampingFactor = T(1) , |
||
const T | zoom = T(1) |
||
) | const |
Projects a 3D triangle to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
iFlippedExtrinsic | The inverted and flipped extrinsic camera matrix |
objectTriangle | The 3D triangle to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
VectorT2<T> Ocean::PinholeCameraT< T >::projectToImageDampedIF | ( | const HomogenousMatrixT4< T > & | iFlippedExtrinsic, |
const VectorT3< T > & | objectPoint, | ||
const bool | distortImagePoint, | ||
const T | dampingFactor = T(1) , |
||
const T | zoom = T(1) |
||
) | const |
Projects a 3D object point to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
iFlippedExtrinsic | The inverted and flipped extrinsic camera matrix |
objectPoint | The 3D object point to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
void Ocean::PinholeCameraT< T >::projectToImageDampedIF | ( | const HomogenousMatrixT4< T > & | invertedFlippedExtrinsic, |
const VectorT3< T > * | objectPoints, | ||
const size_t | numberObjectPoints, | ||
const bool | distortImagePoints, | ||
VectorT2< T > * | imagePoints, | ||
const T | dampingFactor = T(1) , |
||
const T | zoom = T(1) |
||
) | const |
Projects a set of 3D object points onto an image plane of the camera by a given inverse extrinsic camera matrix.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Object points projecting outside the camera frame will be distorted (if desired) by application of a damping factor.
Further this function can apply a specific zoom to the intrinsic camera matrix.
invertedFlippedExtrinsic | The inverted and flipped extrinsic camera matrix |
objectPoints | The set of 3D object points to project |
numberObjectPoints | The number of object points to project |
distortImagePoints | True, to force the distortion of the image point using the distortion parameters of this camera object |
imagePoints | The resulting image points, make sure that enough memory is provided |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
BoxT2< T > Ocean::PinholeCameraT< T >::projectToImageIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
const BoxT3< T > & | worldObjectBox, | ||
const bool | distortImagePoint, | ||
const T | zoom = T(1) |
||
) | const |
Projects a 3D box to the 2D image plane of the camera by a given inverse camera pose.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
worldObjectBox | The 3D box to project, defined in world, must be valid |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
LineT2< T > Ocean::PinholeCameraT< T >::projectToImageIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
const LineT3< T > & | worldLine, | ||
const bool | distortProjectedLine, | ||
const T | zoom = T(1) |
||
) | const |
Projects a 3D line onto an image plane of the camera by a given inverse camera pose.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
worldLine | The 3D line to be projected, with unit length direction, defined in world, must be valid |
distortProjectedLine | True, to distort the projected 3D line (a very rough approximation only) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
TriangleT2< T > Ocean::PinholeCameraT< T >::projectToImageIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
const TriangleT3< T > & | worldObjectTriangle, | ||
const bool | distortImagePoint, | ||
const T | zoom = T(1) |
||
) | const |
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera pose.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
worldObjectTriangle | The 3D triangle to project, defined in world, must be valid |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
VectorT2< T > Ocean::PinholeCameraT< T >::projectToImageIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
const VectorT3< T > & | objectPoint, | ||
const bool | distortImagePoint, | ||
const T | zoom = T(1) |
||
) | const |
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose.
This function may not apply the distortion parameters if the (default) projected image point lies outside the camera image.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
objectPoint | The 3D object point to project |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
worldObjectPoint | The 3D object point to project, defined in world |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tDistortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
void Ocean::PinholeCameraT< T >::projectToImageIF | ( | const HomogenousMatrixT4< T > & | flippedCamera_T_world, |
const VectorT3< T > * | worldObjectPoints, | ||
const size_t | numberObjectPoints, | ||
const bool | distortImagePoints, | ||
VectorT2< T > * | imagePoints, | ||
const T | zoom = T(1) |
||
) | const |
Projects a set of 3D object points onto an image plane of the camera by a given inverse camera pose.
The inverse extrinsic matrix transforms a 3D point given in world coordinates into 3D camera coordinates.
The coordinate system of the camera is flipped meaning that the viewing direction is along the positive z-axis.
The flipped coordinate system can be received by a rotation around the x-axis by 180 degree.
Further this function can apply a specific zoom to the intrinsic camera matrix.
flippedCamera_T_world | The inverted and flipped extrinsic camera matrix, must be valid |
worldObjectPoints | The 3D object points to project, defined in world |
numberObjectPoints | The number of object points to project, with range [0, infinity) |
distortImagePoints | True, to force the distortion of the image point using the distortion parameters of this camera object |
imagePoints | The resulting image points, make sure that enough memory is provided |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
VectorT2< T > Ocean::PinholeCameraT< T >::projectToImageIF | ( | const VectorT2< T > & | normalizedObjectPoint, |
const bool | distortImagePoint, | ||
const T | zoom = T(1) |
||
) | const |
Transforms a normalized object point (a 3D object point transformed by the inverted and flipped extrinsic camera matrix) into the camera pixel coordinate system.
Further this function can apply a specific zoom to the intrinsic camera matrix.
normalizedObjectPoint | The 2D normalized object point of a 3D object point |
distortImagePoint | True, to force the distortion of the image point using the distortion parameters of this camera object |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
|
inline |
Returns the pair of radial distortion parameters.
|
inline |
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane.
Further this function can apply a specific zoom to the intrinsic camera matrix.
position | The 2D position on the image plane, specified in the pixel domain |
world_T_camera | The pose of the camera, the extrinsic camera matrix, must be valid |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane.
Further this function can apply a specific zoom to the intrinsic camera matrix.
position | The 2D position on the image plane, specified in the pixel domain |
world_t_camera | The translation (position) of the camera pose |
world_Q_camera | The standard rotation quaternion of the camera pose, must be valid |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
bool Ocean::PinholeCameraT< T >::rotation | ( | const VectorT2< T > & | undistortedPosition, |
T & | angleX, | ||
T & | angleY | ||
) | const |
Gets two rotation parameters of the viewing ray for a given undistorted 2D position in the camera image.
undistortedPosition | The undistorted 2D position [in pixel] |
angleX | The horizontal angle for the viewing ray [in radian] |
angleY | The vertical angle for the viewing ray [in radian] |
bool Ocean::PinholeCameraT< T >::setIntrinsic | ( | const SquareMatrixT3< T > & | intrinsic | ) |
Sets the intrinsic camera matrix.
intrinsic | The intrinsic camera matrix |
|
inline |
Sets the radial distortion parameters.
radial | The pair of radial distortion parameters for r^2 and r^4 |
|
inline |
Sets the tangential distortion parameters.
tangential | The pair of tangential distortion parameters |
|
inline |
Returns the pair of tangential distortion parameters.
|
inline |
Returns a 4x4 homogenous transformation matrix (corresponding to a 3x4 matrix) that covers an extrinsic (inverted and flipped) camera matrix and the intrinsic projection matrix of this camera object.
Further this function can apply a specific zoom to the intrinsic camera matrix.
iFlippedExtrinsic | The inverted and flipped extrinsic camera matrix |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
VectorT2< T > Ocean::PinholeCameraT< T >::undistort | ( | const VectorT2< T > & | distorted, |
const unsigned int | iterations = 10u , |
||
const T | zoom = T(1) |
||
) | const |
Returns the undistorted position of a given distorted position defined in pixel coordinates.
Beware: As the camera distortion model can not be inverted numerically, there is no guarantee that a given point can be undistorted for any given camera profile.
distorted | The distorted pixel position to be undistorted |
iterations | The number of iterative calculations, with range [1, 100] |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
tUseBorderDistortionIfOutside | True, to apply the distortion from the nearest point lying on the frame border if the point lies outside the visible camera area; False to apply the distortion from the given position |
VectorT2<T> Ocean::PinholeCameraT< T >::undistortDamped | ( | const VectorT2< T > & | distorted, |
const T | dampingFactor = T(1) , |
||
const unsigned int | iterations = 10u , |
||
const T | zoom = T(1) |
||
) | const |
Returns the undistorted position of a given distorted position defined in pixel coordinates.
Beware: As the camera distortion model can not be inverted numerically, there is no guarantee that a given point can be undistorted for any given camera profile. This function applies a damping for the distortion outside the camera frame so that the quadratic and quartic radii do not have such a significant impact.
distorted | The distorted pixel position to be undistorted |
dampingFactor | The factor defining the boundary of the asymptotic damping behavior for normalized coordinates, with range [0, infinity) |
iterations | The number of iterative calculations, with range [1, 100] |
zoom | The optional zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
|
inline |
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane.
position | The 2D position on the image plane, specified in the pixel domain |
makeUnitVector | True, to return a vector with length 1; False, to return a vector with any length |
Ray determination: with object point (X, Y, Z) and image point (x, y, z) -> (x', y')
x = Fx * X + mx * Z y = Fy * Y + my * Z z = Z
x' = x / z = (Fx * X) / Z + mx y' = y / z = (Fy * Y) / Z + my
Inverse calculation: (x' - mx) / Fx = X / Z (y' - my) / Fy = Y / Z
Using a distance of Z:= 1 results in: X = (x' - mx) / Fx Y = (y' - my) / Fy
The calculation is identical to the multiplication between the inverted camera matrix and the position vector.
Inverse camera matrix: | 1/Fx 0 -mx/Fx |
| 0 1/Fy -my/Fy |
| 0 0 1 |
|
inline |
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane.
Further this function can apply a specific zoom to the intrinsic camera matrix.
position | The 2D position on the image plane, specified in the pixel domain |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
makeUnitVector | True, to return a vector with length 1; False, to return a vector with any length |
Ray determination: with object point (X, Y, Z), zoom s, and image point (x, y, z) -> (x', y')
x = s * Fx * X + mx * Z y = s * Fy * Y + my * Z z = Z
x' = x / z = (s * Fx * X) / Z + mx y' = y / z = (s * Fy * Y) / Z + my
Inverse calculation: (x' - mx) / (s * Fx) = X / Z (y' - my) / (s * Fy) = Y / Z
Using a distance of Z:= 1 results in: X = (x' - mx) / (s * Fx) Y = (y' - my) / (s * Fy)
The calculation is identical to the multiplication between the inverted camera matrix and the position vector.
Inverse camera matrix: | 1/(s Fx) 0 -mx/(s Fx) |
| 0 1/(s Fy) -my/(s Fy) |
| 0 0 1 |
|
inline |
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane.
position | The 2D position on the image plane, specified in the pixel domain |
makeUnitVector | True, to return a vector with length 1; False, to return a vector with any length |
|
inline |
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given 2D point on the image plane.
Further this function can apply a specific zoom to the intrinsic camera matrix.
position | The 2D position on the image plane, specified in the pixel domain |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
makeUnitVector | True, to return a vector with length 1; False, to return a vector with any length |
|
inline |
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane.
The length of the vector is determined so that the vector (exactly) reaches a plane parallel to the image plane.
The plane's normal is parallel to the z-axis while a positive distance locates the plane in the space of the negative z-axis.
position | The 2D position on the image plane, specified in the pixel domain |
distance | The distance between the camera's center and the plane parallel to the image plane, with range (0, infinity) |
Ray determination: with object point (X, Y, Z) and image point (x, y, z) -> (x / z, y / z, 1) -> (x', y')
x = Fx * X + mx * Z y = Fy * Y + my * Z z = Z
x' = x / z = (Fx * X) / Z + mx y' = y / z = (Fy * Y) / Z + my
Inverse calculation: (x' - mx) / Fx = X / Z (y' - my) / Fy = Y / Z
|
inline |
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane.
Further this function can apply a specific zoom to the intrinsic camera matrix.
The length of the vector is determined so that the vector (exactly) reaches a plane parallel to the image plane.
The plane's normal is parallel to the z-axis while a positive distance locates the plane in the space of the negative z-axis.
position | The 2D position on the image plane, specified in the pixel domain |
distance | The distance between the camera's center and the plane parallel to the image plane, with range (0, infinity) |
zoom | The zoom factor of the camera, with range (0, infinity), with 1 the default zoom factor |
Ray determination: with object point (X, Y, Z) and image point (x, y, z) -> (x / z, y / z, 1) -> (x', y')
x = Fx * X + mx * Z y = Fy * Y + my * Z z = Z
x' = x / z = (Fx * X) / Z + mx y' = y / z = (Fy * Y) / Z + my
Inverse calculation: (x' - mx) / Fx = X / Z (y' - my) / Fy = Y / Z
|
inline |
Returns the width of the camera image.
|
private |
Height of the camera image (in pixels).
|
private |
Intrinsic camera matrix.
|
private |
Inverted intrinsic camera matrix.
|
private |
Pair of radial distortion parameters for r^2 and r^4.
|
private |
Pair of tangential distortion parameters.
|
private |
Width of the camera image (in pixels).