8 #ifndef META_OCEAN_MATH_PINHOLE_CAMERA_H
9 #define META_OCEAN_MATH_PINHOLE_CAMERA_H
32 template <
typename T>
class PinholeCameraT;
112 template <
typename T>
135 OS_FOCAL_LENGTHS = 2,
137 OS_INTRINSIC_PARAMETERS = 4,
139 OS_FOCAL_LENGTHS_DISTORTION = 6,
141 OS_SYMMETRIC_INTRINSIC_PARAMETERS_DISTORTIONS = 7,
143 OS_INTRINSIC_PARAMETERS_DISTORTIONS = 8,
145 OS_DISTORTION = 0x1000 | 4,
147 OS_INTRINSIC_PARAMETERS_RADIAL_DISTORTION = 0x1000 | 6
167 inline DistortionLookup();
247 PinholeCameraT(
const unsigned int width,
const unsigned int height,
const T focalX,
const T focalY,
const T principalX,
const T principalY);
270 PinholeCameraT(
const unsigned int width,
const unsigned int height,
const T* parameters,
const bool radialDistortion =
true,
const bool tangentialDistortion =
true);
303 PinholeCameraT(
const unsigned int width,
const unsigned int height,
const T fovX);
315 PinholeCameraT(
const unsigned int width,
const unsigned int height,
const T fovX,
const T principalX,
const T principalY);
323 template <
typename U>
470 void copyElements(T* arrayValues,
const bool copyRadialDistortion =
true,
const bool copyTangentialDistortion =
true)
const;
507 bool isDistortionPlausible(
const T symmetricFocalLengthRatio = T(1.05),
const T modelAccuracy = T(0.001),
const T symmetricDistortionRatio = T(1.08))
const;
519 template <
bool tUseBorderDistortionIfOuts
ide>
549 template <
bool tUseBorderDistortionIfOuts
ide>
606 template <
bool tUseBorderDistortionIfOuts
ide>
625 template <
bool tUseBorderDistortionIfOuts
ide>
636 template <
bool tUseBorderDistortionIfOuts
ide>
654 template <
bool tUseBorderDistortionIfOuts
ide>
671 template <
bool tUseBorderDistortionIfOuts
ide>
688 template <
bool tUseBorderDistortionIfOuts
ide>
706 template <
bool tUseBorderDistortionIfOuts
ide>
722 template <
bool tUseBorderDistortionIfOuts
ide>
740 template <
bool tUseBorderDistortionIfOuts
ide>
757 template <
bool tDistortImagePo
int,
bool tUseBorderDistortionIfOuts
ide>
774 template <
bool tUseBorderDistortionIfOuts
ide>
791 template <
bool tUseBorderDistortionIfOuts
ide>
804 template <
bool tUseBorderDistortionIfOuts
ide>
822 template <
bool tUseBorderDistortionIfOuts
ide>
838 template <
bool tUseBorderDistortionIfOuts
ide>
1105 template <
typename U,
bool tUseDistortionParameters>
1132 explicit inline operator bool()
const;
1155 template <
bool tUseBorderDistortionIfOuts
ide>
1199 VectorT2<T> dampedNormalized(
const VectorT2<T>& normalized,
const T dampingFactor,
const T leftNormalizedBorder,
const T rightNormalizedBorder,
const T topNormalizedBorder,
const T bottomNormalizedBorder)
const;
1210 unsigned int width_ = 0u;
1213 unsigned int height_ = 0u;
1222 template <
typename T>
1228 template <
typename T>
1231 ocean_assert(distortionLookupTable);
1232 return distortionLookupTable.bilinearValue(distortedImagePoint.
x(), distortedImagePoint.
y()) + distortedImagePoint;
1235 template <
typename T>
1238 ocean_assert(distortionLookupTable);
1239 return distortionLookupTable.bilinearValue(distortedImagePoint.
x(), distortedImagePoint.
y());
1242 template <
typename T>
1245 ocean_assert(distortionLookupTable);
1246 return distortionLookupTable.bicubicValue(distortedImagePoint.
x(), distortedImagePoint.
y()) + distortedImagePoint;
1249 template <
typename T>
1252 ocean_assert(distortionLookupTable);
1253 return distortionLookupTable.bicubicValue(distortedImagePoint.
x(), distortedImagePoint.
y());
1256 template <
typename T>
1262 template <
typename T>
1268 template <
typename T>
1274 template <
typename T>
1280 template <
typename T>
1281 template <
typename U>
1285 if (copyDistortionParameters)
1292 template <
typename T>
1295 return radialDistortion_.first != 0 || radialDistortion_.second != 0
1296 || tangentialDistortion_.first != 0 || tangentialDistortion_.second != 0;
1299 template <
typename T>
1305 template <
typename T>
1311 template <
typename T>
1314 return VectorT2<T>(principalPointX(), principalPointY());
1317 template <
typename T>
1320 return intrinsics_(6);
1323 template <
typename T>
1326 return intrinsics_(7);
1329 template <
typename T>
1332 return intrinsics_(0);
1335 template <
typename T>
1338 return intrinsics_(4);
1341 template <
typename T>
1344 ocean_assert((std::is_same<T, float>::value) || intrinsics_.
inverted() == invertedIntrinsics_);
1347 return invertedIntrinsics_(0);
1350 template <
typename T>
1353 ocean_assert((std::is_same<T, float>::value) || intrinsics_.
inverted() == invertedIntrinsics_);
1356 return invertedIntrinsics_(4);
1359 template <
typename T>
1362 radialDistortion_ = radial;
1365 template <
typename T>
1368 tangentialDistortion_ = tangential;
1371 template <
typename T>
1372 template <
bool tUseBorderDistortionIfOuts
ide>
1375 ocean_assert(iterations >= 1u && iterations <= 1000u && zoom >
NumericT<T>::eps());
1378 if (!hasDistortionParameters())
1383 const T invZoom = T(1) / zoom;
1385 const VectorT2<T> nDistorted((distorted.
x() - principalPointX()) * inverseFocalLengthX() * invZoom, (distorted.
y() - principalPointY()) * inverseFocalLengthY() * invZoom);
1387 const VectorT2<T> nMainOffset(distortNormalized<tUseBorderDistortionIfOutside>(nDistorted, invZoom) - nDistorted);
1388 VectorT2<T> nIntermediateUndistorted(nDistorted - nMainOffset);
1390 unsigned int i = 0u;
1392 while (i++ < iterations)
1394 const VectorT2<T> nIntermediateDistorted(distortNormalized<tUseBorderDistortionIfOutside>(nIntermediateUndistorted, invZoom));
1395 const VectorT2<T> nIntermediateOffset(nDistorted - nIntermediateDistorted);
1397 nIntermediateUndistorted = nIntermediateUndistorted + nIntermediateOffset * T(0.75);
1399 const T offsetPixelX =
NumericT<T>::abs(nIntermediateOffset.
x() * focalLengthX());
1400 const T offsetPixelY =
NumericT<T>::abs(nIntermediateOffset.
y() * focalLengthY());
1402 if (offsetPixelX < 0.05 && offsetPixelY < 0.05)
1407 if (offsetPixelX > T(width_ * 10u) || offsetPixelY > T(height_ * 10u))
1413 return VectorT2<T>(nIntermediateUndistorted.
x() * focalLengthX() * zoom + principalPointX(), nIntermediateUndistorted.
y() * focalLengthY() * zoom + principalPointY());
1416 template <
typename T>
1417 template <
bool tUseBorderDistortionIfOuts
ide>
1420 if (hasDistortionParameters())
1422 if constexpr (tUseBorderDistortionIfOutside)
1424 const VectorT2<T> nUndistorted((undistorted.
x() - principalPointX()) * inverseFocalLengthX(),
1425 (undistorted.
y() - principalPointY()) * inverseFocalLengthY());
1427 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX(), nUndistorted.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX()),
1428 minmax(-principalPointY() * inverseFocalLengthY(), nUndistorted.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY()));
1430 const T
sqr = clampedNormalizedImagePoint.
sqr();
1432 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1434 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
1435 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
1437 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
1438 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
1440 return VectorT2<T>((nUndistorted.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX(),
1441 (nUndistorted.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY());
1445 const VectorT2<T> nUndistorted((undistorted.
x() - principalPointX()) * inverseFocalLengthX(),
1446 (undistorted.
y() - principalPointY()) * inverseFocalLengthY());
1448 const T
sqr = nUndistorted.
sqr();
1450 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1452 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * nUndistorted.
x() * nUndistorted.
y()
1455 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(nUndistorted.
y()))
1456 + tangentialDistortion_.second * 2 * nUndistorted.
x() * nUndistorted.
y();
1458 return VectorT2<T>((nUndistorted.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX(),
1459 (nUndistorted.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY());
1468 template <
typename T>
1471 ocean_assert(isValid());
1472 ocean_assert(signedBorder < T(std::min(width_ / 2u, height_ / 2u)));
1474 return imagePoint.
x() >= signedBorder && imagePoint.
y() >= signedBorder
1475 && imagePoint.
x() < T(width_) - signedBorder && imagePoint.
y() < T(height_) - signedBorder;
1478 template <
typename T>
1485 debugCameraMatrix(0, 0) *= zoom;
1486 debugCameraMatrix(1, 1) *= zoom;
1487 debugCameraMatrix[15] = 1;
1493 ocean_assert(transformationMatrix.
isValid());
1495 ocean_assert(transformationMatrix == debugTransformationMatrix);
1501 template <
typename T>
1502 template <
typename U,
bool tUseDistortionParameters>
1505 ocean_assert(isValid());
1506 ocean_assert(jx !=
nullptr && jy !=
nullptr);
1508 if (tUseDistortionParameters && hasDistortionParameters())
1510 const U x = U(flippedCameraObjectPoint.
x());
1511 const U y = U(flippedCameraObjectPoint.
y());
1512 const U z = U(flippedCameraObjectPoint.
z());
1514 const U fx = U(focalLengthX());
1515 const U fy = U(focalLengthY());
1517 const U k1 = U(radialDistortion().first);
1518 const U k2 = U(radialDistortion().second);
1520 const U p1 = U(tangentialDistortion().first);
1521 const U p2 = U(tangentialDistortion().second);
1524 const U invZ = U(1) / z;
1526 const U u = x * invZ;
1527 const U v = y * invZ;
1529 const U dist1_u = U(1) + U(6) * p2 * u + U(2) * p1 * v + k1 * (U(3) * u * u + v * v) + k2 * (u * u + v * v) * (U(5) * u * u + v * v);
1530 const U dist2_u_1_v = U(2) * (p1 * u + v * (p2 + u * (k1 + U(2) * k2 * (u * u + v * v))));
1531 const U dist2_v = U(1) + U(2) * p2 * u + U(6) * p1 * v + k1 * (u * u + U(3) * v * v) + k2 * (u * u + v * v) * (u * u + U(5) * v * v);
1533 const U Fx_w_dist1_u = fx * invZ * dist1_u;
1534 const U Fy_w_dist2_u = fy * invZ * dist2_u_1_v;
1536 const U Fx_w_dist1_v = fx * invZ * dist2_u_1_v;
1537 const U Fy_w_dist2_v = fy * invZ * dist2_v;
1539 const U Fx_w2__ = -fx * invZ * invZ * (x * dist1_u + y * dist2_u_1_v);
1540 const U Fy_w2__ = -fy * invZ * invZ * (x * dist2_u_1_v + y * dist2_v);
1542 jx[0] = Fx_w_dist1_u;
1543 jx[1] = Fx_w_dist1_v;
1546 jy[0] = Fy_w_dist2_u;
1547 jy[1] = Fy_w_dist2_v;
1553 const U invZ = U(1) / U(flippedCameraObjectPoint.
z());
1555 const U fx_z = U(focalLengthX()) * invZ;
1556 const U fy_z = U(focalLengthY()) * invZ;
1558 const U fx_x_z2 = -fx_z * U(flippedCameraObjectPoint.
x()) * invZ;
1559 const U fy_y_z2 = -fy_z * U(flippedCameraObjectPoint.
y()) * invZ;
1571 template <
typename T>
1574 return width_ != 0u && height_ != 0u;
1577 template <
typename T>
1578 template <
bool tUseBorderDistortionIfOuts
ide>
1581 if (undistortImagePoint)
1583 return invertedIntrinsics_ * undistort<tUseBorderDistortionIfOutside>(imagePoint);
1586 return invertedIntrinsics_ * imagePoint;
1589 template <
typename T>
1592 if (undistortImagePoint)
1594 return invertedIntrinsics_ * undistortDamped(imagePoint);
1597 return invertedIntrinsics_ * imagePoint;
1600 template <
typename T>
1601 template <
bool tUseBorderDistortionIfOuts
ide>
1604 ocean_assert(isValid());
1606 if (distortImagePoints)
1608 if constexpr (tUseBorderDistortionIfOutside)
1610 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX(), normalizedImagePoint.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX()),
1611 minmax(-principalPointY() * inverseFocalLengthY(), normalizedImagePoint.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY()));
1614 if (tangentialDistortion_.first == 0 && tangentialDistortion_.second == 0)
1616 const T
sqr = clampedNormalizedImagePoint.
sqr();
1617 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1619 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() + principalPointX(),
1620 (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() + principalPointY());
1624 ocean_assert(tangentialDistortion_.first != 0 || tangentialDistortion_.second != 0);
1626 const T
sqr = clampedNormalizedImagePoint.
sqr();
1627 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1629 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
1630 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
1632 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
1633 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
1635 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX(),
1636 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY());
1642 if (tangentialDistortion_.first == 0 && tangentialDistortion_.second == 0)
1644 const T
sqr = normalizedImagePoint.
sqr();
1645 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1647 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() + principalPointX(),
1648 (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() + principalPointY());
1652 ocean_assert(tangentialDistortion_.first != 0 || tangentialDistortion_.second != 0);
1654 const T
sqr = normalizedImagePoint.
sqr();
1655 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1657 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y()
1660 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedImagePoint.
y()))
1661 + tangentialDistortion_.second * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y();
1663 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX(),
1664 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY());
1670 return VectorT2<T>(normalizedImagePoint.
x() * focalLengthX() + principalPointX(), normalizedImagePoint.
y() * focalLengthY() + principalPointY());
1674 template <
typename T>
1675 template <
bool tUseBorderDistortionIfOuts
ide>
1678 ocean_assert(numberNormalizedImagePoints == 0u || (normalizedImagePoints && imagePoints));
1680 const T leftClamping = -principalPointX() * inverseFocalLengthX();
1681 const T rightClamping = (T(width_) - principalPointX()) * inverseFocalLengthX();
1682 const T topClamping = -principalPointY() * inverseFocalLengthY();
1683 const T bottomClamping = (T(height_) - principalPointY()) * inverseFocalLengthY();
1685 if (distortImagePoints && hasDistortionParameters())
1688 if (tangentialDistortion_.first == 0 && tangentialDistortion_.second == 0)
1690 T
sqr, radialDistortionFactor;
1692 for (
unsigned int n = 0u; n < numberNormalizedImagePoints; ++n)
1694 const VectorT2<T>& normalizedImagePoint(normalizedImagePoints[n]);
1696 if constexpr (tUseBorderDistortionIfOutside)
1698 const VectorT2<T> clampedNormalizedImagePoint(
minmax(leftClamping, normalizedImagePoint.
x(), rightClamping),
minmax(topClamping, normalizedImagePoint.
y(), bottomClamping));
1700 sqr = clampedNormalizedImagePoint.
sqr();
1701 radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1703 imagePoints[n].
x() = (normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() + principalPointX();
1704 imagePoints[n].
y() = (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() + principalPointY();
1708 sqr = normalizedImagePoint.
sqr();
1709 radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1711 imagePoints[n].
x() = (normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() + principalPointX();
1712 imagePoints[n].
y() = (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() + principalPointY();
1718 ocean_assert(tangentialDistortion_.first != 0 || tangentialDistortion_.second != 0);
1719 T
sqr, radialDistortionFactor, tangentialDistortionCorrectionX, tangentialDistortionCorrectionY;
1721 for (
unsigned int n = 0u; n < numberNormalizedImagePoints; ++n)
1723 const VectorT2<T>& normalizedImagePoint(normalizedImagePoints[n]);
1725 if constexpr (tUseBorderDistortionIfOutside)
1727 const VectorT2<T> clampedNormalizedImagePoint(
minmax(leftClamping, normalizedImagePoint.
x(), rightClamping),
minmax(topClamping, normalizedImagePoint.
y(), bottomClamping));
1729 sqr = clampedNormalizedImagePoint.
sqr();
1730 radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1732 tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
1733 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
1735 tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
1736 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
1738 imagePoints[n].
x() = (normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX();
1739 imagePoints[n].
y() = (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY();
1743 sqr = normalizedImagePoint.
sqr();
1744 radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1746 tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y()
1749 tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedImagePoint.
y()))
1750 + tangentialDistortion_.second * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y();
1752 imagePoints[n].
x() = (normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() + principalPointX();
1753 imagePoints[n].
y() = (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() + principalPointY();
1760 for (
unsigned int n = 0u; n < numberNormalizedImagePoints; ++n)
1762 const VectorT2<T>& normalizedImagePoint(normalizedImagePoints[n]);
1764 imagePoints[n].
x() = normalizedImagePoint.
x() * focalLengthX() + principalPointX();
1765 imagePoints[n].
y() = normalizedImagePoint.
y() * focalLengthY() + principalPointY();
1770 template <
typename T>
1771 template <
bool tUseBorderDistortionIfOuts
ide>
1778 template <
typename T>
1779 template <
bool tUseBorderDistortionIfOuts
ide>
1786 template <
typename T>
1787 template <
bool tUseBorderDistortionIfOuts
ide>
1794 template <
typename T>
1795 template <
bool tUseBorderDistortionIfOuts
ide>
1799 ocean_assert(numberObjectPoints == 0u || (worldObjectPoints !=
nullptr && imagePoints !=
nullptr));
1801 return projectToImageIF<tUseBorderDistortionIfOutside>(
CameraT<T>::standard2InvertedFlipped(world_T_camera), worldObjectPoints, numberObjectPoints, distortImagePoints, imagePoints, zoom);
1804 template <
typename T>
1805 template <
bool tUseBorderDistortionIfOuts
ide>
1809 ocean_assert(worldLine.
isValid());
1814 template <
typename T>
1815 template <
bool tUseBorderDistortionIfOuts
ide>
1820 const VectorT3<T> transformedObjectPoint(flippedCamera_T_world * worldObjectPoint);
1823 const T factor = T(1) / transformedObjectPoint.
z();
1825 const VectorT2<T> normalizedImagePoint(transformedObjectPoint.
x() * factor, transformedObjectPoint.
y() * factor);
1827 if (!distortImagePoint)
1829 return VectorT2<T>(normalizedImagePoint.
x() * focalLengthX() * zoom + principalPointX(), normalizedImagePoint.
y() * focalLengthY() * zoom + principalPointY());
1832 if constexpr (tUseBorderDistortionIfOutside)
1834 const T invZoom = T(1) / zoom;
1836 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX() * invZoom, normalizedImagePoint.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX() * invZoom),
1837 minmax(-principalPointY() * inverseFocalLengthY() * invZoom, normalizedImagePoint.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY() * invZoom));
1839 const T
sqr = clampedNormalizedImagePoint.
sqr();
1841 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1843 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
1844 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
1846 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
1847 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
1849 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
1850 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
1854 const T
sqr = normalizedImagePoint.
sqr();
1856 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1858 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y()
1861 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedImagePoint.
y()))
1862 + tangentialDistortion_.second * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y();
1864 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
1865 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
1869 template <
typename T>
1870 template <
bool tUseBorderDistortionIfOuts
ide>
1874 ocean_assert(worldObjectBox.
isValid());
1877 const unsigned int numberBoxImagePoints = worldObjectBox.
corners(boxObjectCorners);
1880 for (
unsigned int n = 0; n < numberBoxImagePoints; ++n)
1882 result += projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, boxObjectCorners[n], distortImagePoint, zoom);
1888 template <
typename T>
1889 template <
bool tUseBorderDistortionIfOuts
ide>
1893 ocean_assert(worldObjectTriangle.
isValid());
1895 return TriangleT2<T>(projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, worldObjectTriangle.
point0(), distortImagePoint, zoom),
1896 projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, worldObjectTriangle.
point1(), distortImagePoint, zoom),
1897 projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, worldObjectTriangle.
point2(), distortImagePoint, zoom));
1900 template <
typename T>
1901 template <
bool tUseBorderDistortionIfOuts
ide>
1906 if (distortImagePoint)
1908 if constexpr (tUseBorderDistortionIfOutside)
1910 const T invZoom = T(1) / zoom;
1912 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX() * invZoom, normalizedObjectPoint.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX() * invZoom),
1913 minmax(-principalPointY() * inverseFocalLengthY() * invZoom, normalizedObjectPoint.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY() * invZoom));
1915 const T
sqr = clampedNormalizedImagePoint.
sqr();
1917 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1919 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
1920 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
1922 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
1923 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
1925 return VectorT2<T>((normalizedObjectPoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
1926 (normalizedObjectPoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
1930 const T
sqr = normalizedObjectPoint.
sqr();
1932 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1934 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedObjectPoint.
x() * normalizedObjectPoint.
y()
1937 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedObjectPoint.
y()))
1938 + tangentialDistortion_.second * 2 * normalizedObjectPoint.
x() * normalizedObjectPoint.
y();
1940 return VectorT2<T>((normalizedObjectPoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
1941 (normalizedObjectPoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
1946 return VectorT2<T>(normalizedObjectPoint.
x() * focalLengthX() * zoom + principalPointX(), normalizedObjectPoint.
y() * focalLengthY() * zoom + principalPointY());
1950 template <
typename T>
1951 template <
bool tUseBorderDistortionIfOuts
ide>
1955 ocean_assert((worldObjectPoints !=
nullptr && imagePoints !=
nullptr) || numberObjectPoints == 0u);
1957 if (distortImagePoints && hasDistortionParameters())
1959 const T invZoom = T(1) / zoom;
1961 const T leftClamping = -principalPointX() * inverseFocalLengthX() * invZoom;
1962 const T rightClamping = (T(width_) - principalPointX()) * inverseFocalLengthX() * invZoom;
1963 const T topClamping = -principalPointY() * inverseFocalLengthY() * invZoom;
1964 const T bottomClamping = (T(height_) - principalPointY()) * inverseFocalLengthY() * invZoom;
1967 if (tangentialDistortion_.first == 0 && tangentialDistortion_.second == 0)
1969 for (
size_t n = 0; n < numberObjectPoints; ++n)
1971 const VectorT3<T> objectPoint(flippedCamera_T_world * worldObjectPoints[n]);
1974 const T factor = 1 / objectPoint.
z();
1976 const VectorT2<T> normalizedImagePoint(objectPoint.
x() * factor, objectPoint.
y() * factor);
1978 if constexpr (tUseBorderDistortionIfOutside)
1980 const VectorT2<T> clampedNormalizedImagePoint(
minmax(leftClamping, normalizedImagePoint.
x(), rightClamping),
minmax(topClamping, normalizedImagePoint.
y(), bottomClamping));
1982 const T
sqr = clampedNormalizedImagePoint.
sqr();
1983 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1985 *imagePoints =
VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() * zoom + principalPointX(),
1986 (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() * zoom + principalPointY());
1990 const T
sqr = normalizedImagePoint.
sqr();
1991 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
1993 *imagePoints =
VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor) * focalLengthX() * zoom + principalPointX(),
1994 (normalizedImagePoint.
y() * radialDistortionFactor) * focalLengthY() * zoom + principalPointY());
2002 ocean_assert(tangentialDistortion_.first != 0 || tangentialDistortion_.second != 0);
2004 for (
size_t n = 0; n < numberObjectPoints; ++n)
2006 const VectorT3<T> objectPoint(flippedCamera_T_world * worldObjectPoints[n]);
2009 const T factor = 1 / objectPoint.
z();
2011 const VectorT2<T> normalizedImagePoint(objectPoint.
x() * factor, objectPoint.
y() * factor);
2013 if constexpr (tUseBorderDistortionIfOutside)
2015 const VectorT2<T> clampedNormalizedImagePoint(
minmax(leftClamping, normalizedImagePoint.
x(), rightClamping),
minmax(topClamping, normalizedImagePoint.
y(), bottomClamping));
2017 const T
sqr = clampedNormalizedImagePoint.
sqr();
2018 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2020 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
2021 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
2023 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
2024 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
2026 *imagePoints =
VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
2027 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
2031 const T
sqr = normalizedImagePoint.
sqr();
2032 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2034 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y()
2037 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedImagePoint.
y()))
2038 + tangentialDistortion_.second * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y();
2040 *imagePoints =
VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
2041 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
2052 ocean_assert(transformationIF.
isValid());
2054 for (
size_t n = 0; n < numberObjectPoints; ++n)
2056 const VectorT3<T> transformedObjectPoint(transformationIF * worldObjectPoints[n]);
2059 const T factor = 1 / transformedObjectPoint.
z();
2061 *imagePoints++ =
VectorT2<T>(transformedObjectPoint.
x() * factor, transformedObjectPoint.
y() * factor);
2066 template <
typename T>
2067 template <
bool tUseBorderDistortionIfOuts
ide>
2071 ocean_assert(worldLine.
isValid());
2073 const VectorT2<T> firstImagePoint(projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, worldLine.
point(), distortProjectedLine, zoom));
2074 const VectorT2<T> secondImagePoint(projectToImageIF<tUseBorderDistortionIfOutside>(flippedCamera_T_world, worldLine.
point(10), distortProjectedLine, zoom));
2076 if (firstImagePoint == secondImagePoint)
2081 return LineT2<T>(firstImagePoint, (secondImagePoint - firstImagePoint).normalized());
2084 template <
typename T>
2091 template <
typename T>
2098 template <
typename T>
2105 template <
typename T>
2109 ocean_assert(numberObjectPoints == 0u || (objectPoints && imagePoints));
2114 template <
typename T>
2115 template <
bool tDistortImagePo
int,
bool tUseBorderDistortionIfOuts
ide>
2120 const VectorT3<T> transformedObjectPoint(iFlippedExtrinsic * objectPoint);
2123 const T factor = T(1) / transformedObjectPoint.
z();
2126 const VectorT2<T> normalizedImagePoint(transformedObjectPoint.
x() * factor, transformedObjectPoint.
y() * factor);
2128 if (!tDistortImagePoint)
2130 return VectorT2<T>(normalizedImagePoint.
x() * focalLengthX() * zoom + principalPointX(), normalizedImagePoint.
y() * focalLengthY() * zoom + principalPointY());
2133 if constexpr (tUseBorderDistortionIfOutside)
2135 const T invZoom = T(1) / zoom;
2137 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX() * invZoom, normalizedImagePoint.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX() * invZoom),
2138 minmax(-principalPointY() * inverseFocalLengthY() * invZoom, normalizedImagePoint.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY() * invZoom));
2140 const T
sqr = clampedNormalizedImagePoint.
sqr();
2142 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2144 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
2145 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
2147 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
2148 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
2150 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
2151 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
2155 const T
sqr = normalizedImagePoint.
sqr();
2157 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2159 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y()
2162 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(normalizedImagePoint.
y()))
2163 + tangentialDistortion_.second * 2 * normalizedImagePoint.
x() * normalizedImagePoint.
y();
2165 return VectorT2<T>((normalizedImagePoint.
x() * radialDistortionFactor + tangentialDistortionCorrectionX) * focalLengthX() * zoom + principalPointX(),
2166 (normalizedImagePoint.
y() * radialDistortionFactor + tangentialDistortionCorrectionY) * focalLengthY() * zoom + principalPointY());
2170 template <
typename T>
2203 const VectorT3<T> testVector(
VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * -inverseFocalLengthY(), -1).normalized());
2211 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * -inverseFocalLengthY(), -1).
normalized();
2215 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * -inverseFocalLengthY(), -1);
2219 template <
typename T>
2252 const T invZoom = T(1) / zoom;
2256 const VectorT3<T> testVector(
VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * -inverseFocalLengthY() * invZoom, -1).normalized());
2264 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * -inverseFocalLengthY() * invZoom, -1).
normalized();
2268 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * -inverseFocalLengthY() * invZoom, -1);
2272 template <
typename T>
2292 const VectorT3<T> testVector(distance * (position(0) - principalPointX()) * inverseFocalLengthX(), distance * (position(1) - principalPointY()) * -inverseFocalLengthY(), -distance);
2298 return VectorT3<T>(distance * (position(0) - principalPointX()) * inverseFocalLengthX(), distance * (position(1) - principalPointY()) * -inverseFocalLengthY(), -distance);
2301 template <
typename T>
2321 const T invZoom = T(1) / zoom;
2325 const VectorT3<T> testVector(distance * (position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, distance * (position(1) - principalPointY()) * -inverseFocalLengthY() * invZoom, -distance);
2331 return VectorT3<T>(distance * (position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, distance * (position(1) - principalPointY()) * -inverseFocalLengthY() * invZoom, -distance);
2334 template <
typename T>
2339 const VectorT3<T> testVector(
VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * inverseFocalLengthY(), 1).normalized());
2340 ocean_assert((std::is_same<T, float>::value) || position.
isEqual(projectToImageIF<false>(
HomogenousMatrixT4<T>(
true), testVector,
false), T(0.01)));
2345 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * inverseFocalLengthY(), 1).
normalized();
2349 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX(), (position(1) - principalPointY()) * inverseFocalLengthY(), 1);
2353 template <
typename T>
2358 const T invZoom = T(1) / zoom;
2362 const VectorT3<T> testVector(
VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * inverseFocalLengthY() * invZoom, 1).normalized());
2369 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * inverseFocalLengthY() * invZoom, 1).
normalized();
2373 return VectorT3<T>((position(0) - principalPointX()) * inverseFocalLengthX() * invZoom, (position(1) - principalPointY()) * inverseFocalLengthY() * invZoom, 1);
2377 template <
typename T>
2387 template <
typename T>
2392 return LineT3<T>(world_t_camera, world_Q_camera * vector(position, zoom));
2395 template <
typename T>
2410 const T inverseFocalLengthX = T(1) / focalLengthX();
2411 const T inverseFocalLengthY = T(1) / focalLengthY();
2413 invertedIntrinsics_(0, 0) = inverseFocalLengthX;
2414 invertedIntrinsics_(1, 1) = inverseFocalLengthY;
2415 invertedIntrinsics_(0, 2) = - principalPointX() * inverseFocalLengthX;
2416 invertedIntrinsics_(1, 2) = - principalPointY() * inverseFocalLengthY;
2417 invertedIntrinsics_(2, 2) = 1;
2419 ocean_assert(invertedIntrinsics_(1, 0) == 0);
2420 ocean_assert(invertedIntrinsics_(2, 0) == 0);
2421 ocean_assert(invertedIntrinsics_(0, 1) == 0);
2422 ocean_assert(invertedIntrinsics_(2, 1) == 0);
2425 template <
typename T>
2428 return !(*
this == camera);
2431 template <
typename T>
2437 template <
typename T>
2438 template <
bool tUseBorderDistortionIfOuts
ide>
2443 if (hasDistortionParameters())
2445 if constexpr (tUseBorderDistortionIfOutside)
2447 const VectorT2<T> clampedNormalizedImagePoint(
minmax(-principalPointX() * inverseFocalLengthX() * invZoom, undistortedNormalized.
x(), (T(width_) - principalPointX()) * inverseFocalLengthX() * invZoom),
2448 minmax(-principalPointY() * inverseFocalLengthY() * invZoom, undistortedNormalized.
y(), (T(height_) - principalPointY()) * inverseFocalLengthY() * invZoom));
2450 const T
sqr = clampedNormalizedImagePoint.
sqr();
2452 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2454 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y()
2455 + tangentialDistortion_.second * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
x()));
2457 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(clampedNormalizedImagePoint.
y()))
2458 + tangentialDistortion_.second * 2 * clampedNormalizedImagePoint.
x() * clampedNormalizedImagePoint.
y();
2460 return VectorT2<T>(undistortedNormalized.
x() * radialDistortionFactor + tangentialDistortionCorrectionX,
2461 undistortedNormalized.
y() * radialDistortionFactor + tangentialDistortionCorrectionY);
2465 const T
sqr = undistortedNormalized.
sqr();
2467 const T radialDistortionFactor = T(1) + radialDistortion_.first *
sqr + radialDistortion_.second *
NumericT<T>::sqr(
sqr);
2469 const T tangentialDistortionCorrectionX = tangentialDistortion_.first * 2 * undistortedNormalized.
x() * undistortedNormalized.
y()
2472 const T tangentialDistortionCorrectionY = tangentialDistortion_.first * (
sqr + 2 *
NumericT<T>::sqr(undistortedNormalized.
y()))
2473 + tangentialDistortion_.second * 2 * undistortedNormalized.
x() * undistortedNormalized.
y();
2475 return VectorT2<T>(undistortedNormalized.
x() * radialDistortionFactor + tangentialDistortionCorrectionX,
2476 undistortedNormalized.
y() * radialDistortionFactor + tangentialDistortionCorrectionY);
2481 return undistortedNormalized;
This class implements an axis aligned 2D box object.
Definition: Box2.h:68
This class implements an axis aligned 3D bounding box.
Definition: Box3.h:67
bool isValid() const
Returns whether the bounding box is valid.
unsigned int corners(VectorT3< T > *corners) const
Returns the corner positions of this box.
This class implements the base class for all cameras.
Definition: Camera.h:54
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
QuaternionT< T > rotation() const
Returns the rotation of the transformation as quaternion.
Definition: HomogenousMatrix4.h:1388
This class implements an infinite line in 2D space.
Definition: Line2.h:83
This class implements an infinite line in 3D space.
Definition: Line3.h:70
bool isValid() const
Returns whether this line has valid parameters.
Definition: Line3.h:303
const VectorT3< T > & point() const
Returns a point on the line.
Definition: Line3.h:271
This class implements a 2D lookup object with values at the bins' center positions defining the indiv...
Definition: Lookup2.h:198
This class provides basic numeric functionalities.
Definition: Numeric.h:57
static T abs(const T value)
Returns the absolute value of a given value.
Definition: Numeric.h:1220
static constexpr T sqr(const T value)
Returns the square of a given value.
Definition: Numeric.h:1495
This class encapsulates a lookup table for camera distortion offsets allowing for faster un-distortio...
Definition: PinholeCamera.h:154
DistortionLookup(const PinholeCameraT< T > &camera, const unsigned int binSize)
Creates an lookup object for a given camera.
VectorT2< T > undistortionOffset(const VectorT2< T > &distortedImagePoint) const
Returns the offset that needs to be added to an distorted image point so that it would be undistorted...
Definition: PinholeCamera.h:1236
VectorT2< T > undistortedImagePointBicubic(const VectorT2< T > &distortedImagePoint) const
Returns the undistorted image point for a given (distorted) image point (by application of a bicubic ...
Definition: PinholeCamera.h:1243
VectorT2< T > undistortionOffsetBicubic(const VectorT2< T > &distortedImagePoint) const
Returns the offset that needs to be added to an distorted image point so that it would be undistorted...
Definition: PinholeCamera.h:1250
VectorT2< T > undistortedImagePoint(const VectorT2< T > &distortedImagePoint) const
Returns the undistorted image point for a given (distorted) image point (by application of a bilinear...
Definition: PinholeCamera.h:1229
DistortionLookup()
Creates an invalid lookup object.
Definition: PinholeCamera.h:1223
LookupTable distortionLookupTable
The distortion lookup table.
Definition: PinholeCamera.h:207
LookupCenter2< VectorT2< T >, T > LookupTable
Definition of a lookup table for 2D vectors.
Definition: PinholeCamera.h:160
VectorT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &worldObjectPoint, const T zoom=T(1)) const
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose.
Definition: PinholeCamera.h:2116
void setTangentialDistortion(const DistortionPair &tangential)
Sets the tangential distortion parameters.
Definition: PinholeCamera.h:1366
VectorT2< T > imagePoint2normalizedImagePoint(const VectorT2< T > &imagePoint, const bool undistortImagePoint) const
Calculates the normalized image point corresponding to a given (distorted) image point.
Definition: PinholeCamera.h:1579
unsigned int width() const
Returns the width of the camera image.
Definition: PinholeCamera.h:1300
PinholeCameraT(const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY, const DistortionPair &radial, const DistortionPair &tangential)
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
VectorT2< T > projectToImageDamped(const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D object point to the 2D image plane of the camera by a given extrinsic camera matrix.
Definition: PinholeCamera.h:2085
T fovYBottom() const
Returns the bottom field of view in y direction.
bool isEqual(const PinholeCameraT< T > &camera, const T eps=NumericT< T >::eps()) const
Returns whether two camera profiles are identical up to a given epsilon.
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: PinholeCamera.h:1469
T fovYTop() const
Returns the top field of view in y direction.
PinholeCameraT(const unsigned int width, const unsigned int height, const T *parameters, const bool radialDistortion=true, const bool tangentialDistortion=true)
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
VectorT2< T > distortDamped(const VectorT2< T > &undistorted, const T dampingFactor=T(1), const T zoom=T(1)) const
Returns the distorted position of a given undistorted position defined in pixel coordinates.
T principalPointX() const
Returns the x-value of the principal point of the camera image in the pixel domain.
Definition: PinholeCamera.h:1318
DistortionPair tangentialDistortion_
Pair of tangential distortion parameters.
Definition: PinholeCamera.h:1219
PinholeCameraT()=default
Standard constructor.
const SquareMatrixT3< T > & invertedIntrinsic() const
Returns the inverted intrinsic camera matrix.
Definition: PinholeCamera.h:1263
bool operator==(const PinholeCameraT< T > &camera) const
Returns whether two camera objects are identical up to a small epsilon.
TriangleT2< T > projectToImageDampedIF(const HomogenousMatrixT4< T > &iFlippedExtrinsic, const TriangleT3< T > &objectTriangle, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D triangle to the 2D image plane of the camera by a given inverse extrinsic camera matrix...
VectorT2< T > principalPoint() const
Returns the coordinate of the principal point of the camera image in the pixel domain.
Definition: PinholeCamera.h:1312
BoxT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const BoxT3< T > &worldObjectBox, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D box to the 2D image plane of the camera by a given camera pose.
Definition: PinholeCamera.h:1780
std::pair< T, T > DistortionPair
Definition of a pair of distortion values.
Definition: PinholeCamera.h:123
VectorT2< T > dampedNormalized(const VectorT2< T > &normalized, const T dampingFactor, const T invZoom) const
Determines the damped normalized coordinate for a given normalized coordinate.
TriangleT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const TriangleT3< T > &worldObjectTriangle, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera pose.
Definition: PinholeCamera.h:1890
VectorT2< T > projectToImageIF(const VectorT2< T > &normalizedObjectPoint, const bool distortImagePoint, const T zoom=T(1)) const
Transforms a normalized object point (a 3D object point transformed by the inverted and flipped extri...
Definition: PinholeCamera.h:1902
bool isDistortionPlausible(const T symmetricFocalLengthRatio=T(1.05), const T modelAccuracy=T(0.001), const T symmetricDistortionRatio=T(1.08)) const
Checks whether the distortion of this camera is plausible.
LineT3< T > ray(const VectorT2< T > &position, const HomogenousMatrixT4< T > &world_T_camera, const T zoom=T(1)) const
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane.
Definition: PinholeCamera.h:2378
T fovXRight() const
Returns the right field of view in x direction.
BoxT2< T > projectToImageDamped(const HomogenousMatrixT4< T > &extrinsic, const BoxT3< T > &objectBox, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
Definition: PinholeCamera.h:2092
VectorT2< T > distort(const VectorT2< T > &undistorted) const
Returns the distorted position of a given undistorted position defined in pixel coordinates.
Definition: PinholeCamera.h:1418
VectorT2< T > distortNormalizedDamped(const VectorT2< T > &undistortedNormalized, const T dampingFactor, const T invZoom) const
Returns the distorted position of a given undistorted normalized position.
LineT3< T > ray(const VectorT2< T > &position, const VectorT3< T > &world_t_camera, const QuaternionT< T > &world_Q_camera, const T zoom=T(1)) const
Returns a ray starting at the camera's center and intersection a given 2D point on the image plane.
Definition: PinholeCamera.h:2388
PinholeCameraT(const unsigned int width, const unsigned int height, const T fovX, const T principalX, const T principalY)
Creates a new PinholeCameraT<T> object by the given frame dimensions, the ideal field of view,...
PinholeCameraT(const SquareMatrixT3< T > &intrinsic)
Creates a new PinholeCameraT<T> object by a given projection matrix with the intrinsic camera paramet...
VectorT2< T > distortNormalized(const VectorT2< T > &undistortedNormalized, const T invZoom) const
Returns the distorted position of a given undistorted normalized position.
Definition: PinholeCamera.h:2439
VectorT2< T > undistort(const VectorT2< T > &distorted, const unsigned int iterations=10u, const T zoom=T(1)) const
Returns the undistorted position of a given distorted position defined in pixel coordinates.
Definition: PinholeCamera.h:1373
bool isValid() const
Returns whether this camera is valid.
Definition: PinholeCamera.h:1572
VectorT3< T > vectorToPlane(const VectorT2< T > &position, const T distance, const T zoom) const
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane...
Definition: PinholeCamera.h:2302
void setRadialDistortion(const DistortionPair &radial)
Sets the radial distortion parameters.
Definition: PinholeCamera.h:1360
BoxT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const BoxT3< T > &worldObjectBox, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D box to the 2D image plane of the camera by a given inverse camera pose.
Definition: PinholeCamera.h:1871
T focalLengthY() const
Returns the vertical focal length parameter.
Definition: PinholeCamera.h:1336
SquareMatrixT3< T > invertedIntrinsics_
Inverted intrinsic camera matrix.
Definition: PinholeCamera.h:1207
PinholeCameraT(const PinholeCameraT< U > &pinholeCamera, const bool copyDistortionParameters=true)
Copy constructor for a pinhole camera with difference element data type than T.
Definition: PinholeCamera.h:1282
bool hasDistortionParameters() const
Returns whether this camera object has specified distortion parameters.
Definition: PinholeCamera.h:1293
const SquareMatrixT3< T > & intrinsic() const
Returns the intrinsic camera matrix.
Definition: PinholeCamera.h:1257
T calculateCosBetween(const VectorT2< T > &first, const VectorT2< T > &second) const
Returns the cosine of the viewing angle between two undistorted points on the camera's image plane.
TriangleT2< T > projectToImageDamped(const HomogenousMatrixT4< T > &extrinsic, const TriangleT3< T > &objectTriangle, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D triangle to the 2D image plane of the camera by a given extrinsic camera matrix.
Definition: PinholeCamera.h:2099
PinholeCameraT(const unsigned int width, const unsigned int height, const T focalX, const T focalY, const T principalX, const T principalY)
Creates a new PinholeCameraT<T> object by it's given intrinsic parameters.
void calculateInverseIntrinsic()
Determines the inverse of the intrinsic camera matrix.
Definition: PinholeCamera.h:2396
void projectToImageDamped(const HomogenousMatrixT4< T > &extrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a set of 3D object points onto an image plane of the camera by a given extrinsic camera matr...
Definition: PinholeCamera.h:2106
VectorT3< T > vectorToPlane(const VectorT2< T > &position, const T distance) const
Returns a vector starting at the camera's center and intersecting a given 2D point on the image plane...
Definition: PinholeCamera.h:2273
bool rotation(const VectorT2< T > &undistortedPosition, T &angleX, T &angleY) const
Gets two rotation parameters of the viewing ray for a given undistorted 2D position in the camera ima...
T fovY() const
Returns the field of view in x direction of the camera.
SquareMatrixT3< T > intrinsics_
Intrinsic camera matrix.
Definition: PinholeCamera.h:1204
T fovDiagonal() const
Returns the diagonal field of view of the camera.
HomogenousMatrixT4< T > transformationMatrixIF(const HomogenousMatrixT4< T > &iFlippedExtrinsic, const T zoom=T(1)) const
Returns a 4x4 homogenous transformation matrix (corresponding to a 3x4 matrix) that covers an extrins...
Definition: PinholeCamera.h:1479
void normalizedImagePoints2imagePoints(const VectorT2< T > *normalizedImagePoints, const size_t numberNormalizedImagePoints, const bool distortImagePoints, VectorT2< T > *imagePoints) const
Calculates the image points corresponding to a set of given normalized image points.
Definition: PinholeCamera.h:1676
VectorT3< T > vectorIF(const VectorT2< T > &position, const bool makeUnitVector=true) const
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given ...
Definition: PinholeCamera.h:2335
OptimizationStrategy
Definition of individual optimization strategies for camera parameters.
Definition: PinholeCamera.h:129
unsigned int height() const
Returns the height of the camera image.
Definition: PinholeCamera.h:1306
const DistortionPair & radialDistortion() const
Returns the pair of radial distortion parameters.
Definition: PinholeCamera.h:1269
DistortionPair radialDistortion_
Pair of radial distortion parameters for r^2 and r^4.
Definition: PinholeCamera.h:1216
SquareMatrixT4< T > frustumMatrix(const T nearDistance, const T farDistance) const
Returns the 4x4 frustum projection matrix corresponding to this camera.
VectorT2< T > dampedNormalized(const VectorT2< T > &normalized, const T dampingFactor, const T leftNormalizedBorder, const T rightNormalizedBorder, const T topNormalizedBorder, const T bottomNormalizedBorder) const
Determines the damped normalized coordinate for a given normalized coordinate.
TriangleT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const TriangleT3< T > &worldObjectTriangle, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D triangle to the 2D image plane of the camera by a given camera pose.
Definition: PinholeCamera.h:1788
VectorT3< T > vectorIF(const VectorT2< T > &position, const T zoom, const bool makeUnitVector) const
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given ...
Definition: PinholeCamera.h:2354
void applyZoomFactor(const T relativeZoom)
Applies a given (relative) zoom factor which mainly multiplies the focal length parameters by the giv...
T TScalar
The scalar data type of this object.
Definition: PinholeCamera.h:120
T inverseFocalLengthX() const
Returns the inverse horizontal focal length parameter.
Definition: PinholeCamera.h:1342
PinholeCameraT(const SquareMatrixT3< T > &intrinsic, const unsigned int width, const unsigned int height)
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix and width and height of t...
PinholeCameraT(const unsigned int width, const unsigned int height, const T fovX)
Creates a new PinholeCameraT<T> object by the given width, height and field of view of a camera.
const DistortionPair & tangentialDistortion() const
Returns the pair of tangential distortion parameters.
Definition: PinholeCamera.h:1275
VectorT2< T > projectToImageDampedIF(const HomogenousMatrixT4< T > &iFlippedExtrinsic, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D object point to the 2D image plane of the camera by a given inverse extrinsic camera ma...
VectorT2< T > normalizedImagePoint2imagePoint(const VectorT2< T > &normalizedImagePoint, const bool distortImagePoint) const
Calculates the image point corresponding to a given normalized image point.
Definition: PinholeCamera.h:1602
void copyElements(T *arrayValues, const bool copyRadialDistortion=true, const bool copyTangentialDistortion=true) const
Copies the elements of this camera to an array with 4 to 8 floating point values.
void projectToImageDampedIF(const HomogenousMatrixT4< T > &invertedFlippedExtrinsic, const VectorT3< T > *objectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a set of 3D object points onto an image plane of the camera by a given inverse extrinsic cam...
VectorT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > &objectPoint, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D object point to the 2D image plane of the camera by a given inverse camera pose.
Definition: PinholeCamera.h:1816
T principalPointY() const
Returns the y-value of the principal point of the camera image in the pixel domain.
Definition: PinholeCamera.h:1324
LineT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const LineT3< T > &worldLine, const bool distortProjectedLine, const T zoom=T(1)) const
Projects a 3D line onto an image plane of the camera by a given camera pose.
Definition: PinholeCamera.h:1806
T fovX() const
Returns the field of view in x direction of the camera.
VectorT2< T > undistortDamped(const VectorT2< T > &distorted, const T dampingFactor=T(1), const unsigned int iterations=10u, const T zoom=T(1)) const
Returns the undistorted position of a given distorted position defined in pixel coordinates.
T calculateAngleBetween(const VectorT2< T > &first, const VectorT2< T > &second) const
Returns the viewing angle between two undistorted points on the camera's image plane.
PinholeCameraT(const unsigned int width, const unsigned int height, const PinholeCameraT< T > &camera)
Creates a new camera object with specified frame dimension and intrinsic camera parameters best match...
bool operator!=(const PinholeCameraT< T > &camera) const
Returns whether two camera objects are not identical up to a small epsilon.
Definition: PinholeCamera.h:2426
BoxT2< T > projectToImageDampedIF(const HomogenousMatrixT4< T > &iFlippedExtrinsic, const BoxT3< T > &objectBox, const bool distortImagePoint, const T dampingFactor=T(1), const T zoom=T(1)) const
Projects a 3D box to the 2D image plane of the camera by a given inverse extrinsic camera matrix.
PinholeCameraT(const SquareMatrixT3< T > &intrinsic, const unsigned int width, const unsigned int height, const DistortionPair &radial, const DistortionPair &tangential)
Creates a new PinholeCameraT<T> object by the given intrinsic camera matrix, the width and height and...
T fovXLeft() const
Returns the left field of view in x direction.
T inverseFocalLengthY() const
Returns the inverse vertical focal length parameter.
Definition: PinholeCamera.h:1351
VectorT3< T > vector(const VectorT2< T > &position, const T zoom, const bool makeUnitVector=true) const
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given ...
Definition: PinholeCamera.h:2220
bool setIntrinsic(const SquareMatrixT3< T > &intrinsic)
Sets the intrinsic camera matrix.
VectorT2< T > imagePoint2normalizedImagePointDamped(const VectorT2< T > &imagePoint, const bool undistortImagePoint) const
Calculates the normalized image point corresponding to a given (distorted) image point.
Definition: PinholeCamera.h:1590
PinholeCameraT(const T subFrameLeft, const T subFrameTop, const unsigned int subFrameWidth, const unsigned int subFrameHeight, const PinholeCameraT< T > &camera)
Creates a new sub-frame camera profile based on a camera profile of the entire camera frame.
LineT2< T > projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const LineT3< T > &worldLine, const bool distortProjectedLine, const T zoom=T(1)) const
Projects a 3D line onto an image plane of the camera by a given inverse camera pose.
Definition: PinholeCamera.h:2068
void pointJacobian2x3IF(const VectorT3< U > &flippedCameraObjectPoint, U *jx, U *jy) const
Calculates the 2x3 jacobian matrix for the 3D object point projection into the camera frame.
Definition: PinholeCamera.h:1503
void projectToImageIF(const HomogenousMatrixT4< T > &flippedCamera_T_world, const VectorT3< T > *worldObjectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T zoom=T(1)) const
Projects a set of 3D object points onto an image plane of the camera by a given inverse camera pose.
Definition: PinholeCamera.h:1952
friend class PinholeCameraT
Definition: PinholeCamera.h:115
void projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > *worldObjectPoints, const size_t numberObjectPoints, const bool distortImagePoints, VectorT2< T > *imagePoints, const T zoom=T(1)) const
Projects a set of 3D object points onto an image plane of the camera by a given camera pose.
Definition: PinholeCamera.h:1796
VectorT2< T > projectToImage(const HomogenousMatrixT4< T > &world_T_camera, const VectorT3< T > &worldObjectPoint, const bool distortImagePoint, const T zoom=T(1)) const
Projects a 3D object point to the 2D image plane of the camera by a given camera pose.
Definition: PinholeCamera.h:1772
T focalLengthX() const
Returns the horizontal focal length parameter.
Definition: PinholeCamera.h:1330
VectorT3< T > vector(const VectorT2< T > &position, const bool makeUnitVector=true) const
Returns a normalized vector (with length 1) starting at the camera's center and intersecting a given ...
Definition: PinholeCamera.h:2171
This class implements a unit quaternion rotation.
Definition: Quaternion.h:100
bool isValid() const
Returns whether this quaternion is a valid unit quaternion.
Definition: Quaternion.h:899
This class implements a 3x3 square matrix.
Definition: SquareMatrix3.h:88
SquareMatrixT3< T > inverted() const
Returns the inverted matrix of this matrix.
Definition: SquareMatrix3.h:1176
This class implements a 4x4 square matrix.
Definition: SquareMatrix4.h:85
This class implements a 2D triangle with Cartesian coordinates.
Definition: Triangle2.h:81
This class implements a 3D triangle.
Definition: Triangle3.h:80
const VectorT3< T > & point0() const
Returns the first point of this triangle.
Definition: Triangle3.h:278
bool isValid() const
Returns whether this triangle is valid.
Definition: Triangle3.h:580
const VectorT3< T > & point2() const
Returns the third point of this triangle.
Definition: Triangle3.h:290
const VectorT3< T > & point1() const
Returns the second point of this triangle.
Definition: Triangle3.h:284
This class implements a vector with two elements.
Definition: Vector2.h:96
const T & x() const noexcept
Returns the x value.
Definition: Vector2.h:698
const T & y() const noexcept
Returns the y value.
Definition: Vector2.h:710
bool isEqual(const VectorT2< T > &vector, const T eps) const
Returns whether two vectors are equal up to a specified epsilon.
Definition: Vector2.h:746
T sqr() const
Returns the square of the vector length.
Definition: Vector2.h:621
This class implements a vector with three elements.
Definition: Vector3.h:97
const T & y() const noexcept
Returns the y value.
Definition: Vector3.h:812
const T & x() const noexcept
Returns the x value.
Definition: Vector3.h:800
VectorT3< T > normalized() const
Returns the normalized vector.
Definition: Vector3.h:605
const T & z() const noexcept
Returns the z value.
Definition: Vector3.h:824
T length() const
Returns the length of the vector.
Definition: Vector3.h:664
T minmax(const T &lowerBoundary, const T &value, const T &upperBoundary)
This function fits a given parameter into a specified value range.
Definition: base/Utilities.h:903
unsigned int sqr(const char value)
Returns the square value of a given value.
Definition: base/Utilities.h:1029
PinholeCameraT< double > PinholeCameraD
Definition of an pinhole camera object with double precision.
Definition: PinholeCamera.h:46
PinholeCameraT< float > PinholeCameraF
Definition of an pinhole camera object with float precision.
Definition: PinholeCamera.h:53
PinholeCamerasT< double > PinholeCamerasD
Definition of a vector holding PinholeCameraD objects.
Definition: PinholeCamera.h:75
PinholeCamerasT< Scalar > PinholeCameras
Definition of a vector holding pinhole camera objects.
Definition: PinholeCamera.h:68
std::vector< PinholeCameraT< T > > PinholeCamerasT
Definition of a typename alias for vectors with PinholeCameraT objects.
Definition: PinholeCamera.h:61
PinholeCameraT< Scalar > PinholeCamera
Definition of an pinhole camera object with Scalar precision.
Definition: PinholeCamera.h:32
PinholeCamerasT< float > PinholeCamerasF
Definition of a vector holding PinholeCameraF objects.
Definition: PinholeCamera.h:82
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15