8 #ifndef META_OCEAN_GEOMETRY_NON_LINEAR_OPTIMIZATION_OBJECT_POINT_H
9 #define META_OCEAN_GEOMETRY_NON_LINEAR_OPTIMIZATION_OBJECT_POINT_H
73 class CameraObjectPointProvider;
78 class CamerasObjectPointProvider;
83 class StereoCameraObjectPointProvider;
88 class SphericalObjectPointProvider;
93 class ObjectPointsOrientationsData;
99 template <Estimator::EstimatorType tEstimator>
105 class ObjectPointsTwoPosesProvider;
112 template <Estimator::EstimatorType tEstimator>
120 template <Estimator::EstimatorType tEstimator>
129 class SlowObjectPointsPosesProvider;
151 static inline bool optimizeObjectPointForFixedPoses(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
172 static bool optimizeObjectPointForFixedPosesIF(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
192 static inline bool optimizeObjectPointForFixedPoses(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
213 static bool optimizeObjectPointForFixedPosesIF(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
237 static inline bool optimizeObjectPointForFixedStereoPoses(
const AnyCamera& anyCameraA,
const AnyCamera& anyCameraB,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_camerasA,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_camerasB,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePointAccessorA,
const ConstIndexedAccessor<Vector2>& imagePointAccessorB,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
262 static bool optimizeObjectPointForFixedStereoPosesIF(
const AnyCamera& anyCameraA,
const AnyCamera& anyCameraB,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCamerasA_T_world,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCamerasB_T_world,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePointAccessorA,
const ConstIndexedAccessor<Vector2>& imagePointAccessorB,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Scalar* initialRobustError =
nullptr,
Scalar* finalRobustError =
nullptr,
Scalars* intermediateRobustErrors =
nullptr);
284 static inline bool optimizeObjectPointsForFixedPoses(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& poseAccessor,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool distortImagePoints,
NonconstIndexedAccessor<Vector3>& optimizedObjectPoints,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Worker* worker =
nullptr);
306 static bool optimizeObjectPointsForFixedPosesIF(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& invertedFlippedPoses,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool distortImagePoints,
NonconstIndexedAccessor<Vector3>& optimizedObjectPoints,
const unsigned int iterations = 5u,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor = 10,
const bool onlyFrontObjectPoints =
true,
Worker* worker =
nullptr);
327 static inline bool optimizeObjectPointForFixedOrientations(
const AnyCamera& camera,
const ConstIndexedAccessor<SquareMatrix3>& world_R_cameras,
const ConstIndexedAccessor<Vector2>& imagePoints,
const Vector3& objectPoint,
const Scalar objectPointDistance,
Vector3& optimizedObjectPoint,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoint =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
348 static bool optimizeObjectPointForFixedOrientationsIF(
const AnyCamera& camera,
const ConstIndexedAccessor<SquareMatrix3>& flippedCameras_R_world,
const ConstIndexedAccessor<Vector2>& imagePoints,
const Vector3& objectPoint,
const Scalar objectPointDistance,
Vector3& optimizedObjectPoint,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoint =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
372 static bool optimizeObjectPointsAndOrientations(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<SquareMatrix3>& orientations,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const Scalar objectPointDistance,
NonconstIndexedAccessor<SquareMatrix3>* optimizedOrientations,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
398 static inline bool optimizeObjectPointsAndOnePose(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPose,
const HomogenousMatrix4& secondPose,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedSecondPose,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
424 static bool optimizeObjectPointsAndOnePoseIF(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPoseIF,
const HomogenousMatrix4& secondPoseIF,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedSecondPoseIF,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
453 static inline bool optimizeObjectPointsAndTwoPoses(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPose,
const HomogenousMatrix4& secondPose,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedFirstPose,
HomogenousMatrix4* optimizedSecondPose,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
const Matrix* invertedFirstCovariances =
nullptr,
const Matrix* invertedSecondCovariances =
nullptr,
Scalars* intermediateErrors =
nullptr);
482 static bool optimizeObjectPointsAndTwoPosesIF(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPoseIF,
const HomogenousMatrix4& secondPoseIF,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedFirstPoseIF,
HomogenousMatrix4* optimizedSecondPoseIF,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Estimator::EstimatorType estimator =
Estimator::ET_SQUARE,
Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
const Matrix* invertedFirstCovariances =
nullptr,
const Matrix* invertedSecondCovariances =
nullptr,
Scalars* intermediateErrors =
nullptr);
506 static inline bool optimizeObjectPointsAndPoses(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* world_T_optimizedCameras,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
530 static inline bool optimizeObjectPointsAndPosesIF(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* flippedOptimizedCameras_T_world,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
554 static bool optimizeObjectPointsAndPoses(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* world_T_optimizedCameras,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
578 static bool optimizeObjectPointsAndPosesIF(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* flippedOptimizedCameras_T_world,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
603 static bool optimizeObjectPointsAndOrientationalPoses(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* world_T_optimizedCameras,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
628 static bool optimizeObjectPointsAndOrientationalPosesIF(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* flippedOptimizedCameras_T_world,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
655 static bool slowOptimizeObjectPointsAndPoses(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* world_T_optimizedCameras,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
680 static bool slowOptimizeObjectPointsAndPosesIF(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* flippedOptimizedCameras_T_world,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
708 static inline bool slowOptimizeObjectPointsAndPoses(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& poses,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool useDistortionParameters,
NonconstIndexedAccessor<HomogenousMatrix4>* optimizedPoses,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
736 static inline bool slowOptimizeObjectPointsAndPosesIF(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& posesIF,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool useDistortionParameters,
NonconstIndexedAccessor<HomogenousMatrix4>* optimizedPosesIF,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator =
Geometry::Estimator::ET_SQUARE,
const Scalar lambda =
Scalar(0.001),
const Scalar lambdaFactor =
Scalar(5),
const bool onlyFrontObjectPoints =
true,
Scalar* initialError =
nullptr,
Scalar* finalError =
nullptr,
Scalars* intermediateErrors =
nullptr);
756 static void optimizeObjectPointsForFixedPosesIFSubset(
const PinholeCamera* pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>* invertedFlippedPoses,
const ConstIndexedAccessor<Vector3>* objectPoints,
const ObjectPointGroupsAccessor* correspondenceGroups,
const bool distortImagePoints,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
const unsigned int firstObjectPoint,
const unsigned int numberObjectPoints);
759 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPoses(
const AnyCamera& anyCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialRobustError,
Scalar* finalRobustError,
Scalars* intermediateRobustErrors)
763 return optimizeObjectPointForFixedPosesIF(anyCamera,
ConstArrayAccessor<HomogenousMatrix4>(flippedCameras_T_world), worldObjectPoint, imagePoints, optimizedWorldObjectPoint, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialRobustError, finalRobustError, intermediateRobustErrors);
766 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedPoses(
const ConstIndexedAccessor<const AnyCamera*>& cameras,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePoints,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialRobustError,
Scalar* finalRobustError,
Scalars* intermediateRobustErrors)
770 return optimizeObjectPointForFixedPosesIF(cameras,
ConstArrayAccessor<HomogenousMatrix4>(flippedCameras_T_world), worldObjectPoint, imagePoints, optimizedWorldObjectPoint, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialRobustError, finalRobustError, intermediateRobustErrors);
773 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedStereoPoses(
const AnyCamera& anyCameraA,
const AnyCamera& anyCameraB,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_camerasA,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_camerasB,
const Vector3& worldObjectPoint,
const ConstIndexedAccessor<Vector2>& imagePointAccessorA,
const ConstIndexedAccessor<Vector2>& imagePointAccessorB,
Vector3& optimizedWorldObjectPoint,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialRobustError,
Scalar* finalRobustError,
Scalars* intermediateRobustErrors)
778 return optimizeObjectPointForFixedStereoPosesIF(anyCameraA, anyCameraB,
ConstArrayAccessor<HomogenousMatrix4>(flippedCamerasA_T_world),
ConstArrayAccessor<HomogenousMatrix4>(flippedCamerasB_T_world), worldObjectPoint, imagePointAccessorA, imagePointAccessorB, optimizedWorldObjectPoint, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialRobustError, finalRobustError, intermediateRobustErrors);
781 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointsForFixedPoses(
const PinholeCamera& pinholeCamera,
const ConstIndexedAccessor<HomogenousMatrix4>& poseAccessor,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool distortImagePoints,
NonconstIndexedAccessor<Vector3>& optimizedObjectPoints,
const unsigned int iterations,
const Estimator::EstimatorType estimator,
Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Worker* worker)
784 ocean_assert(objectPoints.
size() == correspondenceGroups.
groups());
786 ocean_assert(lambda >= 0);
787 ocean_assert(lambdaFactor >= 1);
790 invertedFlippedPoses.reserve(poseAccessor.
size());
792 for (
size_t n = 0; n < poseAccessor.
size(); ++n)
797 return optimizeObjectPointsForFixedPosesIF(pinholeCamera,
ConstArrayAccessor<HomogenousMatrix4>(invertedFlippedPoses), objectPoints, correspondenceGroups, distortImagePoints, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, worker);
800 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointForFixedOrientations(
const AnyCamera& camera,
const ConstIndexedAccessor<SquareMatrix3>& world_R_cameras,
const ConstIndexedAccessor<Vector2>& imagePoints,
const Vector3& objectPoint,
const Scalar objectPointDistance,
Vector3& optimizedObjectPoint,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoint,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
803 flippedCameras_R_world.reserve(world_R_cameras.
size());
805 for (
size_t n = 0; n < world_R_cameras.
size(); ++n)
810 return optimizeObjectPointForFixedOrientationsIF(camera,
ConstArrayAccessor<SquareMatrix3>(flippedCameras_R_world), imagePoints, objectPoint, objectPointDistance, optimizedObjectPoint, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoint, initialError, finalError, intermediateErrors);
813 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointsAndOnePose(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPose,
const HomogenousMatrix4& secondPose,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedSecondPose,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
818 if (!
optimizeObjectPointsAndOnePoseIF(pinholeCamera, firstPoseIF, secondPoseIF, objectPoints, firstImagePoints, secondImagePoints, useDistortionParameters, optimizedSecondPose, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, intermediateErrors))
823 if (optimizedSecondPose)
831 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointsAndTwoPoses(
const PinholeCamera& pinholeCamera,
const HomogenousMatrix4& firstPose,
const HomogenousMatrix4& secondPose,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ConstIndexedAccessor<Vector2>& firstImagePoints,
const ConstIndexedAccessor<Vector2>& secondImagePoints,
const bool useDistortionParameters,
HomogenousMatrix4* optimizedFirstPose,
HomogenousMatrix4* optimizedSecondPose,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
const Matrix* invertedFirstCovariances,
const Matrix* invertedSecondCovariances,
Scalars* intermediateErrors)
836 if (!
optimizeObjectPointsAndTwoPosesIF(pinholeCamera, firstPoseIF, secondPoseIF, objectPoints, firstImagePoints, secondImagePoints, useDistortionParameters, optimizedFirstPose, optimizedSecondPose, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, invertedFirstCovariances, invertedSecondCovariances, intermediateErrors))
841 if (optimizedFirstPose)
846 if (optimizedSecondPose)
854 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPoses(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& world_T_cameras,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* world_T_optimizedCameras,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
858 const AnyCamera* cameraPointer = &camera;
869 if (!
optimizeObjectPointsAndPosesIF(cameraAccessor,
ConstArrayAccessor<HomogenousMatrix4>(flippedCameras_T_world), objectPoints, correspondenceGroups, accessor_flippedOptimizedCameras_T_world.
pointer(), optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, intermediateErrors))
874 if (world_T_optimizedCameras !=
nullptr)
876 for (
size_t n = 0; n < flippedOptimizedCameras_T_world.size(); ++n)
885 inline bool NonLinearOptimizationObjectPoint::optimizeObjectPointsAndPosesIF(
const AnyCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& flippedCameras_T_world,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
NonconstIndexedAccessor<HomogenousMatrix4>* flippedOptimizedCameras_T_world,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
889 const AnyCamera* cameraPointer = &camera;
895 return optimizeObjectPointsAndPosesIF(cameraAccessor, flippedCameras_T_world, objectPoints, correspondenceGroups, flippedOptimizedCameras_T_world, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, intermediateErrors);
898 inline bool NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPoses(
const PinholeCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& poses,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool useDistortionParameters,
NonconstIndexedAccessor<HomogenousMatrix4>* optimizedPoses,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
902 return slowOptimizeObjectPointsAndPoses(anyCameraPinhole, poses, objectPoints, correspondenceGroups, optimizedPoses, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, intermediateErrors);
905 inline bool NonLinearOptimizationObjectPoint::slowOptimizeObjectPointsAndPosesIF(
const PinholeCamera& camera,
const ConstIndexedAccessor<HomogenousMatrix4>& posesIF,
const ConstIndexedAccessor<Vector3>& objectPoints,
const ObjectPointGroupsAccessor& correspondenceGroups,
const bool useDistortionParameters,
NonconstIndexedAccessor<HomogenousMatrix4>* optimizedPosesIF,
NonconstIndexedAccessor<Vector3>* optimizedObjectPoints,
const unsigned int iterations,
const Geometry::Estimator::EstimatorType estimator,
const Scalar lambda,
const Scalar lambdaFactor,
const bool onlyFrontObjectPoints,
Scalar* initialError,
Scalar* finalError,
Scalars* intermediateErrors)
909 return slowOptimizeObjectPointsAndPosesIF(anyCameraPinhole, posesIF, objectPoints, correspondenceGroups, optimizedPosesIF, optimizedObjectPoints, iterations, estimator, lambda, lambdaFactor, onlyFrontObjectPoints, initialError, finalError, intermediateErrors);
virtual size_t size() const =0
Returns the number of accessible elements of this accessor object.
bool isEmpty() const
Returns whether this accessor provides no elements.
Definition: Accessor.h:1578
static std::vector< typename TAccessor::Type > accessor2elements(const TAccessor &accessor)
Returns all elements of a given accessor (as a block).
Definition: Accessor.h:1584
This class implements the abstract base class for all AnyCamera objects.
Definition: AnyCamera.h:130
This class implements a specialized AnyCamera object wrapping the actual camera model.
Definition: AnyCamera.h:494
static HomogenousMatrixT4< U > standard2InvertedFlipped(const HomogenousMatrixT4< U > &world_T_camera)
Transforms a standard homogenous 4x4 viewing (extrinsic camera) matrix into an inverted and flipped c...
Definition: Camera.h:734
static HomogenousMatrixT4< U > invertedFlipped2Standard(const HomogenousMatrixT4< U > &flippedCamera_T_world)
Transforms an inverted and flipped camera pose into a standard camera pose.
Definition: Camera.h:757
This class implements an accessor providing direct access to a constant array of elements.
Definition: Accessor.h:400
This class implements an accessor providing direct access to a constant array of elements while all e...
Definition: Accessor.h:942
EstimatorType
Definition of individual robust estimator types.
Definition: Estimator.h:34
@ ET_SQUARE
The standard square error estimator (L2).
Definition: Estimator.h:52
size_t groups() const
Returns the number of groups of this accessor.
Definition: NonLinearOptimization.h:668
This class implements an abstract specialization of the accessor for groups of pairs for object point...
Definition: NonLinearOptimization.h:159
This class implements the basic functions for least square or robust optimization algorithms for non ...
Definition: NonLinearOptimization.h:34
Forward declaration of a highly optimized provider object allowing to optimize one camera pose and se...
Definition: NonLinearOptimizationObjectPoint.h:100
Forward declaration of a highly optimized provider object allowing to optimize the orientations of se...
Definition: NonLinearOptimizationObjectPoint.h:121
Forward declaration of a highly optimized provider object allowing to optimize several camera pose an...
Definition: NonLinearOptimizationObjectPoint.h:113
This class implements least square or robust optimization algorithms optimizing the locations of 3D o...
Definition: NonLinearOptimizationObjectPoint.h:32
std::vector< StaticMatrix6x6 > StaticMatrices6x6
Definition of a vector holding 6x6 matrices.
Definition: NonLinearOptimizationObjectPoint.h:68
std::vector< StaticMatrix3x3 > StaticMatrices3x3
Definition of a vector holding 3x3 matrices.
Definition: NonLinearOptimizationObjectPoint.h:58
static bool optimizeObjectPointsForFixedPoses(const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &poseAccessor, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > &optimizedObjectPoints, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Worker *worker=nullptr)
Minimizes the projection errors of given 3D object points, visible in several individual (fixed) came...
Definition: NonLinearOptimizationObjectPoint.h:781
static bool optimizeObjectPointsAndOrientationalPosesIF(const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses...
static bool optimizeObjectPointForFixedOrientationsIF(const AnyCamera &camera, const ConstIndexedAccessor< SquareMatrix3 > &flippedCameras_R_world, const ConstIndexedAccessor< Vector2 > &imagePoints, const Vector3 &objectPoint, const Scalar objectPointDistance, Vector3 &optimizedObjectPoint, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoint=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located...
static bool slowOptimizeObjectPointsAndPosesIF(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
This function is a slow implementation and has been replaced by a faster implementation.
StaticMatrix< Scalar, 3, 6 > StaticMatrix3x6
Definition of a 3x6 matrix.
Definition: NonLinearOptimizationObjectPoint.h:43
StaticMatrix< Scalar, 3, 3 > StaticMatrix3x3
Definition of a 3x3 matrix.
Definition: NonLinearOptimizationObjectPoint.h:38
static bool optimizeObjectPointsAndTwoPoses(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPose, const HomogenousMatrix4 &secondPose, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedFirstPose, HomogenousMatrix4 *optimizedSecondPose, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedFirstCovariances=nullptr, const Matrix *invertedSecondCovariances=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the ...
Definition: NonLinearOptimizationObjectPoint.h:831
StaticMatrix< Scalar, 6, 3 > StaticMatrix6x3
Definition of a 6x3 matrix.
Definition: NonLinearOptimizationObjectPoint.h:48
static bool optimizeObjectPointForFixedStereoPoses(const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_camerasA, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_camerasB, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePointAccessorA, const ConstIndexedAccessor< Vector2 > &imagePointAccessorB, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) ...
Definition: NonLinearOptimizationObjectPoint.h:773
static bool optimizeObjectPointsAndOnePose(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPose, const HomogenousMatrix4 &secondPose, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedSecondPose, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in two individual camera poses by minimizing the ...
Definition: NonLinearOptimizationObjectPoint.h:813
static bool optimizeObjectPointForFixedStereoPosesIF(const AnyCamera &anyCameraA, const AnyCamera &anyCameraB, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCamerasA_T_world, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCamerasB_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePointAccessorA, const ConstIndexedAccessor< Vector2 > &imagePointAccessorB, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) ...
static bool optimizeObjectPointsForFixedPosesIF(const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > &invertedFlippedPoses, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > &optimizedObjectPoints, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Worker *worker=nullptr)
Minimizes the projection errors of given 3D object points, visible in several individual (fixed) came...
static bool optimizeObjectPointsAndOrientations(const PinholeCamera &pinholeCamera, const ConstIndexedAccessor< SquareMatrix3 > &orientations, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, const Scalar objectPointDistance, NonconstIndexedAccessor< SquareMatrix3 > *optimizedOrientations, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual camera poses all located at the ori...
static bool optimizeObjectPointsAndPosesIF(const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses...
static bool optimizeObjectPointsAndPosesIF(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *flippedOptimizedCameras_T_world, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual (inverted and flipped) camera poses...
Definition: NonLinearOptimizationObjectPoint.h:885
static bool optimizeObjectPointsAndTwoPosesIF(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPoseIF, const HomogenousMatrix4 &secondPoseIF, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedFirstPoseIF, HomogenousMatrix4 *optimizedSecondPoseIF, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, const Matrix *invertedFirstCovariances=nullptr, const Matrix *invertedSecondCovariances=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera p...
static bool optimizeObjectPointsAndPoses(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual camera poses by minimizing the proj...
Definition: NonLinearOptimizationObjectPoint.h:854
std::vector< StaticMatrix6x3 > StaticMatrices6x3
Definition of a vector holding 6x3 matrices.
Definition: NonLinearOptimizationObjectPoint.h:63
static bool optimizeObjectPointForFixedPosesIF(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) ...
static bool slowOptimizeObjectPointsAndPoses(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
This function is a slow implementation and has been replaced by a faster implementation.
static bool optimizeObjectPointForFixedPoses(const AnyCamera &camera, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) ...
Definition: NonLinearOptimizationObjectPoint.h:759
static bool optimizeObjectPointsAndPoses(const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual camera poses by minimizing the proj...
static bool optimizeObjectPointForFixedPosesIF(const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &flippedCameras_T_world, const Vector3 &worldObjectPoint, const ConstIndexedAccessor< Vector2 > &imagePoints, Vector3 &optimizedWorldObjectPoint, const unsigned int iterations=5u, const Estimator::EstimatorType estimator=Estimator::ET_SQUARE, Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=10, const bool onlyFrontObjectPoints=true, Scalar *initialRobustError=nullptr, Scalar *finalRobustError=nullptr, Scalars *intermediateRobustErrors=nullptr)
Minimizes the projection errors for one given 3D object point, visible in several individual (fixed) ...
static bool optimizeObjectPointsAndOrientationalPoses(const ConstIndexedAccessor< const AnyCamera * > &cameras, const ConstIndexedAccessor< HomogenousMatrix4 > &world_T_cameras, const ConstIndexedAccessor< Vector3 > &objectPoints, const ObjectPointGroupsAccessor &correspondenceGroups, NonconstIndexedAccessor< HomogenousMatrix4 > *world_T_optimizedCameras, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in individual camera poses by minimizing the proj...
static bool optimizeObjectPointForFixedOrientations(const AnyCamera &camera, const ConstIndexedAccessor< SquareMatrix3 > &world_R_cameras, const ConstIndexedAccessor< Vector2 > &imagePoints, const Vector3 &objectPoint, const Scalar objectPointDistance, Vector3 &optimizedObjectPoint, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoint=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of one 3D object point visible in individual (fixed) camera poses all located...
Definition: NonLinearOptimizationObjectPoint.h:800
static bool optimizeObjectPointsAndOnePoseIF(const PinholeCamera &pinholeCamera, const HomogenousMatrix4 &firstPoseIF, const HomogenousMatrix4 &secondPoseIF, const ConstIndexedAccessor< Vector3 > &objectPoints, const ConstIndexedAccessor< Vector2 > &firstImagePoints, const ConstIndexedAccessor< Vector2 > &secondImagePoints, const bool useDistortionParameters, HomogenousMatrix4 *optimizedSecondPoseIF, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Geometry::Estimator::EstimatorType estimator=Geometry::Estimator::ET_SQUARE, const Scalar lambda=Scalar(0.001), const Scalar lambdaFactor=Scalar(5), const bool onlyFrontObjectPoints=true, Scalar *initialError=nullptr, Scalar *finalError=nullptr, Scalars *intermediateErrors=nullptr)
Optimizes the locations of 3D object points visible in two individual (inverted and flipped) camera p...
StaticMatrix< Scalar, 6, 6 > StaticMatrix6x6
Definition of a 6x6 matrix.
Definition: NonLinearOptimizationObjectPoint.h:53
static void optimizeObjectPointsForFixedPosesIFSubset(const PinholeCamera *pinholeCamera, const ConstIndexedAccessor< HomogenousMatrix4 > *invertedFlippedPoses, const ConstIndexedAccessor< Vector3 > *objectPoints, const ObjectPointGroupsAccessor *correspondenceGroups, const bool distortImagePoints, NonconstIndexedAccessor< Vector3 > *optimizedObjectPoints, const unsigned int iterations, const Estimator::EstimatorType estimator, Scalar lambda, const Scalar lambdaFactor, const bool onlyFrontObjectPoints, const unsigned int firstObjectPoint, const unsigned int numberObjectPoints)
Minimizes the projection errors of a subset of given 3D object points, visible in several individual ...
This class implements an accessor providing direct access to an array of elements.
Definition: Accessor.h:707
This class implements a base class for all indexed-based accessors allowing a non-constant reference ...
Definition: Accessor.h:284
NonconstIndexedAccessor< T > * pointer()
Returns the pointer to this object if this accessor holds at least one element (if this accessor is n...
Definition: Accessor.h:1710
This class implements a matrix with static dimensions.
Definition: StaticMatrix.h:34
This class implements a worker able to distribute function calls over different threads.
Definition: Worker.h:33
float Scalar
Definition of a scalar type.
Definition: Math.h:128
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< Scalar > Scalars
Definition of a vector holding Scalar objects.
Definition: Math.h:144
std::vector< SquareMatrix3 > SquareMatrices3
Definition of a vector holding SquareMatrix3 objects.
Definition: SquareMatrix3.h:71
PinholeCameraT< Scalar > PinholeCamera
Definition of an pinhole camera object with Scalar precision.
Definition: PinholeCamera.h:32
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15