8#ifndef META_OCEAN_MATH_FISHEYE_CAMERA_H
9#define META_OCEAN_MATH_FISHEYE_CAMERA_H
24template <
typename T>
class FisheyeCameraT;
183 template <
typename U>
217 template <
typename TParameter>
228 template <
typename TParameter>
330 template <
typename TParameter>
493 explicit inline operator bool()
const;
559 width_(fisheyeCamera.width_),
560 height_(fisheyeCamera.height_),
561 focalLengthX_(T(fisheyeCamera.focalLengthX_)),
562 focalLengthY_(T(fisheyeCamera.focalLengthY_)),
563 principalPointX_(T(fisheyeCamera.principalPointX_)),
564 principalPointY_(T(fisheyeCamera.principalPointY_)),
565 hasDistortionParameters_(fisheyeCamera.hasDistortionParameters_)
573 for (
unsigned int n = 0
u;
n < 6u; ++
n)
592 hasDistortionParameters_(false)
613 for (
unsigned int n = 0
u;
n < 6u; ++
n)
626 focalLengthX_(focalX),
627 focalLengthY_(focalY),
630 principalPointX_(principalX),
631 principalPointY_(principalY),
632 hasDistortionParameters_(false)
641 for (
unsigned int n = 0
u;
n < 6u; ++
n)
651template <
typename TParameter>
652inline FisheyeCameraT<T>::FisheyeCameraT(
const unsigned int width,
const unsigned int height,
const TParameter focalX,
const TParameter focalY,
const TParameter principalX,
const TParameter principalY,
const TParameter* radialDistortion,
const TParameter* tangentialDistortion) :
655 focalLengthX_(T(focalX)),
656 focalLengthY_(T(focalY)),
659 principalPointX_(T(principalX)),
660 principalPointY_(T(principalY))
662 static_assert((std::is_same<TParameter, float>::value) || (std::is_same<TParameter, double>::value),
"Invalid TParameter, must be 'float' or 'double'!");
669 for (
unsigned int n = 0
u;
n < 6u; ++
n)
686template <
typename TParameter>
696 hasDistortionParameters_(false)
698 static_assert((std::is_same<TParameter, float>::value) || (std::is_same<TParameter, double>::value),
"Invalid TParameter, must be 'float' or 'double'!");
770 ocean_assert(
false &&
"Invalid parameter configuration!");
789 return hasDistortionParameters_;
807 return VectorT2<T>(principalPointX(), principalPointY());
813 return principalPointX_;
819 return principalPointY_;
825 return focalLengthX_;
831 return focalLengthY_;
837 return invFocalLengthX_;
843 return invFocalLengthY_;
849 return radialDistortion_;
855 return tangentialDistortion_;
861 ocean_assert(isValid());
876 if (T(width_) <= principalPointX())
878 ocean_assert(
false &&
"Invalid principal point");
879 return T(2) * leftAngle;
882 const T rightAngle =
NumericT<T>::atan((T(width_) - principalPointX()) * invFocalLengthX_);
884 return leftAngle + rightAngle;
890 ocean_assert(isValid());
905 if (T(height_) <= principalPointY())
907 ocean_assert(
false &&
"Invalid principal point");
908 return T(2) * topAngle;
911 const T bottomAngle =
NumericT<T>::atan((T(height_) - principalPointY()) * invFocalLengthY_);
913 return topAngle + bottomAngle;
919 ocean_assert(isValid());
921 const VectorT2<T> cornerTopLeft(-principalPointX(), -principalPointY());
922 const VectorT2<T> cornerTopRight(T(width_) - principalPointX(), -principalPointY());
923 const VectorT2<T> cornerBottomLeft(-principalPointX(), T(height_) - principalPointY());
924 const VectorT2<T> cornerBottomRight(T(width_) - principalPointX(), T(height_) - principalPointY());
926 const T lengthDiagonalTopLeftBottomRight = cornerTopLeft.
length() + cornerBottomRight.
length();
927 const T lengthDiagonalBottomLeftTopRight = cornerBottomLeft.
length() + cornerTopRight.
length();
929 const T maxDiagonal = std::max(lengthDiagonalTopLeftBottomRight, lengthDiagonalBottomLeftTopRight);
931 const T maxDiagonal_2 = maxDiagonal * T(0.5);
933 const T invFocalLength = (invFocalLengthX_ + invFocalLengthY_) * T(0.5);
939template <
typename TParameter>
949 TParameter(focalLengthX_),
950 TParameter(focalLengthY_),
952 TParameter(principalPointX_),
953 TParameter(principalPointY_),
955 TParameter(radialDistortion_[0]),
956 TParameter(radialDistortion_[1]),
957 TParameter(radialDistortion_[2]),
958 TParameter(radialDistortion_[3]),
959 TParameter(radialDistortion_[4]),
960 TParameter(radialDistortion_[5]),
962 TParameter(tangentialDistortion_[0]),
963 TParameter(tangentialDistortion_[1]),
966 ocean_assert(parameters.size() == 12);
968 parameterConfiguration = PC_12_PARAMETERS;
977 parameterConfiguration = PC_UNKNOWN;
984 ocean_assert(isValid());
985 ocean_assert(signedBorder < T(std::min(width_ / 2u, height_ / 2u)));
987 return imagePoint.
x() >= signedBorder && imagePoint.
y() >= signedBorder
988 && imagePoint.
x() < T(width_) - signedBorder && imagePoint.
y() < T(height_) - signedBorder;
994 ocean_assert(isValid());
1022 const T r2 = undistortedNormalized.
sqr();
1032 if (hasDistortionParameters_)
1034 const T theta2 = theta * theta;
1035 const T theta3 = theta2 * theta;
1036 const T theta5 = theta2 * theta3;
1037 const T theta7 = theta2 * theta5;
1038 const T theta9 = theta2 * theta7;
1039 const T theta11 = theta2 * theta9;
1040 const T theta13 = theta2 * theta11;
1042 const T& k3 = radialDistortion_[0];
1043 const T& k5 = radialDistortion_[1];
1044 const T& k7 = radialDistortion_[2];
1045 const T& k9 = radialDistortion_[3];
1046 const T& k11 = radialDistortion_[4];
1047 const T& k13 = radialDistortion_[5];
1049 const T radialDistortionFactor = (theta + k3 * theta3 + k5 * theta5 + k7 * theta7 + k9 * theta9 + k11 * theta11 + k13 * theta13) / r;
1051 const T x_r = undistortedNormalized.
x() * radialDistortionFactor;
1052 const T y_r = undistortedNormalized.
y() * radialDistortionFactor;
1054 const T radius_r2 = x_r * x_r + y_r * y_r;
1056 const T& p1 = tangentialDistortion_[0];
1057 const T& p2 = tangentialDistortion_[1];
1059 const T x_t = p1 * (T(2) * x_r * x_r + radius_r2) + p2 * T(2) * x_r * y_r;
1060 const T y_t = p2 * (T(2) * y_r * y_r + radius_r2) + p1 * T(2) * x_r * y_r;
1066 const T scale = theta / r;
1068 return VectorT2<T>(undistortedNormalized.
x() * scale, undistortedNormalized.
y() * scale);
1072template <
typename T>
1075 ocean_assert(isValid());
1077 const VectorT2<T> distortedTangentialFree = tangentialFreeDistortion(distortedNormalized);
1079 const T& k3 = radialDistortion_[0];
1080 const T& k5 = radialDistortion_[1];
1081 const T& k7 = radialDistortion_[2];
1082 const T& k9 = radialDistortion_[3];
1083 const T& k11 = radialDistortion_[4];
1084 const T& k13 = radialDistortion_[5];
1086 const T r = distortedTangentialFree.
length();
1095 for (
unsigned int n = 0u; n < 10u; ++n)
1097 const T theta2 = theta * theta;
1098 const T theta4 = theta2 * theta2;
1099 const T theta6 = theta4 * theta2;
1100 const T theta8 = theta6 * theta2;
1101 const T theta10 = theta8 * theta2;
1102 const T theta12 = theta10 * theta2;
1104 const T error = theta * (T(1) + k3 * theta2 + k5 * theta4 + k7 * theta6 + k9 * theta8 + k11 * theta10 + k13 * theta12) - r;
1106 const T df = T(1) + T(3) * k3 * theta2 + T(5) * k5 * theta4 + T(7) * k7 * theta6 + T(9) * k9 * theta8 + T(11) * k11 * theta10 + T(13) * k13 * theta12;
1108 if constexpr (std::is_same_v<T, float>)
1123 const T delta = error / df;
1125 if constexpr (std::is_same_v<T, float>)
1145 return distortedTangentialFree * scale;
1148template <
typename T>
1151 ocean_assert(isValid());
1153 return projectToImageIF(
VectorT3<T>(worldObjectPoint.
x(), -worldObjectPoint.
y(), -worldObjectPoint.
z()));
1156template <
typename T>
1159 ocean_assert(isValid());
1161 ocean_assert(world_T_camera.
isValid());
1165template <
typename T>
1168 ocean_assert(isValid());
1170 ocean_assert(flippedCamera_T_world.
isValid());
1171 return projectToImageIF(flippedCamera_T_world * worldObjectPoint);
1174template <
typename T>
1177 ocean_assert(isValid());
1180 const T invZ = T(1) / cameraFlippedObjectPoint.
z();
1182 const VectorT2<T> undistortedNormalized(cameraFlippedObjectPoint.
x() * invZ, cameraFlippedObjectPoint.
y() * invZ);
1183 const VectorT2<T> distortedNormalizedImagePoint = distortNormalized(undistortedNormalized);
1185 return VectorT2<T>(distortedNormalizedImagePoint.
x() * focalLengthX() + principalPointX(), distortedNormalizedImagePoint.
y() * focalLengthY() + principalPointY());
1188template <
typename T>
1191 ocean_assert(isValid());
1193 const VectorT2<T> distortedNormalized((distortedImagePoint.
x() - principalPointX_) * invFocalLengthX_, (distortedImagePoint.
y() - principalPointY_) * invFocalLengthY_);
1194 const VectorT2<T> undistortedNormalized = undistortNormalized(distortedNormalized);
1202 return VectorT3<T>(undistortedNormalized.
x(), -undistortedNormalized.
y(), T(-1));
1206template <
typename T>
1209 ocean_assert(isValid());
1211 const VectorT2<T> distortedNormalized((distortedImagePoint.
x() - principalPointX_) * invFocalLengthX_, (distortedImagePoint.
y() - principalPointY_) * invFocalLengthY_);
1212 const VectorT2<T> undistortedNormalized = undistortNormalized(distortedNormalized);
1220 return VectorT3<T>(undistortedNormalized.
x(), undistortedNormalized.
y(), T(1));
1224template <
typename T>
1227 ocean_assert(isValid() && world_T_camera.
isValid());
1232template <
typename T>
1235 ocean_assert(isValid());
1240template <
typename T>
1243 ocean_assert(isValid());
1244 ocean_assert(jx !=
nullptr && jy !=
nullptr);
1246 const T fx = focalLengthX();
1247 const T fy = focalLengthY();
1249 const T u = flippedCameraObjectPoint.
x();
1250 const T v = flippedCameraObjectPoint.
y();
1251 const T w = flippedCameraObjectPoint.
z();
1254 const T invW = T(1) / w;
1256 const T u_invW = u * invW;
1257 const T v_invW = v * invW;
1262 jacobianDistortNormalized2x2(u_invW, v_invW, radialDistortion_, tangentialDistortion_, jDistX, jDistY);
1264 const T fx_jDistXx_invW = fx * jDistX[0] * invW;
1265 const T fy_jDistYx_invW = fy * jDistY[0] * invW;
1267 const T fx_jDistXy_invW = fx * jDistX[1] * invW;
1268 const T fy_jDistYy_invW = fy * jDistY[1] * invW;
1270 const T u_fx_jDistXx__ = u_invW * fx_jDistXx_invW + v_invW * fx_jDistXy_invW;
1271 const T u_fy_jDistYx__ = u_invW * fy_jDistYx_invW + v_invW * fy_jDistYy_invW;
1273 jx[0] = fx_jDistXx_invW;
1274 jx[1] = fx_jDistXy_invW;
1275 jx[2] = -u_fx_jDistXx__;
1277 jy[0] = fy_jDistYx_invW;
1278 jy[1] = fy_jDistYy_invW;
1279 jy[2] = -u_fy_jDistYx__;
1282template <
typename T>
1294template <
typename T>
1300 return width_ != 0u && height_ != 0u;
1303template <
typename T>
1306 return width_ == fisheyeCamera.
width_ && height_ == fisheyeCamera.
height_
1311 && memcmp(radialDistortion_, fisheyeCamera.
radialDistortion_,
sizeof(T) * 6) == 0
1315template <
typename T>
1318 return !(*
this == fisheyeCamera);
1321template <
typename T>
1327template <
typename T>
1340 const T& p1 = tangentialDistortion_[0];
1341 const T& p2 = tangentialDistortion_[1];
1345 return distortedNormalized;
1348 VectorT2<T> distortedTangentialFree(distortedNormalized);
1350 for (
unsigned int n = 0u; n < 2u; ++n)
1352 const T& x_r = distortedTangentialFree.
x();
1353 const T& y_r = distortedTangentialFree.
y();
1355 const T resultX = p1 * T(3) * x_r * x_r + p1 * y_r * y_r + T(2) * p2 * x_r * y_r + x_r - distortedNormalized.
x();
1356 const T resultY = p2 * T(3) * y_r * y_r + p2 * x_r * x_r + T(2) * p1 * x_r * y_r + y_r - distortedNormalized.
y();
1358 const T dxx = p1 * T(6) * x_r + T(2) * p2 * y_r + T(1);
1359 const T dxy = p1 * T(2) * y_r + T(2) * p2 * x_r;
1362 const T dyy = p2 * T(6) * y_r + T(2) * p1 * x_r + T(1);
1367 distortedTangentialFree -= delta;
1375 return distortedTangentialFree;
1378template <
typename T>
1381 ocean_assert(jx !=
nullptr && jy !=
nullptr);
1382 ocean_assert(radialDistortion !=
nullptr && tangentialDistortion !=
nullptr);
1384 const T& k3 = radialDistortion[0];
1385 const T& k5 = radialDistortion[1];
1386 const T& k7 = radialDistortion[2];
1387 const T& k9 = radialDistortion[3];
1388 const T& k11 = radialDistortion[4];
1389 const T& k13 = radialDistortion[5];
1391 const T& p1 = tangentialDistortion[0];
1392 const T& p2 = tangentialDistortion[1];
1397 const T xy2 = x2 + y2;
1400 const T r3 = r * r * r;
1404 const T t3 = t2 * t;
1405 const T t4 = t3 * t;
1406 const T t5 = t4 * t;
1407 const T t6 = t5 * t;
1408 const T t7 = t6 * t;
1409 const T t8 = t7 * t;
1410 const T t9 = t8 * t;
1411 const T t10 = t9 * t;
1412 const T t11 = t10 * t;
1413 const T t12 = t11 * t;
1414 const T t13 = t12 * t;
1416 const T term0 = k13 * t13 + k11 * t11 + k9 * t9 + k7 * t7 + k5 * t5 + k3 * t3 + t;
1417 const T term1 = 13 * k13 * t12 + 11 * k11 * t10 + 9 * k9 * t8 + 7 * k7 * t6 + 5 * k5 * t4 + 3 * k3 * t2 + 1;
1419 const T term2 = (xy2 + 1) * term0;
1420 const T term3 = r3 * (xy2 + 1);
1421 const T invTerm3 = T(1) / term3;
1423 const T xDistortion_dx = (xy2 * term2 - x2 * term2 + x2 * r * term1) * invTerm3;
1424 const T xDistortion_dy = (x * term1 * y) / (xy2 * (xy2 + 1)) - (x * y * term0) / r3;
1427 const T& yDistortion_dx = xDistortion_dy;
1428 const T yDistortion_dy = (xy2 * term2 - y2 * term2 + y2 * r * term1) * invTerm3;
1430 const T radialDistortionFactor = term0 / r;
1432 const T rx = x * radialDistortionFactor;
1433 const T ry = y * radialDistortionFactor;
1435 const T xTangential_dx = 6 * p1 * rx + 2 * p2 * ry + 1;
1436 const T xTangential_dy = 2 * p1 * ry + 2 * p2 * rx;
1439 const T& yTangential_dx = xTangential_dy;
1440 const T yTangential_dy = 6 * p2 * ry + 2 * p1 * rx + 1;
1446 jx[0] = xTangential_dx * xDistortion_dx + xTangential_dy * yDistortion_dx;
1447 jx[1] = xTangential_dx * xDistortion_dy + xTangential_dy * yDistortion_dy;
1449 jy[0] = yTangential_dx * xDistortion_dx + yTangential_dy * yDistortion_dx;
1450 jy[1] = yTangential_dx * xDistortion_dy + yTangential_dy * yDistortion_dy;
This class implements the base class for all cameras.
Definition Camera.h:98
bool isValid() const
Returns whether this camera is valid.
Definition FisheyeCamera.h:1295
FisheyeCameraT(const unsigned int width, const unsigned int height, const T fovX)
Creates a new camera object with known field of view.
Definition FisheyeCamera.h:583
const T * radialDistortion() const
Returns the six radial distortion parameters of the camera model.
Definition FisheyeCamera.h:847
T invFocalLengthX_
The horizontal inverse focal length of the camera, with range (0, infinity)
Definition FisheyeCamera.h:535
VectorT2< T > undistortNormalized(const VectorT2< T > &distortedNormalized) const
Returns the normalized undistorted position of a given distorted normalized position.
Definition FisheyeCamera.h:1073
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition FisheyeCamera.h:811
bool operator!=(const FisheyeCameraT< T > &fisheyeCamera) const
Returns whether two fisheye cameras are not identical.
Definition FisheyeCamera.h:1316
FisheyeCameraT(const FisheyeCameraT< T > &fisheyeCamera)=default
Copy constructor.
unsigned int height() const
Returns the height of the camera image.
Definition FisheyeCamera.h:799
void pointJacobian2x3IF(const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.
Definition FisheyeCamera.h:1241
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition FisheyeCamera.h:805
unsigned int height_
Height of the camera image, in pixel.
Definition FisheyeCamera.h:526
FisheyeCameraT(const unsigned int width, const unsigned int height, const ParameterConfiguration parameterConfiguration, const TParameter *parameters)
Creates a new camera object with parameters with specific configuration.
Definition FisheyeCamera.h:687
VectorT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &worldObjectPoint) const
Projects a 3D object point into the camera's image of the fisheye camera.
Definition FisheyeCamera.h:1157
T fovY() const
Returns the field of view in x direction of the camera.
Definition FisheyeCamera.h:888
VectorT2< T > projectToImageIF(const VectorT3< T > &cameraFlippedObjectPoint) const
Projects a 3D object point to the 2D image plane of the fisheye camera.
Definition FisheyeCamera.h:1175
T Type
Definition of the used data type.
Definition FisheyeCamera.h:114
const T * tangentialDistortion() const
Returns the two tangential distortion parameters of the camera model.
Definition FisheyeCamera.h:853
T focalLengthY_
The vertical focal length of the camera, with range (0, infinity)
Definition FisheyeCamera.h:532
T principalPointX_
The horizontal principal point of the camera, in pixels, with range [0, width())
Definition FisheyeCamera.h:541
T fovX() const
Returns the field of view in x direction of the camera.
Definition FisheyeCamera.h:859
friend class FisheyeCameraT
Definition FisheyeCamera.h:107
VectorT2< T > projectToImage(const VectorT3< T > &worldObjectPoint) const
Projects a 3D object point into the camera's image of the fisheye camera.
Definition FisheyeCamera.h:1149
VectorT3< T > vector(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition FisheyeCamera.h:1189
T focalLengthX_
The horizontal focal length of the camera, with range (0, infinity)
Definition FisheyeCamera.h:529
T radialDistortion_[6]
The six radial distortion parameters.
Definition FisheyeCamera.h:550
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition FisheyeCamera.h:835
bool hasDistortionParameters() const
Returns whether this camera object has specified distortion parameters.
Definition FisheyeCamera.h:787
T tangentialDistortion_[2]
The two tangential distortion parameters.
Definition FisheyeCamera.h:553
T principalPointY_
The vertical principal point of the camera, in pixels, with range [0, height())
Definition FisheyeCamera.h:544
T invFocalLengthY_
The vertical inverse focal length of the camera, with range (0, infinity)
Definition FisheyeCamera.h:538
bool operator==(const FisheyeCameraT< T > &fisheyeCamera) const
Returns whether two fisheye cameras are identical.
Definition FisheyeCamera.h:1304
FisheyeCameraT(const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY)
Creates a new camera object without distortion parameters.
Definition FisheyeCamera.h:623
unsigned int width_
Width of the camera image, in pixel.
Definition FisheyeCamera.h:523
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition FisheyeCamera.h:823
void copyParameters(unsigned int &width, unsigned int &height, std::vector< TParameter > ¶meters, ParameterConfiguration ¶meterConfiguration) const
Copies the parameters of this camera.
Definition FisheyeCamera.h:940
FisheyeCameraT(const unsigned int width, const unsigned int height, const TParameter focalX, const TParameter focalY, const TParameter principalX, const TParameter principalY, const TParameter *radialDistortion, const TParameter *tangentialDistortion)
Creates a new camera object with distortion parameters.
Definition FisheyeCamera.h:652
FisheyeCameraT< T > & operator=(const FisheyeCameraT< T > &fisheyeCamera)=default
Copy assignment operator.
FisheyeCameraT()=default
Default constructor creating an invalid camera object.
VectorT2< T > distortNormalized(const VectorT2< T > &undistortedNormalized) const
Returns the normalized distorted position of a given undistorted normalized position.
Definition FisheyeCamera.h:992
ParameterConfiguration
Definition of individual parameter configurations.
Definition FisheyeCamera.h:120
@ PC_12_PARAMETERS
12 parameters with order: horizontal focal length, vertical focal length, horizontal principal point,...
Definition FisheyeCamera.h:162
@ PC_11_PARAMETERS_ONE_FOCAL_LENGTH
11 parameters with order: focal length (one identical value for horizontal and vertical direction),...
Definition FisheyeCamera.h:151
@ PC_3_PARAMETERS_ONE_FOCAL_LENGTH
3 parameters with order: focal length (one identical value for horizontal and vertical direction),...
Definition FisheyeCamera.h:132
@ PC_4_PARAMETERS
4 parameters with order: horizontal focal length, vertical focal length, horizontal principal point,...
Definition FisheyeCamera.h:141
@ PC_UNKNOWN
An unknown parameter configuration.
Definition FisheyeCamera.h:124
bool isEqual(const FisheyeCameraT< T > &fisheyeCamera, const T eps=NumericT< T >::eps()) const
Returns whether two camera profiles are identical up to a given epsilon.
Definition FisheyeCamera.h:1283
unsigned int width() const
Returns the width of the camera image.
Definition FisheyeCamera.h:793
T fovDiagonal() const
Returns the diagonal field of view of the camera.
Definition FisheyeCamera.h:917
T focalLengthY() const
Returns the vertical focal length parameter.
Definition FisheyeCamera.h:829
LineT3< T > ray(const VectorT2< T > &distortedImagePoint) const
Returns a ray starting at the camera's center and intersecting a given 2D point in the image.
Definition FisheyeCamera.h:1233
static OCEAN_FORCE_INLINE void jacobianDistortNormalized2x2(const T x, const T y, const T *radialDistortion, const T *tangentialDistortion, T *jx, T *jy)
Determines the 2x2 Jacobian of distorting a normalized image point in a fisheye camera with radial an...
Definition FisheyeCamera.h:1379
VectorT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldObjectPoint) const
Projects a 3D object point to the 2D image plane of the fisheye camera by a given inverted (and flipp...
Definition FisheyeCamera.h:1166
FisheyeCameraT(const FisheyeCameraT< U > &fisheyeCamera)
Copy constructor for a fisheye camera with difference element data type than T.
Definition FisheyeCamera.h:558
bool hasDistortionParameters_
True, if the distortion parameters are defined.
Definition FisheyeCamera.h:547
VectorT2< T > tangentialFreeDistortion(const VectorT2< T > &distortedNormalized) const
Calculates the tangential-free distortion of a normalized (distorted) image point.
Definition FisheyeCamera.h:1328
bool isInside(const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const
Returns whether a given 2D image point lies inside the camera frame.
Definition FisheyeCamera.h:982
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition FisheyeCamera.h:841
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane...
Definition FisheyeCamera.h:1207
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition FisheyeCamera.h:817
LineT3< T > ray(const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const
Returns a ray starting at the camera's center and intersecting a given 2D point in the image.
Definition FisheyeCamera.h:1225
This class implements a 4x4 homogeneous transformation matrix using floating point values with the pr...
Definition HomogenousMatrix4.h:110
SquareMatrixT3< T > rotationMatrix() const
Returns the rotation matrix of the transformation.
Definition HomogenousMatrix4.h:1493
VectorT3< T > translation() const
Returns the translation of the transformation.
Definition HomogenousMatrix4.h:1381
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition HomogenousMatrix4.h:1806
This class implements an infinite line in 3D space.
Definition Line3.h:68
This class provides basic numeric functionalities.
Definition Numeric.h:57
static T atan(const T value)
Returns the arctangent of a given value.
Definition Numeric.h:1620
static bool isInf(const T value)
Returns whether a given value is positive or negative infinity.
Definition Numeric.h:3120
static T pow(const T x, const T y)
Returns x raised to the power of y.
Definition Numeric.h:1866
static T abs(const T value)
Returns the absolute value of a given value.
Definition Numeric.h:1220
static T sqrt(const T value)
Returns the square root of a given value.
Definition Numeric.h:1537
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2395
static T tan(const T value)
Returns the tangent of a given value.
Definition Numeric.h:1604
static constexpr bool isEqualEps(const T value)
Returns whether a value is smaller than or equal to a small epsilon.
Definition Numeric.h:2096
static constexpr bool isNotEqualEps(const T value)
Returns whether a value is not smaller than or equal to a small epsilon.
Definition Numeric.h:2246
This class implements a 2x2 square matrix.
Definition SquareMatrix2.h:73
bool solve(const VectorT2< T > &b, VectorT2< T > &x) const
Solve a simple 2x2 system of linear equations: Ax = b Beware: The system of linear equations is assum...
Definition SquareMatrix2.h:761
This class implements a vector with two elements.
Definition Vector2.h:96
const T & x() const noexcept
Returns the x value.
Definition Vector2.h:710
const T & y() const noexcept
Returns the y value.
Definition Vector2.h:722
T sqr() const
Returns the square of the vector length.
Definition Vector2.h:633
T length() const
Returns the length of the vector.
Definition Vector2.h:627
This class implements a vector with three elements.
Definition Vector3.h:97
const T & y() const noexcept
Returns the y value.
Definition Vector3.h:824
const T & x() const noexcept
Returns the x value.
Definition Vector3.h:812
VectorT3< T > normalized() const
Returns the normalized vector.
Definition Vector3.h:617
const T & z() const noexcept
Returns the z value.
Definition Vector3.h:836
std::vector< FisheyeCamera > FisheyeCameras
Definition of a vector holding camera objects.
Definition FisheyeCamera.h:59
std::vector< FisheyeCameraT< T > > FisheyeCamerasT
Definition of a typename alias for vectors with FisheyeCameraT objects.
Definition FisheyeCamera.h:53
The namespace covering the entire Ocean framework.
Definition Accessor.h:15