8#ifndef META_OCEAN_MATH_ANY_CAMERA_H
9#define META_OCEAN_MATH_ANY_CAMERA_H
154 virtual std::string
name()
const = 0;
163 virtual std::unique_ptr<AnyCameraT<T>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const = 0;
172 virtual std::unique_ptr<AnyCameraT<float>>
cloneToFloat(
const unsigned int width = 0u,
const unsigned int height = 0u)
const = 0;
181 virtual std::unique_ptr<AnyCameraT<double>>
cloneToDouble(
const unsigned int width = 0u,
const unsigned int height = 0u)
const = 0;
187 virtual unsigned int width()
const = 0;
450 template <
typename U>
634template <
typename T,
typename TCameraWrapper>
674 std::string
name()
const override;
683 std::unique_ptr<AnyCameraT<T>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const override;
692 std::unique_ptr<AnyCameraT<float>>
cloneToFloat(
const unsigned int width = 0u,
const unsigned int height = 0u)
const override;
707 unsigned int width()
const override;
967template <
typename T,
typename TCameraWrapperBase>
975 using typename TCameraWrapperBase::ActualCamera;
1076template <
typename T>
1115 inline unsigned int width()
const;
1121 inline unsigned int height()
const;
1218 template <
typename U>
1219 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1231 static inline std::string
name();
1245template <
typename T>
1284 inline unsigned int width()
const;
1290 inline unsigned int height()
const;
1392 template <
typename U>
1393 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1405 static inline std::string
name();
1418template <
typename T>
1468template <
typename T>
1507 inline unsigned int width()
const;
1513 inline unsigned int height()
const;
1615 template <
typename U>
1616 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1628 static inline std::string
name();
1642template <
typename T>
1672template <
typename T>
1702template <
typename T>
1726template <
typename T>
1732template <
typename T>
1735 ocean_assert(
camera_ !=
nullptr);
1736 ocean_assert(
camera_->isValid());
1737 ocean_assert(flippedCamera_T_world.
isValid());
1739 const VectorT3<T> cameraObjectPointIF = flippedCamera_T_world * objectPoint;
1746 const T invZ = T(1) / cameraObjectPointIF.
z();
1748 const VectorT2<T> normalizedImagePoint(cameraObjectPointIF.
x() * invZ, cameraObjectPointIF.
y() * invZ);
1755 if (imagePoint !=
nullptr)
1757 *imagePoint =
camera_->projectToImageIF(cameraObjectPointIF);
1759 ocean_assert_accuracy(
camera_->isInside(*imagePoint, T(std::max(
camera_->width(),
camera_->height())) * T(-0.1)));
1765template <
typename T>
1771template <
typename T>
1782template <
typename T>
1793template <
typename T>
1796 ocean_assert(
camera !=
nullptr &&
camera->isValid() && segmentSteps >= 1);
1797 if (
camera ==
nullptr || !
camera->isValid() || segmentSteps == 0)
1823template <
typename T>
1826 ocean_assert(
camera.isValid() && segmentSteps >= 1);
1827 if (!
camera.isValid() || segmentSteps == 0)
1853template <
typename T>
1859template <
typename T>
1867template <
typename T>
1870 ocean_assert(
camera.isValid());
1876 ocean_assert(segmentSteps >= 1);
1877 if (segmentSteps < 1)
1882 constexpr unsigned int border = 0u;
1884 const std::array<VectorT2<T>, 4> corners =
1898 const VectorT3<T> principalObjectPoint =
camera.vectorIF(principalPoint,
false );
1900 const T sqrProjectionErrorPrincipalPoint =
camera.projectToImageIF(principalObjectPoint).sqrDistance(principalPoint);
1902 if (sqrProjectionErrorPrincipalPoint > maximalSqrDistance)
1904 ocean_assert(
false &&
"The camera model is not precise enough");
1909 normalizedImagePoints.reserve(corners.size() * segmentSteps);
1911 for (
size_t nCorner = 0; nCorner < corners.size(); ++nCorner)
1914 const VectorT2<T>& corner1 = corners[(nCorner + 1u) % corners.size()];
1916 for (
size_t nStep = 0; nStep < segmentSteps; ++nStep)
1918 const T factor = T(nStep) / T(segmentSteps);
1920 const VectorT2<T> distortedImagePoint = corner0 * (T(1) - factor) + corner1 * factor;
1922 const VectorT2<T> offsetTowardsPrincipalPoint = (principalPoint - distortedImagePoint).normalizedOrZero() * T(1.0);
1928 objectPoint =
camera.vectorIF(distortedImagePoint,
false );
1937 VectorT2<T> boundaryImagePoint = distortedImagePoint;
1940 objectPoint = principalObjectPoint;
1942 constexpr unsigned int iterations = 20u;
1944 for (
unsigned int nIteration = 0u; nIteration < iterations; ++nIteration)
1946 if (boundaryImagePoint.
sqrDistance(centerImagePoint) <= maximalSqrDistance)
1951 const VectorT2<T> middleImagePoint = (boundaryImagePoint + centerImagePoint) * T(0.5);
1953 const VectorT3<T> middleObjectPoint =
camera.vectorIF(middleImagePoint,
false );
1954 const VectorT2<T> projectedMiddleObjectPoint =
camera.projectToImageIF(middleObjectPoint);
1956 const T sqrMiddleDistance = middleImagePoint.
sqrDistance(projectedMiddleObjectPoint);
1958 if (sqrMiddleDistance <= maximalSqrDistance)
1960 centerImagePoint = middleImagePoint;
1962 objectPoint =
camera.vectorIF(middleImagePoint + offsetTowardsPrincipalPoint,
false );
1966 boundaryImagePoint = middleImagePoint;
1974 const VectorT2<T> normalizedImagePoint = objectPoint.
xy() / objectPoint.
z();
1976 normalizedImagePoints.emplace_back(normalizedImagePoint.
x(), normalizedImagePoint.
y());
1981 ocean_assert(normalizedImagePoints.size() >= 3);
1988 for (
size_t n = 1; n < normalizedImagePoints.size(); ++n)
1998template <
typename T>
2009 const bool segmentTopDown = cameraBoundarySegment.point0().y() < cameraBoundarySegment.point1().y();
2013 if (cameraBoundarySegment.point1().y() < normalizedImagePoint.
y() || normalizedImagePoint.
y() < cameraBoundarySegment.point0().y())
2020 if (cameraBoundarySegment.point0().y() < normalizedImagePoint.
y() || normalizedImagePoint.
y() < cameraBoundarySegment.point1().y())
2026 if (cameraBoundarySegment.isOnLine(normalizedImagePoint))
2033 if (cameraBoundarySegment.isLeftOfLine(normalizedImagePoint) == segmentTopDown)
2042 return counter % 2 == 1;
2045template <
typename T>
2048 ocean_assert(
camera.isValid());
2049 ocean_assert(
camera.isInside(imagePoint, T(-1)));
2050 ocean_assert(maximalReprojectionError >= T(0));
2051 ocean_assert(additionalChecksTowardsPrincipalPoint >= 1u);
2064 const VectorT2<T> direction = (principalPoint - imagePoint).normalizedOrZero();
2072 for (
unsigned int n = 0u; n < std::min(additionalChecksTowardsPrincipalPoint, 10u); ++n)
2074 const VectorT2<T> additionalImagePoint = imagePoint + direction * T(n + 1u);
2076 const VectorT3<T> additionalObjectPoint =
camera.vectorIF(additionalImagePoint,
false );
2077 const VectorT2<T> additionalProjectedObjectPoint =
camera.projectToImageIF(additionalObjectPoint);
2094 return anyCamera->cloneToFloat();
2106 return anyCamera->cloneToDouble();
2112template <
typename T>
2113template <
typename U>
2116 static_assert(std::is_same<T, U>::value,
"Invalid data types!");
2121template <
typename T,
typename TCameraWrapper>
2128template <
typename T,
typename TCameraWrapper>
2135template <
typename T,
typename TCameraWrapper>
2138 return TCameraWrapper::anyCameraType();
2141template <
typename T,
typename TCameraWrapper>
2144 return TCameraWrapper::name();
2147template <
typename T,
typename TCameraWrapper>
2153template <
typename T,
typename TCameraWrapper>
2159template <
typename T,
typename TCameraWrapper>
2165template <
typename T,
typename TCameraWrapper>
2168 return TCameraWrapper::width();
2171template <
typename T,
typename TCameraWrapper>
2174 return TCameraWrapper::height();
2177template <
typename T,
typename TCameraWrapper>
2180 return TCameraWrapper::principalPoint();
2183template <
typename T,
typename TCameraWrapper>
2186 return TCameraWrapper::principalPointX();
2189template <
typename T,
typename TCameraWrapper>
2192 return TCameraWrapper::principalPointY();
2195template <
typename T,
typename TCameraWrapper>
2198 return TCameraWrapper::focalLengthX();
2201template <
typename T,
typename TCameraWrapper>
2204 return TCameraWrapper::focalLengthY();
2207template <
typename T,
typename TCameraWrapper>
2210 return TCameraWrapper::inverseFocalLengthX();
2213template <
typename T,
typename TCameraWrapper>
2216 return TCameraWrapper::inverseFocalLengthY();
2219template <
typename T,
typename TCameraWrapper>
2222 return TCameraWrapper::fovX();
2225template <
typename T,
typename TCameraWrapper>
2228 return TCameraWrapper::fovY();
2231template <
typename T,
typename TCameraWrapper>
2234 return TCameraWrapper::isInside(imagePoint, signedBorder);
2237template <
typename T,
typename TCameraWrapper>
2240 return TCameraWrapper::projectToImage(objectPoint);
2243template <
typename T,
typename TCameraWrapper>
2246 return TCameraWrapper::projectToImage(world_T_camera, objectPoint);
2249template <
typename T,
typename TCameraWrapper>
2252 return TCameraWrapper::projectToImageIF(objectPoint);
2255template <
typename T,
typename TCameraWrapper>
2258 return TCameraWrapper::projectToImageIF(flippedCamera_T_world, objectPoint);
2261template <
typename T,
typename TCameraWrapper>
2264 return TCameraWrapper::projectToImage(objectPoints, size, imagePoints);
2267template <
typename T,
typename TCameraWrapper>
2270 return TCameraWrapper::projectToImage(world_T_camera, objectPoints, size, imagePoints);
2273template <
typename T,
typename TCameraWrapper>
2276 return TCameraWrapper::projectToImageIF(objectPoints, size, imagePoints);
2279template <
typename T,
typename TCameraWrapper>
2282 return TCameraWrapper::projectToImageIF(flippedCamera_T_world, objectPoints, size, imagePoints);
2285template <
typename T,
typename TCameraWrapper>
2288 return TCameraWrapper::vector(distortedImagePoint, makeUnitVector);
2291template <
typename T,
typename TCameraWrapper>
2294 return TCameraWrapper::vector(distortedImagePoints, size, vectors, makeUnitVector);
2297template <
typename T,
typename TCameraWrapper>
2300 return TCameraWrapper::vectorIF(distortedImagePoint, makeUnitVector);
2303template <
typename T,
typename TCameraWrapper>
2306 return TCameraWrapper::vectorIF(distortedImagePoints, size, vectors, makeUnitVector);
2309template <
typename T,
typename TCameraWrapper>
2312 return TCameraWrapper::ray(distortedImagePoint, world_T_camera);
2315template <
typename T,
typename TCameraWrapper>
2318 return TCameraWrapper::ray(distortedImagePoint);
2321template <
typename T,
typename TCameraWrapper>
2324 return TCameraWrapper::pointJacobian2x3IF(flippedCameraObjectPoint, jx, jy);
2327template <
typename T,
typename TCameraWrapper>
2330 return TCameraWrapper::pointJacobian2nx3IF(flippedCameraObjectPoints, numberObjectPoints, jacobians);
2333template <
typename T,
typename TCameraWrapper>
2336 ocean_assert(eps >= T(0));
2358template <
typename T,
typename TCameraWrapper>
2361 return TCameraWrapper::isValid();
2364template <
typename T,
typename TCameraWrapperBase>
2371template <
typename T,
typename TCameraWrapperBase>
2378template <
typename T,
typename TCameraWrapperBase>
2381 return VectorT2<T>(TCameraWrapperBase::principalPointX(), TCameraWrapperBase::principalPointY());
2384template <
typename T,
typename TCameraWrapperBase>
2387 ocean_assert(TCameraWrapperBase::isValid());
2401 const T leftAngle =
NumericT<T>::atan(TCameraWrapperBase::principalPointX() * TCameraWrapperBase::inverseFocalLengthX());
2403 if (T(TCameraWrapperBase::width()) <= TCameraWrapperBase::principalPointX())
2405 ocean_assert(
false &&
"Invalid principal point");
2406 return T(2) * leftAngle;
2409 const T rightAngle =
NumericT<T>::atan((T(TCameraWrapperBase::width()) - TCameraWrapperBase::principalPointX()) * TCameraWrapperBase::inverseFocalLengthX());
2411 return leftAngle + rightAngle;
2414template <
typename T,
typename TCameraWrapperBase>
2417 ocean_assert(TCameraWrapperBase::isValid());
2431 const T topAngle =
NumericT<T>::atan(TCameraWrapperBase::principalPointY() * TCameraWrapperBase::inverseFocalLengthY());
2433 if (T(TCameraWrapperBase::height()) <= TCameraWrapperBase::principalPointY())
2435 ocean_assert(
false &&
"Invalid principal point");
2436 return T(2) * topAngle;
2439 const T bottomAngle =
NumericT<T>::atan((T(TCameraWrapperBase::height()) - TCameraWrapperBase::principalPointY()) * TCameraWrapperBase::inverseFocalLengthY());
2441 return topAngle + bottomAngle;
2444template <
typename T,
typename TCameraWrapperBase>
2447 ocean_assert(TCameraWrapperBase::isValid());
2449 const unsigned int cameraWidth = TCameraWrapperBase::width();
2450 const unsigned int cameraHeight = TCameraWrapperBase::height();
2452 ocean_assert(signedBorder < T(std::min(cameraWidth / 2u, cameraHeight / 2u)));
2454 return imagePoint.
x() >= signedBorder && imagePoint.
y() >= signedBorder
2455 && imagePoint.
x() < T(cameraWidth) - signedBorder && imagePoint.
y() < T(cameraHeight) - signedBorder;
2458template <
typename T,
typename TCameraWrapperBase>
2461 return TCameraWrapperBase::projectToImageIF(
VectorT3<T>(objectPoint.
x(), -objectPoint.
y(), -objectPoint.
z()));
2464template <
typename T,
typename TCameraWrapperBase>
2470template <
typename T,
typename TCameraWrapperBase>
2473 ocean_assert(size == 0 || objectPoints !=
nullptr);
2474 ocean_assert(size == 0 || imagePoints !=
nullptr);
2476 for (
size_t n = 0; n < size; ++n)
2479 imagePoints[n] = TCameraWrapperBase::projectToImageIF(
VectorT3<T>(objectPoint.
x(), -objectPoint.
y(), -objectPoint.
z()));
2483template <
typename T,
typename TCameraWrapperBase>
2489template <
typename T,
typename TCameraWrapperBase>
2492 const VectorT3<T> localVectorIF(TCameraWrapperBase::vectorIF(distortedImagePoint, makeUnitVector));
2494 return VectorT3<T>(localVectorIF.
x(), -localVectorIF.
y(), -localVectorIF.
z());
2497template <
typename T,
typename TCameraWrapperBase>
2500 TCameraWrapperBase::vectorIF(distortedImagePoints, size, vectors, makeUnitVector);
2502 for (
size_t n = 0; n < size; ++n)
2506 vectors[n] =
VectorT3<T>(localVectorIF.
x(), -localVectorIF.
y(), -localVectorIF.
z());
2510template <
typename T,
typename TCameraWrapperBase>
2513 ocean_assert(TCameraWrapperBase::isValid() && world_T_camera.
isValid());
2518template <
typename T,
typename TCameraWrapperBase>
2521 ocean_assert(TCameraWrapperBase::isValid());
2526template <
typename T,
typename TCameraWrapperBase>
2529 ocean_assert(flippedCameraObjectPoints !=
nullptr);
2530 ocean_assert(numberObjectPoints >= 1);
2531 ocean_assert(jacobians !=
nullptr);
2533 for (
size_t n = 0; n < numberObjectPoints; ++n)
2535 TCameraWrapperBase::pointJacobian2x3IF(flippedCameraObjectPoints[n], jacobians + 0, jacobians + 3);
2540template <
typename T>
2547template <
typename T>
2554template <
typename T>
2560template <
typename T>
2566template <
typename T>
2572template <
typename T>
2578template <
typename T>
2584template <
typename T>
2590template <
typename T>
2596template <
typename T>
2602template <
typename T>
2608template <
typename T>
2614template <
typename T>
2620template <
typename T>
2623 ocean_assert(size == 0 || objectPoints !=
nullptr);
2624 ocean_assert(size == 0 || imagePoints !=
nullptr);
2626 for (
size_t n = 0; n < size; ++n)
2632template <
typename T>
2635 ocean_assert(size == 0 || objectPoints !=
nullptr);
2636 ocean_assert(size == 0 || imagePoints !=
nullptr);
2638 for (
size_t n = 0; n < size; ++n)
2644template <
typename T>
2652template <
typename T>
2655 ocean_assert(distortedImagePoints !=
nullptr && size > 0);
2656 ocean_assert(vectors !=
nullptr);
2658 for (
size_t n = 0; n < size; ++n)
2660 vectors[n] =
vectorIF(distortedImagePoints[n], makeUnitVector);
2664template <
typename T>
2667 ocean_assert(jx !=
nullptr && jy !=
nullptr);
2671template <
typename T>
2674 ocean_assert(eps >= T(0));
2679template <
typename T>
2685template <
typename T>
2686template <
typename U>
2691 if constexpr (std::is_same<T, U>::value)
2695 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(
actualCamera_);
2703 ocean_assert(
false &&
"Wrong aspect ratio!");
2715 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(convertedPinholeCamera);
2723 ocean_assert(
false &&
"Wrong aspect ratio!");
2727 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(
PinholeCameraT<U>(
width,
height, convertedPinholeCamera));
2731template <
typename T>
2737template <
typename T>
2740 return std::string(
"Ocean Pinhole");
2743template <
typename T>
2750template <
typename T>
2757template <
typename T>
2763template <
typename T>
2769template <
typename T>
2775template <
typename T>
2781template <
typename T>
2787template <
typename T>
2793template <
typename T>
2799template <
typename T>
2805template <
typename T>
2811template <
typename T>
2817template <
typename T>
2823template <
typename T>
2826 return actualCamera_.projectToImageIF(flippedCamera_T_world, objectPoint);
2829template <
typename T>
2832 ocean_assert(size == 0 || objectPoints !=
nullptr);
2833 ocean_assert(size == 0 || imagePoints !=
nullptr);
2835 for (
size_t n = 0; n < size; ++n)
2841template <
typename T>
2844 ocean_assert(size == 0 || objectPoints !=
nullptr);
2845 ocean_assert(size == 0 || imagePoints !=
nullptr);
2847 for (
size_t n = 0; n < size; ++n)
2853template <
typename T>
2856 return actualCamera_.vectorIF(distortedImagePoint, makeUnitVector);
2859template <
typename T>
2862 ocean_assert(distortedImagePoints !=
nullptr && size > 0);
2863 ocean_assert(vectors !=
nullptr);
2865 for (
size_t n = 0; n < size; ++n)
2867 vectors[n] =
vectorIF(distortedImagePoints[n], makeUnitVector);
2871template <
typename T>
2874 actualCamera_.pointJacobian2x3IF(flippedCameraObjectPoint, jx, jy);
2877template <
typename T>
2880 ocean_assert(eps >= T(0));
2885template <
typename T>
2891template <
typename T>
2892template <
typename U>
2907 ocean_assert(
false &&
"Wrong aspect ratio!");
2914 const U newPrincipalX = U(
actualCamera_.principalPointX() * xFactor);
2915 const U newPrincipalY = U(
actualCamera_.principalPointY() * yFactor);
2917 const U newFocalLengthX = U(
actualCamera_.focalLengthX() * xFactor);
2918 const U newFocalLengthY = U(
actualCamera_.focalLengthY() * yFactor);
2920 U radialDistortion[6];
2921 for (
unsigned int n = 0u; n < 6u; ++n)
2923 radialDistortion[n] = U(
actualCamera_.radialDistortion()[n]);
2926 const U tangentialDistortion[2] =
2932 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBaseFisheyeT<U>>>>(
FisheyeCameraT<U>(
width,
height, newFocalLengthX, newFocalLengthY, newPrincipalX, newPrincipalY, radialDistortion, tangentialDistortion));
2935template <
typename T>
2941template <
typename T>
2944 return std::string(
"Ocean Fisheye");
2947template <
typename T>
2954template <
typename T>
2961template <
typename T>
2966 ocean_assert(
false &&
"This function must never be called.");
2971template <
typename T>
2976 ocean_assert(
false &&
"This function must never be called.");
2978 return (
unsigned int)(-1);
2981template <
typename T>
2986 ocean_assert(
false &&
"This function must never be called.");
2988 return (
unsigned int)(-1);
2991template <
typename T>
2996 ocean_assert(
false &&
"This function must never be called.");
3001template <
typename T>
3006 ocean_assert(
false &&
"This function must never be called.");
3011template <
typename T>
3016 ocean_assert(
false &&
"This function must never be called.");
3021template <
typename T>
3026 ocean_assert(
false &&
"This function must never be called.");
3031template <
typename T>
3036 ocean_assert(
false &&
"This function must never be called.");
3041template <
typename T>
3046 ocean_assert(
false &&
"This function must never be called.");
3051template <
typename T>
3056 ocean_assert(
false &&
"This function must never be called.");
3061template <
typename T>
3066 ocean_assert(
false &&
"This function must never be called.");
3071template <
typename T>
3076 ocean_assert(
false &&
"This function must never be called.");
3081template <
typename T>
3086 ocean_assert(
false &&
"This function must never be called.");
3090template <
typename T>
3095 ocean_assert(
false &&
"This function must never be called.");
3098template <
typename T>
3103 ocean_assert(
false &&
"This function must never be called.");
3108template <
typename T>
3113 ocean_assert(
false &&
"This function must never be called.");
3116template <
typename T>
3121 ocean_assert(
false &&
"This function must never be called.");
3124template <
typename T>
3129 ocean_assert(
false &&
"This function must never be called.");
3134template <
typename T>
3140template <
typename T>
3141template <
typename U>
3146 ocean_assert(
false &&
"This function must never be called.");
3151template <
typename T>
3157template <
typename T>
3160 return std::string(
"Invalid camera");
3163template <
typename T>
3170template <
typename T>
This class implements a helper class allowing to check whether a 3D object point projects into the ca...
Definition AnyCamera.h:518
AnyCameraClipperT(const SharedAnyCameraT< T > &camera, const size_t segmentSteps=10)
Creates a new clipper object for a specified camera model.
Definition AnyCamera.h:1727
bool projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint, VectorT2< T > *imagePoint=nullptr) const
Returns whether a 3D object point is located in front of the camera and projects into the camera imag...
Definition AnyCamera.h:1733
bool isValid() const
Returns whether this clipper holds a valid camera model and is ready to be used.
Definition AnyCamera.h:1860
void update(const AnyCameraT< T > &camera, const size_t segmentSteps=10)
Updates the clipper with a new camera model based on a cloned copy of the provided camera.
Definition AnyCamera.h:1824
static bool isInside(const FiniteLinesT2< T > &cameraBoundarySegments, const VectorT2< T > &normalizedImagePoint)
Returns whether a given normalized image point lies inside the camera's boundary.
Definition AnyCamera.h:1999
AnyCameraClipperT()=default
Default constructor creating an invalid object.
unsigned int height() const
Returns the height of the camera profile.
Definition AnyCamera.h:1783
const FiniteLinesT2< T > & cameraBoundarySegments() const
Returns the 2D line segments defined in the camera's normalized image plane defining the camera's bou...
Definition AnyCamera.h:1854
FiniteLinesT2< Scalar > cameraBoundarySegments_
Definition AnyCamera.h:624
const SharedAnyCameraT< Scalar > & camera() const
unsigned int width() const
Returns the width of the camera profile.
Definition AnyCamera.h:1772
SharedAnyCameraT< Scalar > camera_
Definition AnyCamera.h:621
void update(const SharedAnyCameraT< T > &camera, const size_t segmentSteps=10)
Updates the clipper with a new camera model.
Definition AnyCamera.h:1794
static bool determineCameraBoundary(const AnyCameraT< T > &camera, FiniteLinesT2< T > &cameraBoundarySegments, const size_t segmentSteps)
Determines the camera boundary of a given camera model in normalized image coordinates.
Definition AnyCamera.h:1868
static bool isValidForPoint(const AnyCameraT< T > &camera, const VectorT2< T > &imagePoint, const T maximalReprojectionError=T(1), const unsigned int additionalChecksTowardsPrincipalPoint=3u)
Returns whether a given camera model is valid for a specified 2D image point in the camera image.
Definition AnyCamera.h:2046
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:131
virtual ~AnyCameraT()=default
Destructs the AnyCamera object.
virtual VectorT3< T > vector(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const =0
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
AnyCameraT(AnyCameraT< T > &&)=delete
Disabled move constructor.
virtual LineT3< T > ray(const VectorT2< T > &distortedImagePoint) const =0
Returns a ray starting at the camera's center and intersecting a given 2D point in the image.
virtual unsigned int width() const=0
virtual T focalLengthX() const =0
Returns the horizontal focal length parameter.
virtual VectorT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &objectPoint) const =0
Projects a 3D object point into the camera frame.
virtual void vectorIF(const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const =0
Returns vectors starting at the camera's center and intersecting a given 2D points in the image.
virtual void projectToImage(const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
Projects several 3D object points into the camera frame at once.
virtual VectorT2< T > principalPoint() const =0
Returns the coordinate of the principal point of the camera image in the pixel domain.
virtual std::unique_ptr< AnyCameraT< double > > cloneToDouble(const unsigned int width=0u, const unsigned int height=0u) const =0
Returns a copy of this camera object with double precision.
virtual T inverseFocalLengthY() const =0
Returns the inverse vertical focal length parameter.
AnyCameraT & operator=(AnyCameraT &&)=delete
Disabled move operator.
virtual void projectToImageIF(const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
Projects several 3D object points into the camera frame at once.
virtual std::unique_ptr< AnyCameraT< T > > clone(const unsigned int width=0u, const unsigned int height=0u) const =0
Returns a copy of this camera object.
virtual T fovX() const =0
Returns the field of view in x direction of the camera.
virtual VectorT2< T > projectToImage(const VectorT3< T > &objectPoint) const =0
Projects a 3D object point into the camera frame.
virtual T inverseFocalLengthX() const =0
Returns the inverse horizontal focal length parameter.
virtual T focalLengthY() const =0
Returns the vertical focal length parameter.
virtual void pointJacobian2x3IF(const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const =0
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.
AnyCameraT & operator=(const AnyCameraT &)=delete
Disabled assign operator.
Scalar TScalar
Definition AnyCamera.h:135
virtual unsigned int height() const=0
virtual VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const =0
Projects a 3D object point into the camera frame.
virtual T fovY() const =0
Returns the field of view in x direction of the camera.
virtual T principalPointY() const =0
Returns the y-value of the principal point of the camera image in the pixel domain.
virtual void projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
Projects several 3D object points into the camera frame at once.
virtual bool isEqual(const AnyCameraT< T > &anyCamera, const T eps=NumericT< T >::eps()) const =0
Returns whether two camera objects are identical up to a given epsilon.
virtual VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const =0
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
virtual bool isValid() const =0
Returns whether this camera is valid.
virtual LineT3< T > ray(const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const =0
Returns a ray starting at the camera's center and intersecting a given 2D point in the image.
virtual VectorT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint) const =0
Projects a 3D object point into the camera frame.
virtual AnyCameraType anyCameraType() const =0
Returns the type of this camera.
AnyCameraT()=default
Protected default constructor.
virtual void vector(const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const =0
Determines vectors starting at the camera's center and intersecting given 2D points in the image.
virtual void pointJacobian2nx3IF(const VectorT3< T > *flippedCameraObjectPoints, const size_t numberObjectPoints, T *jacobians) const =0
Calculates the 2n x 3 jacobian matrix for the 3D object point projection into the camera frame.
virtual std::string name() const =0
Returns the name of this camera.
AnyCameraT(const AnyCameraT< T > &anyCamera)=default
Protected copy constructor.
static std::shared_ptr< AnyCameraT< T > > convert(const std::shared_ptr< AnyCameraT< U > > &anyCamera)
Converts an AnyCamera object with arbitrary scalar type to another AnyCamera object with arbitrary sc...
Definition AnyCamera.h:2114
virtual std::unique_ptr< AnyCameraT< float > > cloneToFloat(const unsigned int width=0u, const unsigned int height=0u) const =0
Returns a copy of this camera object with float precision.
virtual void projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const =0
Projects several 3D object points into the camera frame at once.
virtual bool isInside(const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const =0
Returns whether a given 2D image point lies inside the camera frame.
virtual T principalPointX() const =0
Returns the x-value of the principal point of the camera image in the pixel domain.
This class implements a specialized AnyCamera object wrapping the actual camera model.
Definition AnyCamera.h:638
VectorT2< T > principalPoint() const override
void projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const override
void pointJacobian2nx3IF(const VectorT3< T > *flippedCameraObjectPoints, const size_t numberObjectPoints, T *jacobians) const override
void projectToImageIF(const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const override
AnyCameraWrappingT(const ActualCamera &actualCamera)
VectorT2< T > projectToImage(const VectorT3< T > &objectPoint) const override
bool isEqual(const AnyCameraT< T > &anyCamera, const T eps=NumericT< T >::eps()) const override
unsigned int width() const override
unsigned int height() const override
std::unique_ptr< AnyCameraT< float > > cloneToFloat(const unsigned int width=0u, const unsigned int height=0u) const override
VectorT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &objectPoint) const override
std::unique_ptr< AnyCameraT< T > > clone(const unsigned int width=0u, const unsigned int height=0u) const override
T focalLengthY() const override
bool isValid() const override
void projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const override
AnyCameraType anyCameraType() const override
T inverseFocalLengthX() const override
T principalPointY() const override
void vectorIF(const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const override
AnyCameraWrappingT(ActualCamera &&actualCamera)
Creates a new AnyCamera object wrapping the actual camera model.
Definition AnyCamera.h:2122
VectorT3< T > vector(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const override
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const override
void projectToImage(const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const override
T TScalar
The scalar data type of this object.
Definition AnyCamera.h:642
T focalLengthX() const override
bool isInside(const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const override
std::string name() const override
LineT3< T > ray(const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const override
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const override
typename TCameraWrapper::ActualCamera ActualCamera
The actual camera object wrapped by this class.
Definition AnyCamera.h:648
T principalPointX() const override
std::unique_ptr< AnyCameraT< double > > cloneToDouble(const unsigned int width=0u, const unsigned int height=0u) const override
void pointJacobian2x3IF(const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const override
LineT3< T > ray(const VectorT2< T > &distortedImagePoint) const override
void vector(const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector=true) const override
TCameraWrapper CameraWrapper
The class which is actually wrapping the camera object.
Definition AnyCamera.h:645
T inverseFocalLengthY() const override
VectorT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint) const override
This class implements the base class for all cameras.
Definition Camera.h:99
static HomogenousMatrixT4< U > standard2InvertedFlipped(const HomogenousMatrixT4< U > &world_T_camera)
Transforms a standard homogenous 4x4 viewing (extrinsic camera) matrix into an inverted and flipped c...
Definition Camera.h:779
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2782
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:2806
ActualCamera actualCamera_
The actual fisheye camera object.
Definition AnyCamera.h:1410
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2770
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 AnyCamera.h:2872
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2764
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:2886
FisheyeCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1253
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:2812
CameraWrapperT< T, CameraWrapperBaseFisheyeT< T > > WrappedCamera
Definition of the parent WrappedCamera class using this base class.
Definition AnyCamera.h:1258
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:2936
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector) const
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2854
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2758
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2776
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2788
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:2942
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:2794
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:2800
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2818
CameraWrapperBaseFisheyeT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBaseFisheyeT object wrapping the actual camera model.
Definition AnyCamera.h:2744
std::unique_ptr< AnyCameraT< U > > clone(const unsigned int width=0u, const unsigned int height=0u) const
Returns a copy of the actual camera object.
Definition AnyCamera.h:2893
bool isEqual(const CameraWrapperBaseFisheyeT< T > &baseFisheye, const T eps=NumericT< T >::eps()) const
Returns whether two camera objects are identical up to a given epsilon.
Definition AnyCamera.h:2878
bool isEqual(const CameraWrapperBaseInvalidT< T > &baseInvalid, const T eps=NumericT< T >::eps()) const
Returns whether two camera objects are identical up to a given epsilon.
Definition AnyCamera.h:3125
CameraWrapperT< T, CameraWrapperBaseInvalidT< T > > WrappedCamera
Definition of the parent WrappedCamera class using this base class.
Definition AnyCamera.h:1481
InvalidCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1476
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:3062
CameraWrapperBaseInvalidT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBaseInvalidT object wrapping the actual camera model.
Definition AnyCamera.h:2948
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2982
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2962
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:3158
ActualCamera actualCamera_
The actual invalid camera.
Definition AnyCamera.h:1633
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:3002
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2992
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:3042
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:3135
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:3152
std::unique_ptr< AnyCameraT< U > > clone(const unsigned int width=0u, const unsigned int height=0u) const
Returns a copy of the actual camera object.
Definition AnyCamera.h:3142
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:3052
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 AnyCamera.h:3117
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector) const
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:3099
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:3032
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:3012
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:3022
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2972
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:2597
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 AnyCamera.h:2665
PinholeCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1084
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2567
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:2680
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2579
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:2603
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:2738
ActualCamera actualCamera_
The actual pinhole camera.
Definition AnyCamera.h:1236
CameraWrapperT< T, CameraWrapperBasePinholeT< T > > WrappedCamera
Definition of the parent WrappedCamera class using this base class.
Definition AnyCamera.h:1089
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2555
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2561
CameraWrapperBasePinholeT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBasePinholeT object wrapping the actual camera model.
Definition AnyCamera.h:2541
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector) const
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2645
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2609
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:2732
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2573
bool isEqual(const CameraWrapperBasePinholeT< T > &basePinhole, const T eps=NumericT< T >::eps()) const
Returns whether two camera objects are identical up to a given epsilon.
Definition AnyCamera.h:2672
std::unique_ptr< AnyCameraT< U > > clone(const unsigned int width=0u, const unsigned int height=0u) const
Returns a copy of the actual camera object.
Definition AnyCamera.h:2687
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:2591
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:2585
This class implements a wrapper for an actual camera object.
Definition AnyCamera.h:969
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 AnyCamera.h:2511
T fovY() const
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:2415
T fovX() const
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:2385
void vector(const VectorT2< T > *distortedImagePoints, const size_t size, VectorT3< T > *vectors, const bool makeUnitVector) const
Determines vectors starting at the camera's center and intersecting given 2D points in the image.
Definition AnyCamera.h:2498
CameraWrapperT(ActualCamera &&actualCamera)
Creates a new CameraWrapperT object wrapping the actual camera model.
Definition AnyCamera.h:2365
VectorT3< T > vector(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector) const
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2490
void projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const
Projects several 3D object points into the camera frame at once.
Definition AnyCamera.h:2484
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 AnyCamera.h:2519
VectorT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2465
void pointJacobian2nx3IF(const VectorT3< T > *flippedCameraObjectPoints, const size_t numberObjectPoints, T *jacobians) const
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.
Definition AnyCamera.h:2527
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 AnyCamera.h:2445
CameraWrapperT(const ActualCamera &actualCamera)
Creates a new CameraWrapperT object wrapping the actual camera model.
Definition AnyCamera.h:2372
void projectToImage(const VectorT3< T > *objectPoints, const size_t size, VectorT2< T > *imagePoints) const
Projects several 3D object points into the camera frame at once.
Definition AnyCamera.h:2471
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2379
VectorT2< T > projectToImage(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2459
This class implements an finite line in 2D space.
Definition FiniteLine2.h:82
Class representing a fisheye camera.
Definition FisheyeCamera.h:106
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:1487
VectorT3< T > translation() const
Returns the translation of the transformation.
Definition HomogenousMatrix4.h:1375
bool isValid() const
Returns whether this matrix is a valid homogeneous transformation.
Definition HomogenousMatrix4.h:1800
This class implements invalid camera profiles, e.g.
Definition AnyCamera.h:1420
const std::string & reason() const
std::string reason_
Definition AnyCamera.h:1438
InvalidCameraT(const std::string &reason)
Creates an invalid camera.
Definition AnyCamera.h:3164
This class implements an infinite line in 3D space.
Definition Line3.h:69
static MessageObject error()
Returns the message for error messages.
Definition Messenger.h:1095
static constexpr T minValue()
Returns the min scalar value.
Definition Numeric.h:3259
static T atan(const T value)
Returns the arctangent of a given value.
Definition Numeric.h:1620
static constexpr T eps()
Returns a small epsilon.
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 constexpr T sqr(const T value)
Returns the square of a given value.
Definition Numeric.h:1499
static constexpr bool isEqualEps(const T value)
Returns whether a value is smaller than or equal to a small epsilon.
Definition Numeric.h:2096
Definition of a pinhole camera model.
Definition PinholeCamera.h:114
This class implements a vector with two elements.
Definition Vector2.h:96
const T & x() const noexcept
Returns the x value.
Definition Vector2.h:703
const T & y() const noexcept
Returns the y value.
Definition Vector2.h:715
bool isNull() const
Returns whether this vector is a null vector up to a small epsilon.
Definition Vector2.h:739
T sqrDistance(const VectorT2< T > &right) const
Returns the square distance between this 2D position and a second 2D position.
Definition Vector2.h:638
This class implements a vector with three elements.
Definition Vector3.h:97
const T & y() const noexcept
Returns the y value.
Definition Vector3.h:816
const T & x() const noexcept
Returns the x value.
Definition Vector3.h:804
VectorT2< T > xy() const noexcept
Returns the x and y component of the vector as new 2D vector.
Definition Vector3.h:840
static VectorT3< T > minValue()
Returns a 3D vector with all elements set to NumericT::minValue().
Definition Vector3.h:1036
const T & z() const noexcept
Returns the z value.
Definition Vector3.h:828
InvalidCameraT< double > InvalidCameraD
Definition of an invalid camera object based with element precision 'double'.
Definition AnyCamera.h:1453
SharedAnyCamerasT< double > SharedAnyCamerasD
Definition of a vector holding AnyCameraD objects.
Definition AnyCamera.h:98
AnyCameraWrappingT< T, CameraWrapperT< T, CameraWrapperBaseFisheyeT< T > > > AnyCameraFisheyeT
Definition of an AnyCamera object based on Ocean's fisheye camera class with template parameter to de...
Definition AnyCamera.h:1673
AnyCameraT< float > AnyCameraF
Definition of an AnyCamera object with float precision.
Definition AnyCamera.h:45
std::vector< FiniteLineT2< T > > FiniteLinesT2
Definition of a typename alias for vectors with FiniteLineT2 objects.
Definition FiniteLine2.h:50
std::shared_ptr< AnyCameraT< T > > SharedAnyCameraT
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:54
AnyCameraT< double > AnyCameraD
Definition of an AnyCamera object with double precision.
Definition AnyCamera.h:38
InvalidCameraT< Scalar > InvalidCamera
Definition of an invalid camera object based with element precision 'Scalar'.
Definition AnyCamera.h:1446
std::shared_ptr< AnyCameraF > SharedAnyCameraF
Definition of a shared pointer holding an AnyCamera object with float precision.
Definition AnyCamera.h:75
std::shared_ptr< AnyCameraD > SharedAnyCameraD
Definition of a shared pointer holding an AnyCamera object with double precision.
Definition AnyCamera.h:68
AnyCameraT< Scalar > AnyCamera
Definition of an AnyCamera object with Scalar precision.
Definition AnyCamera.h:31
AnyCameraClipperT< Scalar > AnyCameraClipper
Definition of an AnyCamera clipper object with Scalar precision.
Definition AnyCamera.h:493
AnyCameraPinholeT< Scalar > AnyCameraPinhole
Definition of an AnyCamera object based on Ocean's pinhole camera class with element precision 'Scala...
Definition AnyCamera.h:1650
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:61
AnyCameraClipperT< float > AnyCameraClipperF
Definition of an AnyCamera clipper object with float precision.
Definition AnyCamera.h:507
InvalidCameraT< float > InvalidCameraF
Definition of an invalid camera object based with element precision 'float'.
Definition AnyCamera.h:1460
SharedAnyCamerasT< Scalar > SharedAnyCameras
Definition of a vector holding AnyCamera objects.
Definition AnyCamera.h:91
AnyCameraWrappingT< T, CameraWrapperT< T, CameraWrapperBasePinholeT< T > > > AnyCameraPinholeT
Definition of an AnyCamera object based on Ocean's pinhole camera class with template parameter to de...
Definition AnyCamera.h:1643
std::vector< std::shared_ptr< AnyCameraT< T > > > SharedAnyCamerasT
Definition of a typename alias for vectors with shared AnyCameraT objects.
Definition AnyCamera.h:84
AnyCameraPinholeT< double > AnyCameraPinholeD
Definition of an AnyCamera object based on Ocean's pinhole camera class with element precision 'doubl...
Definition AnyCamera.h:1657
AnyCameraFisheyeT< float > AnyCameraFisheyeF
Definition of an AnyCamera object based on Ocean's fisheye camera class with element precision 'float...
Definition AnyCamera.h:1694
AnyCameraWrappingT< T, CameraWrapperT< T, CameraWrapperBaseInvalidT< T > > > AnyCameraInvalidT
Definition of an AnyCamera object based on an invalid (by design) camera with template parameter to d...
Definition AnyCamera.h:1703
AnyCameraType
Definition of individual camera types.
Definition AnyCamera.h:112
AnyCameraInvalidT< double > AnyCameraInvalidD
Definition of an AnyCamera object based on an invalid (by design) camera with element precision 'doub...
Definition AnyCamera.h:1717
AnyCameraPinholeT< float > AnyCameraPinholeF
Definition of an AnyCamera object based on Ocean's pinhole camera class with element precision 'float...
Definition AnyCamera.h:1664
AnyCameraClipperT< double > AnyCameraClipperD
Definition of an AnyCamera clipper object with double precision.
Definition AnyCamera.h:500
SharedAnyCamerasT< float > SharedAnyCamerasF
Definition of a vector holding AnyCameraF objects.
Definition AnyCamera.h:105
AnyCameraFisheyeT< double > AnyCameraFisheyeD
Definition of an AnyCamera object based on Ocean's fisheye camera class with element precision 'doubl...
Definition AnyCamera.h:1687
AnyCameraFisheyeT< Scalar > AnyCameraFisheye
Definition of an AnyCamera object based on Ocean's fisheye camera class with element precision 'Scala...
Definition AnyCamera.h:1680
AnyCameraInvalidT< float > AnyCameraInvalidF
Definition of an AnyCamera object based on an invalid (by design) camera with element precision 'floa...
Definition AnyCamera.h:1724
std::vector< VectorT2< T > > VectorsT2
Definition of a typename alias for vectors with VectorT2 objects.
Definition Vector2.h:57
AnyCameraInvalidT< Scalar > AnyCameraInvalid
Definition of an AnyCamera object based on an invalid (by design) camera with element precision 'Scal...
Definition AnyCamera.h:1710
@ FISHEYE
A fisheye camera.
Definition AnyCamera.h:118
@ PINHOLE
A pinhole camera.
Definition AnyCamera.h:116
@ INVALID
An invalid camera type.
Definition AnyCamera.h:114
The namespace covering the entire Ocean framework.
Definition Accessor.h:15