8#ifndef META_OCEAN_MATH_ANY_CAMERA_H
9#define META_OCEAN_MATH_ANY_CAMERA_H
23template <
typename T>
class AnyCameraT;
153 virtual std::string
name()
const = 0;
162 virtual std::unique_ptr<AnyCameraT<T>>
clone(
const unsigned int width = 0
u,
const unsigned int height = 0
u)
const = 0;
186 virtual unsigned int width()
const = 0;
449 template <
typename U>
593template <
typename T,
typename TCameraWrapper>
633 std::string
name()
const override;
642 std::unique_ptr<AnyCameraT<T>>
clone(
const unsigned int width = 0
u,
const unsigned int height = 0
u)
const override;
651 std::unique_ptr<AnyCameraT<float>>
cloneToFloat(
const unsigned int width = 0
u,
const unsigned int height = 0
u)
const override;
660 std::unique_ptr<AnyCameraT<double>>
cloneToDouble(
const unsigned int width = 0
u,
const unsigned int height = 0
u)
const override;
666 unsigned int width()
const override;
672 unsigned int height()
const override;
721 T
fovX()
const override;
728 T
fovY()
const override;
926template <
typename T,
typename TCameraWrapperBase>
934 using typename TCameraWrapperBase::ActualCamera;
960 inline T
fovX()
const;
966 inline T
fovY()
const;
1035template <
typename T>
1074 inline unsigned int width()
const;
1080 inline unsigned int height()
const;
1177 template <
typename U>
1178 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1190 static inline std::string
name();
1204template <
typename T>
1243 inline unsigned int width()
const;
1249 inline unsigned int height()
const;
1351 template <
typename U>
1352 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1364 static inline std::string
name();
1377template <
typename T>
1392 const std::string&
reason()
const;
1427template <
typename T>
1466 inline unsigned int width()
const;
1472 inline unsigned int height()
const;
1574 template <
typename U>
1575 inline std::unique_ptr<AnyCameraT<U>>
clone(
const unsigned int width = 0u,
const unsigned int height = 0u)
const;
1587 static inline std::string
name();
1601template <
typename T>
1631template <
typename T>
1661template <
typename T>
1685template <
typename T>
1688 ocean_assert(camera !=
nullptr && camera->isValid() && segmentSteps >= 1);
1690 if (camera !=
nullptr && camera->isValid() && segmentSteps >= 1)
1694 if (determineCameraBoundary(*camera, cameraBoundarySegments, segmentSteps))
1697 cameraBoundarySegments_ = std::move(cameraBoundarySegments);
1702template <
typename T>
1705 ocean_assert(camera_ !=
nullptr);
1706 ocean_assert(camera_->isValid());
1707 ocean_assert(flippedCamera_T_world.
isValid());
1709 const VectorT3<T> cameraObjectPointIF = flippedCamera_T_world * objectPoint;
1716 const T invZ = T(1) / cameraObjectPointIF.
z();
1718 const VectorT2<T> normalizedImagePoint(cameraObjectPointIF.
x() * invZ, cameraObjectPointIF.
y() * invZ);
1720 if (!isInside(cameraBoundarySegments_, normalizedImagePoint))
1725 if (imagePoint !=
nullptr)
1727 *imagePoint = camera_->projectToImageIF(cameraObjectPointIF);
1729 ocean_assert_accuracy(camera_->isInside(*imagePoint, T(std::max(camera_->width(), camera_->height())) * T(-0.1)));
1735template <
typename T>
1741template <
typename T>
1744 return cameraBoundarySegments_;
1747template <
typename T>
1750 ocean_assert(camera_ ==
nullptr || !cameraBoundarySegments_.empty());
1752 return camera_ !=
nullptr;
1755template <
typename T>
1758 ocean_assert(camera.
isValid());
1764 ocean_assert(segmentSteps >= 1);
1765 if (segmentSteps < 1)
1770 const std::array<VectorT2<T>, 4> corners =
1779 normalizedImagePoints.reserve(corners.size() * segmentSteps);
1781 for (
size_t nCorner = 0; nCorner < corners.size(); ++nCorner)
1784 const VectorT2<T>& corner1 = corners[(nCorner + 1u) % corners.size()];
1786 for (
size_t nStep = 0; nStep < segmentSteps; ++nStep)
1788 const T factor = T(nStep) / T(segmentSteps);
1790 const VectorT2<T> distortedImagePoint = corner0 * (T(1) - factor) + corner1 * factor;
1795 const VectorT2<T> normalizedImagePoint = objectPoint.xy() / objectPoint.z();
1797 normalizedImagePoints.emplace_back(normalizedImagePoint.
x(), normalizedImagePoint.
y());
1801 ocean_assert(normalizedImagePoints.size() >= 3);
1802 ocean_assert(normalizedImagePoints.size() == segmentSteps * corners.size());
1804 ocean_assert(cameraBoundarySegments.empty());
1805 cameraBoundarySegments.clear();
1807 cameraBoundarySegments.reserve(normalizedImagePoints.size());
1809 for (
size_t n = 1; n < normalizedImagePoints.size(); ++n)
1811 cameraBoundarySegments.emplace_back(normalizedImagePoints[n - 1], normalizedImagePoints[n]);
1814 cameraBoundarySegments.emplace_back(normalizedImagePoints.back(), normalizedImagePoints.front());
1819template <
typename T>
1822 ocean_assert(cameraBoundarySegments.size() >= 3);
1826 for (
const FiniteLineT2<T>& cameraBoundarySegment : cameraBoundarySegments)
1830 const bool segmentTopDown = cameraBoundarySegment.point0().y() < cameraBoundarySegment.point1().y();
1834 if (cameraBoundarySegment.point1().y() < imagePoint.
y() || imagePoint.
y() < cameraBoundarySegment.point0().y())
1841 if (cameraBoundarySegment.point0().y() < imagePoint.
y() || imagePoint.
y() < cameraBoundarySegment.point1().y())
1847 if (cameraBoundarySegment.isOnLine(imagePoint))
1854 if (cameraBoundarySegment.isLeftOfLine(imagePoint) == segmentTopDown)
1863 return counter % 2 == 1;
1872 return anyCamera->cloneToFloat();
1884 return anyCamera->cloneToDouble();
1890template <
typename T>
1891template <
typename U>
1894 static_assert(std::is_same<T, U>::value,
"Invalid data types!");
1899template <
typename T,
typename TCameraWrapper>
1906template <
typename T,
typename TCameraWrapper>
1913template <
typename T,
typename TCameraWrapper>
1916 return TCameraWrapper::anyCameraType();
1919template <
typename T,
typename TCameraWrapper>
1922 return TCameraWrapper::name();
1925template <
typename T,
typename TCameraWrapper>
1928 return TCameraWrapper::template clone<T>(width, height);
1931template <
typename T,
typename TCameraWrapper>
1934 return TCameraWrapper::template clone<float>(width, height);
1937template <
typename T,
typename TCameraWrapper>
1940 return TCameraWrapper::template clone<double>(width, height);
1943template <
typename T,
typename TCameraWrapper>
1946 return TCameraWrapper::width();
1949template <
typename T,
typename TCameraWrapper>
1952 return TCameraWrapper::height();
1955template <
typename T,
typename TCameraWrapper>
1958 return TCameraWrapper::principalPoint();
1961template <
typename T,
typename TCameraWrapper>
1964 return TCameraWrapper::principalPointX();
1967template <
typename T,
typename TCameraWrapper>
1970 return TCameraWrapper::principalPointY();
1973template <
typename T,
typename TCameraWrapper>
1976 return TCameraWrapper::focalLengthX();
1979template <
typename T,
typename TCameraWrapper>
1982 return TCameraWrapper::focalLengthY();
1985template <
typename T,
typename TCameraWrapper>
1988 return TCameraWrapper::inverseFocalLengthX();
1991template <
typename T,
typename TCameraWrapper>
1994 return TCameraWrapper::inverseFocalLengthY();
1997template <
typename T,
typename TCameraWrapper>
2000 return TCameraWrapper::fovX();
2003template <
typename T,
typename TCameraWrapper>
2006 return TCameraWrapper::fovY();
2009template <
typename T,
typename TCameraWrapper>
2012 return TCameraWrapper::isInside(imagePoint, signedBorder);
2015template <
typename T,
typename TCameraWrapper>
2018 return TCameraWrapper::projectToImage(objectPoint);
2021template <
typename T,
typename TCameraWrapper>
2024 return TCameraWrapper::projectToImage(world_T_camera, objectPoint);
2027template <
typename T,
typename TCameraWrapper>
2030 return TCameraWrapper::projectToImageIF(objectPoint);
2033template <
typename T,
typename TCameraWrapper>
2036 return TCameraWrapper::projectToImageIF(flippedCamera_T_world, objectPoint);
2039template <
typename T,
typename TCameraWrapper>
2042 return TCameraWrapper::projectToImage(objectPoints, size, imagePoints);
2045template <
typename T,
typename TCameraWrapper>
2048 return TCameraWrapper::projectToImage(world_T_camera, objectPoints, size, imagePoints);
2051template <
typename T,
typename TCameraWrapper>
2054 return TCameraWrapper::projectToImageIF(objectPoints, size, imagePoints);
2057template <
typename T,
typename TCameraWrapper>
2060 return TCameraWrapper::projectToImageIF(flippedCamera_T_world, objectPoints, size, imagePoints);
2063template <
typename T,
typename TCameraWrapper>
2066 return TCameraWrapper::vector(distortedImagePoint, makeUnitVector);
2069template <
typename T,
typename TCameraWrapper>
2072 return TCameraWrapper::vector(distortedImagePoints, size, vectors, makeUnitVector);
2075template <
typename T,
typename TCameraWrapper>
2078 return TCameraWrapper::vectorIF(distortedImagePoint, makeUnitVector);
2081template <
typename T,
typename TCameraWrapper>
2084 return TCameraWrapper::vectorIF(distortedImagePoints, size, vectors, makeUnitVector);
2087template <
typename T,
typename TCameraWrapper>
2090 return TCameraWrapper::ray(distortedImagePoint, world_T_camera);
2093template <
typename T,
typename TCameraWrapper>
2096 return TCameraWrapper::ray(distortedImagePoint);
2099template <
typename T,
typename TCameraWrapper>
2102 return TCameraWrapper::pointJacobian2x3IF(flippedCameraObjectPoint, jx, jy);
2105template <
typename T,
typename TCameraWrapper>
2108 return TCameraWrapper::pointJacobian2nx3IF(flippedCameraObjectPoints, numberObjectPoints, jacobians);
2111template <
typename T,
typename TCameraWrapper>
2114 ocean_assert(eps >= T(0));
2116 if (isValid() != anyCamera.
isValid())
2128 if (name() != anyCamera.
name())
2136template <
typename T,
typename TCameraWrapper>
2139 return TCameraWrapper::isValid();
2142template <
typename T,
typename TCameraWrapperBase>
2149template <
typename T,
typename TCameraWrapperBase>
2156template <
typename T,
typename TCameraWrapperBase>
2159 return VectorT2<T>(TCameraWrapperBase::principalPointX(), TCameraWrapperBase::principalPointY());
2162template <
typename T,
typename TCameraWrapperBase>
2165 ocean_assert(TCameraWrapperBase::isValid());
2180 if (T(TCameraWrapperBase::width()) <= TCameraWrapperBase::principalPointX())
2182 ocean_assert(
false &&
"Invalid principal point");
2183 return T(2) * leftAngle;
2186 const T rightAngle =
NumericT<T>::atan((T(TCameraWrapperBase::width()) - TCameraWrapperBase::principalPointX()) * TCameraWrapperBase::inverseFocalLengthX());
2188 return leftAngle + rightAngle;
2191template <
typename T,
typename TCameraWrapperBase>
2194 ocean_assert(TCameraWrapperBase::isValid());
2209 if (T(TCameraWrapperBase::height()) <= TCameraWrapperBase::principalPointY())
2211 ocean_assert(
false &&
"Invalid principal point");
2212 return T(2) * topAngle;
2215 const T bottomAngle =
NumericT<T>::atan((T(TCameraWrapperBase::height()) - TCameraWrapperBase::principalPointY()) * TCameraWrapperBase::inverseFocalLengthY());
2217 return topAngle + bottomAngle;
2220template <
typename T,
typename TCameraWrapperBase>
2223 ocean_assert(TCameraWrapperBase::isValid());
2225 const unsigned int cameraWidth = TCameraWrapperBase::width();
2226 const unsigned int cameraHeight = TCameraWrapperBase::height();
2228 ocean_assert(signedBorder < T(std::min(cameraWidth / 2u, cameraHeight / 2u)));
2230 return imagePoint.
x() >= signedBorder && imagePoint.
y() >= signedBorder
2231 && imagePoint.
x() < T(cameraWidth) - signedBorder && imagePoint.
y() < T(cameraHeight) - signedBorder;
2234template <
typename T,
typename TCameraWrapperBase>
2237 return TCameraWrapperBase::projectToImageIF(
VectorT3<T>(objectPoint.
x(), -objectPoint.
y(), -objectPoint.
z()));
2240template <
typename T,
typename TCameraWrapperBase>
2246template <
typename T,
typename TCameraWrapperBase>
2249 ocean_assert(size == 0 || objectPoints !=
nullptr);
2250 ocean_assert(size == 0 || imagePoints !=
nullptr);
2252 for (
size_t n = 0; n < size; ++n)
2255 imagePoints[n] = TCameraWrapperBase::projectToImageIF(
VectorT3<T>(objectPoint.
x(), -objectPoint.
y(), -objectPoint.
z()));
2259template <
typename T,
typename TCameraWrapperBase>
2265template <
typename T,
typename TCameraWrapperBase>
2268 const VectorT3<T> localVectorIF(TCameraWrapperBase::vectorIF(distortedImagePoint, makeUnitVector));
2270 return VectorT3<T>(localVectorIF.
x(), -localVectorIF.
y(), -localVectorIF.
z());
2273template <
typename T,
typename TCameraWrapperBase>
2276 TCameraWrapperBase::vectorIF(distortedImagePoints, size, vectors, makeUnitVector);
2278 for (
size_t n = 0; n < size; ++n)
2282 vectors[n] =
VectorT3<T>(localVectorIF.
x(), -localVectorIF.
y(), -localVectorIF.
z());
2286template <
typename T,
typename TCameraWrapperBase>
2289 ocean_assert(TCameraWrapperBase::isValid() && world_T_camera.
isValid());
2294template <
typename T,
typename TCameraWrapperBase>
2297 ocean_assert(TCameraWrapperBase::isValid());
2302template <
typename T,
typename TCameraWrapperBase>
2305 ocean_assert(flippedCameraObjectPoints !=
nullptr);
2306 ocean_assert(numberObjectPoints >= 1);
2307 ocean_assert(jacobians !=
nullptr);
2309 for (
size_t n = 0; n < numberObjectPoints; ++n)
2311 TCameraWrapperBase::pointJacobian2x3IF(flippedCameraObjectPoints[n], jacobians + 0, jacobians + 3);
2316template <
typename T>
2318 actualCamera_(std::move(actualCamera))
2323template <
typename T>
2325 actualCamera_(actualCamera)
2330template <
typename T>
2333 return actualCamera_;
2336template <
typename T>
2339 return actualCamera_.width();
2342template <
typename T>
2345 return actualCamera_.height();
2348template <
typename T>
2351 return T(actualCamera_.principalPointX());
2354template <
typename T>
2357 return T(actualCamera_.principalPointY());
2360template <
typename T>
2363 return T(actualCamera_.focalLengthX());
2366template <
typename T>
2369 return T(actualCamera_.focalLengthY());
2372template <
typename T>
2375 return T(actualCamera_.inverseFocalLengthX());
2378template <
typename T>
2381 return T(actualCamera_.inverseFocalLengthY());
2384template <
typename T>
2390template <
typename T>
2393 return VectorT2<T>(actualCamera_.template projectToImageIF<true>(flippedCamera_T_world, objectPoint,
true));
2396template <
typename T>
2399 ocean_assert(size == 0 || objectPoints !=
nullptr);
2400 ocean_assert(size == 0 || imagePoints !=
nullptr);
2402 for (
size_t n = 0; n < size; ++n)
2404 imagePoints[n] = projectToImageIF(objectPoints[n]);
2408template <
typename T>
2411 ocean_assert(size == 0 || objectPoints !=
nullptr);
2412 ocean_assert(size == 0 || imagePoints !=
nullptr);
2414 for (
size_t n = 0; n < size; ++n)
2416 imagePoints[n] = projectToImageIF(flippedCamera_T_world, objectPoints[n]);
2420template <
typename T>
2423 const VectorT2<T> undistortedImagePoint(actualCamera_.template undistort<true>(distortedImagePoint));
2425 return VectorT3<T>(actualCamera_.vectorIF(undistortedImagePoint, makeUnitVector));
2428template <
typename T>
2431 ocean_assert(distortedImagePoints !=
nullptr && size > 0);
2432 ocean_assert(vectors !=
nullptr);
2434 for (
size_t n = 0; n < size; ++n)
2436 vectors[n] = vectorIF(distortedImagePoints[n], makeUnitVector);
2440template <
typename T>
2443 ocean_assert(jx !=
nullptr && jy !=
nullptr);
2444 actualCamera_.template pointJacobian2x3IF<T, true>(flippedCameraObjectPoint, jx, jy);
2447template <
typename T>
2450 ocean_assert(eps >= T(0));
2452 return actualCamera_.isEqual(basePinhole.
actualCamera_, eps);
2455template <
typename T>
2458 return actualCamera_.isValid();
2461template <
typename T>
2462template <
typename U>
2465 ocean_assert(actualCamera_.isValid());
2467 if constexpr (std::is_same<T, U>::value)
2469 if ((width == 0u && height == 0u) || (width == actualCamera_.width() && height == actualCamera_.height()))
2471 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(actualCamera_);
2474 const unsigned int validWidth = (height * actualCamera_.width() + actualCamera_.height() / 2u) / actualCamera_.height();
2475 const unsigned int validHeight = (width * actualCamera_.height() + actualCamera_.width() / 2u) / actualCamera_.width();
2479 ocean_assert(
false &&
"Wrong aspect ratio!");
2483 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(
PinholeCameraT<U>(width, height, actualCamera_));
2489 if ((width == 0u && height == 0u) || (width == actualCamera_.width() && height == actualCamera_.height()))
2491 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(convertedPinholeCamera);
2494 const unsigned int validWidth = (height * actualCamera_.width() + actualCamera_.height() / 2u) / actualCamera_.height();
2495 const unsigned int validHeight = (width * actualCamera_.height() + actualCamera_.width() / 2u) / actualCamera_.width();
2499 ocean_assert(
false &&
"Wrong aspect ratio!");
2503 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBasePinholeT<U>>>>(
PinholeCameraT<U>(width, height, convertedPinholeCamera));
2507template <
typename T>
2513template <
typename T>
2516 return std::string(
"Ocean Pinhole");
2519template <
typename T>
2521 actualCamera_(std::move(camera))
2526template <
typename T>
2528 actualCamera_(camera)
2533template <
typename T>
2536 return actualCamera_;
2539template <
typename T>
2542 return actualCamera_.width();
2545template <
typename T>
2548 return actualCamera_.height();
2551template <
typename T>
2554 return actualCamera_.principalPoint();
2557template <
typename T>
2560 return actualCamera_.principalPointX();
2563template <
typename T>
2566 return actualCamera_.principalPointY();
2569template <
typename T>
2572 return actualCamera_.focalLengthX();
2575template <
typename T>
2578 return actualCamera_.focalLengthY();
2581template <
typename T>
2584 return actualCamera_.inverseFocalLengthX();
2587template <
typename T>
2590 return actualCamera_.inverseFocalLengthY();
2593template <
typename T>
2596 return actualCamera_.projectToImageIF(objectPoint);
2599template <
typename T>
2602 return actualCamera_.projectToImageIF(flippedCamera_T_world, objectPoint);
2605template <
typename T>
2608 ocean_assert(size == 0 || objectPoints !=
nullptr);
2609 ocean_assert(size == 0 || imagePoints !=
nullptr);
2611 for (
size_t n = 0; n < size; ++n)
2613 imagePoints[n] = projectToImageIF(objectPoints[n]);
2617template <
typename T>
2620 ocean_assert(size == 0 || objectPoints !=
nullptr);
2621 ocean_assert(size == 0 || imagePoints !=
nullptr);
2623 for (
size_t n = 0; n < size; ++n)
2625 imagePoints[n] = projectToImageIF(flippedCamera_T_world, objectPoints[n]);
2629template <
typename T>
2632 return actualCamera_.vectorIF(distortedImagePoint, makeUnitVector);
2635template <
typename T>
2638 ocean_assert(distortedImagePoints !=
nullptr && size > 0);
2639 ocean_assert(vectors !=
nullptr);
2641 for (
size_t n = 0; n < size; ++n)
2643 vectors[n] = vectorIF(distortedImagePoints[n], makeUnitVector);
2647template <
typename T>
2650 actualCamera_.pointJacobian2x3IF(flippedCameraObjectPoint, jx, jy);
2653template <
typename T>
2656 ocean_assert(eps >= T(0));
2658 return actualCamera_.isEqual(baseFisheye.
actualCamera_, eps);
2661template <
typename T>
2664 return actualCamera_.isValid();
2667template <
typename T>
2668template <
typename U>
2671 ocean_assert(actualCamera_.isValid());
2673 if ((width == 0u && height == 0u) || (width == actualCamera_.width() && height == actualCamera_.height()))
2675 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBaseFisheyeT<U>>>>(
FisheyeCameraT<U>(actualCamera_));
2678 const unsigned int validWidth = (height * actualCamera_.width() + actualCamera_.height() / 2u) / actualCamera_.height();
2682 ocean_assert(
false &&
"Wrong aspect ratio!");
2686 const T xFactor = T(width) / T(actualCamera_.width());
2687 const T yFactor = T(height) / T(actualCamera_.height());
2689 const U newPrincipalX = U(actualCamera_.principalPointX() * xFactor);
2690 const U newPrincipalY = U(actualCamera_.principalPointY() * yFactor);
2692 const U newFocalLengthX = U(actualCamera_.focalLengthX() * xFactor);
2693 const U newFocalLengthY = U(actualCamera_.focalLengthY() * yFactor);
2695 U radialDistortion[6];
2696 for (
unsigned int n = 0u; n < 6u; ++n)
2698 radialDistortion[n] = U(actualCamera_.radialDistortion()[n]);
2701 const U tangentialDistortion[2] =
2703 U(actualCamera_.tangentialDistortion()[0]),
2704 U(actualCamera_.tangentialDistortion()[1])
2707 return std::make_unique<AnyCameraWrappingT<U, CameraWrapperT<U, CameraWrapperBaseFisheyeT<U>>>>(
FisheyeCameraT<U>(width, height, newFocalLengthX, newFocalLengthY, newPrincipalX, newPrincipalY, radialDistortion, tangentialDistortion));
2710template <
typename T>
2716template <
typename T>
2719 return std::string(
"Ocean Fisheye");
2722template <
typename T>
2724 actualCamera_(std::move(camera))
2729template <
typename T>
2731 actualCamera_(camera)
2736template <
typename T>
2739 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2741 ocean_assert(
false &&
"This function must never be called.");
2743 return actualCamera_;
2746template <
typename T>
2749 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2751 ocean_assert(
false &&
"This function must never be called.");
2753 return (
unsigned int)(-1);
2756template <
typename T>
2759 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2761 ocean_assert(
false &&
"This function must never be called.");
2763 return (
unsigned int)(-1);
2766template <
typename T>
2769 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2771 ocean_assert(
false &&
"This function must never be called.");
2776template <
typename T>
2779 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2781 ocean_assert(
false &&
"This function must never be called.");
2786template <
typename T>
2789 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2791 ocean_assert(
false &&
"This function must never be called.");
2796template <
typename T>
2799 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2801 ocean_assert(
false &&
"This function must never be called.");
2806template <
typename T>
2809 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2811 ocean_assert(
false &&
"This function must never be called.");
2816template <
typename T>
2819 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2821 ocean_assert(
false &&
"This function must never be called.");
2826template <
typename T>
2829 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2831 ocean_assert(
false &&
"This function must never be called.");
2836template <
typename T>
2839 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2841 ocean_assert(
false &&
"This function must never be called.");
2846template <
typename T>
2849 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2851 ocean_assert(
false &&
"This function must never be called.");
2856template <
typename T>
2859 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2861 ocean_assert(
false &&
"This function must never be called.");
2865template <
typename T>
2868 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2870 ocean_assert(
false &&
"This function must never be called.");
2873template <
typename T>
2876 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2878 ocean_assert(
false &&
"This function must never be called.");
2883template <
typename T>
2886 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2888 ocean_assert(
false &&
"This function must never be called.");
2891template <
typename T>
2894 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2896 ocean_assert(
false &&
"This function must never be called.");
2899template <
typename T>
2902 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2904 ocean_assert(
false &&
"This function must never be called.");
2909template <
typename T>
2915template <
typename T>
2916template <
typename U>
2919 Log::error() <<
"Invalid camera: " << actualCamera_.reason();
2921 ocean_assert(
false &&
"This function must never be called.");
2926template <
typename T>
2932template <
typename T>
2935 return std::string(
"Invalid camera");
2938template <
typename T>
2945template <
typename T>
This class implements the abstract base class for all AnyCamera objects.
Definition AnyCamera.h:130
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
Returns the width of the camera image.
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.
T TScalar
The scalar data type of this object.
Definition AnyCamera.h:134
virtual unsigned int height() const =0
Returns the height of the camera image.
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:1892
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:597
VectorT2< T > principalPoint() const override
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:1956
void pointJacobian2nx3IF(const VectorT3< T > *flippedCameraObjectPoints, const size_t numberObjectPoints, T *jacobians) const override
Calculates the 2n x 3 jacobian matrix for the 3D object point projection into the camera frame.
Definition AnyCamera.h:2106
VectorT2< T > projectToImage(const VectorT3< T > &objectPoint) const override
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2016
bool isEqual(const AnyCameraT< T > &anyCamera, const T eps=NumericT< T >::eps()) const override
Returns whether two camera objects are identical up to a given epsilon.
Definition AnyCamera.h:2112
unsigned int width() const override
Returns the width of the camera image.
Definition AnyCamera.h:1944
unsigned int height() const override
Returns the height of the camera image.
Definition AnyCamera.h:1950
std::unique_ptr< AnyCameraT< float > > cloneToFloat(const unsigned int width=0u, const unsigned int height=0u) const override
Returns a copy of this camera object with float precision.
Definition AnyCamera.h:1932
std::unique_ptr< AnyCameraT< T > > clone(const unsigned int width=0u, const unsigned int height=0u) const override
Returns a copy of this camera object.
Definition AnyCamera.h:1926
T focalLengthY() const override
Returns the vertical focal length parameter.
Definition AnyCamera.h:1980
bool isValid() const override
Returns whether this camera is valid.
Definition AnyCamera.h:2137
AnyCameraType anyCameraType() const override
Returns the type of this camera.
Definition AnyCamera.h:1914
T inverseFocalLengthX() const override
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:1986
T principalPointY() const override
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:1968
AnyCameraWrappingT(ActualCamera &&actualCamera)
Creates a new AnyCamera object wrapping the actual camera model.
Definition AnyCamera.h:1900
VectorT3< T > vector(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const override
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2064
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const override
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2028
T TScalar
The scalar data type of this object.
Definition AnyCamera.h:601
T focalLengthX() const override
Returns the horizontal focal length parameter.
Definition AnyCamera.h:1974
T fovX() const override
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:1998
bool isInside(const VectorT2< T > &imagePoint, const T signedBorder=T(0)) const override
Returns whether a given 2D image point lies inside the camera frame.
Definition AnyCamera.h:2010
std::string name() const override
Returns the name of this camera.
Definition AnyCamera.h:1920
LineT3< T > ray(const VectorT2< T > &distortedImagePoint, const HomogenousMatrixT4< T > &world_T_camera) const override
Returns a ray starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2088
VectorT3< T > vectorIF(const VectorT2< T > &distortedImagePoint, const bool makeUnitVector=true) const override
Returns a vector starting at the camera's center and intersecting a given 2D point in the image.
Definition AnyCamera.h:2076
typename TCameraWrapper::ActualCamera ActualCamera
The actual camera object wrapped by this class.
Definition AnyCamera.h:607
T principalPointX() const override
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:1962
std::unique_ptr< AnyCameraT< double > > cloneToDouble(const unsigned int width=0u, const unsigned int height=0u) const override
Returns a copy of this camera object with double precision.
Definition AnyCamera.h:1938
void pointJacobian2x3IF(const VectorT3< T > &flippedCameraObjectPoint, T *jx, T *jy) const override
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.
Definition AnyCamera.h:2100
T fovY() const override
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:2004
T inverseFocalLengthY() const override
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:1992
This class implements a helper class allowing to check whether a 3D object point projects into the ca...
Definition AnyCamera.h:516
const SharedAnyCameraT< T > & camera() const
Returns the camera model of this checker.
Definition AnyCamera.h:1736
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:1756
CameraProjectionCheckerT()=default
Default constructor creating an invalid object.
bool isValid() const
Returns whether this checker holds a valid camera model and is ready to be used.
Definition AnyCamera.h:1748
FiniteLinesT2< T > cameraBoundarySegments_
The 2D line segments defined in the camera's normalized image plane defining the camera's boundary.
Definition AnyCamera.h:583
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:1742
SharedAnyCameraT< T > camera_
The actual camera model this checker is based on.
Definition AnyCamera.h:580
static bool isInside(const FiniteLinesT2< T > &cameraBoundarySegments, const VectorT2< T > &imagePoint)
Returns whether a given normalized image point lies inside the camera's boundary.
Definition AnyCamera.h:1820
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:1703
This class implements the base class for all cameras.
Definition Camera.h:54
This class implements the base wrapper around Ocean's fisheye camera profile.
Definition AnyCamera.h:1206
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2558
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:2582
ActualCamera actualCamera_
The actual fisheye camera object.
Definition AnyCamera.h:1369
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2546
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:2648
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2540
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:2662
FisheyeCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1212
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:2588
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:2711
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:2630
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2534
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2552
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2564
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:2717
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:2570
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:2576
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2594
CameraWrapperBaseFisheyeT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBaseFisheyeT object wrapping the actual camera model.
Definition AnyCamera.h:2520
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:2669
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:2654
This class implements the base wrapper around an invalid camera profile.
Definition AnyCamera.h:1429
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:2900
InvalidCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1435
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2837
CameraWrapperBaseInvalidT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBaseInvalidT object wrapping the actual camera model.
Definition AnyCamera.h:2723
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2757
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2737
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:2933
ActualCamera actualCamera_
The actual invalid camera.
Definition AnyCamera.h:1592
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2777
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2767
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:2817
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:2910
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:2927
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:2917
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:2827
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:2892
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:2874
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:2807
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2787
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:2797
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2747
This class implements the base wrapper around Ocean's pinhole camera profile.
Definition AnyCamera.h:1037
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition AnyCamera.h:2373
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:2441
PinholeCameraT< T > ActualCamera
Definition of the actual camera object wrapped by this class.
Definition AnyCamera.h:1043
unsigned int height() const
Returns the height of the camera image.
Definition AnyCamera.h:2343
bool isValid() const
Returns whether this camera is valid.
Definition AnyCamera.h:2456
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2355
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition AnyCamera.h:2379
static std::string name()
Returns the name of this camera.
Definition AnyCamera.h:2514
ActualCamera actualCamera_
The actual pinhole camera.
Definition AnyCamera.h:1195
const ActualCamera & actualCamera() const
Returns the actual camera object wrapped in this class.
Definition AnyCamera.h:2331
unsigned int width() const
Returns the width of the camera image.
Definition AnyCamera.h:2337
CameraWrapperBasePinholeT(ActualCamera &&actualCamera)
Creates a new CameraWrapperBasePinholeT object wrapping the actual camera model.
Definition AnyCamera.h:2317
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:2421
VectorT2< T > projectToImageIF(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2385
static AnyCameraType anyCameraType()
Returns the type of this camera.
Definition AnyCamera.h:2508
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2349
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:2448
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:2463
T focalLengthY() const
Returns the vertical focal length parameter.
Definition AnyCamera.h:2367
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition AnyCamera.h:2361
This class implements a wrapper for an actual camera object.
Definition AnyCamera.h:928
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:2287
T fovY() const
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:2192
T fovX() const
Returns the field of view in x direction of the camera.
Definition AnyCamera.h:2163
CameraWrapperT(ActualCamera &&actualCamera)
Creates a new CameraWrapperT object wrapping the actual camera model.
Definition AnyCamera.h:2143
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:2266
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:2303
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:2221
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition AnyCamera.h:2157
VectorT2< T > projectToImage(const VectorT3< T > &objectPoint) const
Projects a 3D object point into the camera frame.
Definition AnyCamera.h:2235
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: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 invalid camera profiles, e.g.
Definition AnyCamera.h:1379
const std::string & reason() const
Returns the reason of this invalid camera.
Definition AnyCamera.h:2946
std::string reason_
The reason why no valid camera is available.
Definition AnyCamera.h:1397
InvalidCameraT(const std::string &reason)
Creates an invalid camera.
Definition AnyCamera.h:2939
This class implements an infinite line in 3D space.
Definition Line3.h:68
static MessageObject error()
Returns the message for error messages.
Definition Messenger.h:1074
This class provides basic numeric functionalities.
Definition Numeric.h:57
static constexpr T minValue()
Returns the min scalar value.
Definition Numeric.h:3253
static T atan(const T value)
Returns the arctangent of a given value.
Definition Numeric.h:1616
static T abs(const T value)
Returns the absolute value of a given value.
Definition Numeric.h:1220
static bool isEqual(const T first, const T second)
Returns whether two values are equal up to a small epsilon.
Definition Numeric.h:2389
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:710
const T & y() const noexcept
Returns the y value.
Definition Vector2.h:722
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
const T & z() const noexcept
Returns the z value.
Definition Vector3.h:836
std::shared_ptr< AnyCameraD > SharedAnyCameraD
Definition of a shared pointer holding an AnyCamera object with double precision.
Definition AnyCamera.h:67
std::shared_ptr< AnyCamera > SharedAnyCamera
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:60
std::vector< FiniteLineT2< T > > FiniteLinesT2
Definition of a typename alias for vectors with FiniteLineT2 objects.
Definition FiniteLine2.h:50
std::vector< VectorT2< T > > VectorsT2
Definition of a typename alias for vectors with VectorT2 objects.
Definition Vector2.h:57
SharedAnyCamerasT< float > SharedAnyCamerasF
Definition of a vector holding AnyCameraF objects.
Definition AnyCamera.h:104
SharedAnyCamerasT< double > SharedAnyCamerasD
Definition of a vector holding AnyCameraD objects.
Definition AnyCamera.h:97
AnyCameraType
Definition of individual camera types.
Definition AnyCamera.h:111
std::shared_ptr< AnyCameraF > SharedAnyCameraF
Definition of a shared pointer holding an AnyCamera object with float precision.
Definition AnyCamera.h:74
std::vector< std::shared_ptr< AnyCameraT< T > > > SharedAnyCamerasT
Definition of a typename alias for vectors with shared AnyCameraT objects.
Definition AnyCamera.h:83
SharedAnyCamerasT< Scalar > SharedAnyCameras
Definition of a vector holding AnyCamera objects.
Definition AnyCamera.h:90
std::shared_ptr< AnyCameraT< T > > SharedAnyCameraT
Definition of a shared pointer holding an AnyCamera object with Scalar precision.
Definition AnyCamera.h:53
@ FISHEYE
A fisheye camera.
@ PINHOLE
A pinhole camera.
@ INVALID
An invalid camera type.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15