Ocean
Loading...
Searching...
No Matches
Ocean::Tracking::PoseEstimationT Class Reference

This class implements functions to estimate camera poses using template-based data types. More...

#include <PoseEstimationT.h>

Public Types

template<typename TDescriptor >
using UnorderedDescriptorMap = std::unordered_map< Index32, TDescriptor >
 Definition of an unordered map mapping object point ids to descriptors.
 

Static Public Member Functions

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static bool determinePoseBruteForce (const AnyCamera &camera, const Vector3 *objectPoints, const TObjectPointDescriptor *objectPointDescriptors, const size_t numberObjectPoints, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, const size_t numberImagePoints, RandomGenerator &randomGenerator, HomogenousMatrix4 &world_T_camera, const unsigned int minimalNumberCorrespondences, const TDescriptorDistance maximalDescriptorDistance, const Scalar maximalProjectionError, const Scalar inlierRate=Scalar(0.15), Indices32 *usedObjectPointIndices=nullptr, Indices32 *usedImagePointIndices=nullptr, const HomogenousMatrix4 &world_T_roughCamera=HomogenousMatrix4(false), Worker *worker=nullptr)
 Determines the 6-DOF pose for 2D/3D correspondences applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static bool determinePoseBruteForceWithArbitraryDescriptorOrder (const AnyCamera &camera, const Vector3 *objectPoints, const TObjectPointDescriptor *objectPointDescriptors, const Index32 *objectPointIndices, const size_t numberObjectDescriptors, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, const size_t numberImagePoints, RandomGenerator &randomGenerator, HomogenousMatrix4 &world_T_camera, const unsigned int minimalNumberCorrespondences, const TDescriptorDistance maximalDescriptorDistance, const Scalar maximalProjectionError, const Scalar inlierRate=Scalar(0.15), Indices32 *usedObjectPointIndices=nullptr, Indices32 *usedImagePointIndices=nullptr, const HomogenousMatrix4 &world_T_roughCamera=HomogenousMatrix4(false))
 Determines the 6-DOF pose for 2D/3D correspondences applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineUnguidedBruteForceMatchings (const TObjectPointDescriptor *objectPointDescriptors, const size_t numberObjectPointDescriptors, const TImagePointDescriptor *imagePointDescriptors, const size_t numberImagePointDescriptors, TDescriptorDistance maximalDescriptorDistance, Index32 *objectPointDescriptorIndices, Worker *worker, TDescriptorDistance *distances=nullptr)
 Determines the unguided matching (without apriori information) between image point and object point features applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineGuidedBruteForceMatchings (const AnyCamera &camera, const HomogenousMatrix4 &world_T_roughCamera, const Vector3 *objectPoints, const TObjectPointDescriptor *objectPointDescriptors, const size_t numberObjectPoints, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, const size_t numberImagePoints, TDescriptorDistance maximalDescriptorDistance, const Scalar maximalProjectionError, Index32 *objectPointDescriptorIndices, Worker *worker)
 Determines the guided matching (without known rough camera pose) between image point and object point features applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineGuidedMatchings (const AnyCamera &camera, const HomogenousMatrix4 &world_T_camera, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, const size_t numberImagePoints, const Vector3 *objectPoints, const Geometry::Octree &objectPointOctree, const Index32 *objectPointIds, const UnorderedDescriptorMap< TObjectPointDescriptor > &objectPointDescriptorMap, Vectors2 &matchedImagePoints, Vectors3 &matchedObjectPoints, const TDescriptorDistance maximalDescriptorDistance, Indices32 *matchedImagePointIndices=nullptr, Indices32 *matchedObjectPointIds=nullptr, Worker *worker=nullptr)
 Determines the guided matching between 2D/3D correspondences.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static std::vector< TDescriptorDistance > determineDescriptorDistances (const TObjectPointDescriptor *objectPointDescriptors, const TImagePointDescriptor *imagePointDescriptors, const Index32 *objectPointDescriptorIndices, const Index32 *imagePointDescriptorIndices, const size_t numberCorrespondences)
 Returns the individual descriptor distances for a given set of corresponding feature descriptor pairs.
 

Static Protected Member Functions

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineUnguidedBruteForceMatchingsSubset (const TObjectPointDescriptor *objectPointDescriptors, const size_t numberObjectPointDescriptors, const TImagePointDescriptor *imagePointDescriptors, TDescriptorDistance maximalDescriptorDistance, Index32 *objectPointDescriptorIndices, TDescriptorDistance *distances, const unsigned int firstImagePointDescriptor, const unsigned int numberImagePointDescriptors)
 Determines the unguided matching between a subset of image point and object point features applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineGuidedBruteForceMatchingsSubset (const AnyCamera *camera, const HomogenousMatrix4 *world_T_roughCamera, const Vector3 *objectPoints, const TObjectPointDescriptor *objectPointDescriptors, const size_t numberObjectPoints, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, TDescriptorDistance maximalDescriptorDistance, const Scalar maximalProjectionError, Index32 *objectPointDescriptorIndices, const unsigned int firstImagePoint, const unsigned int numberImagePoints)
 Determines the guided matching (without known rough camera pose) between a subset of image point and object point features applying a brute-force search.
 
template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
static void determineGuidedMatchingsSubset (const AnyCamera *camera, const HomogenousMatrix4 *world_T_camera, const Vector2 *imagePoints, const TImagePointDescriptor *imagePointDescriptors, const Vector3 *objectPoints, const Geometry::Octree *objectPointOctree, const Index32 *objectPointIds, const UnorderedDescriptorMap< TObjectPointDescriptor > *objectPointDescriptorMap, Vectors2 *matchedImagePoints, Vectors3 *matchedObjectPoints, Indices32 *matchedImagePointIndices, Indices32 *matchedObjectPointIds, const TDescriptorDistance maximalDescriptorDistance, Lock *lock, const unsigned int firstImagePoint, const unsigned int numberImagePoints)
 Determines the guided matching between 2D/3D correspondences for a subset of the given 2D image points.
 

Detailed Description

This class implements functions to estimate camera poses using template-based data types.

Member Typedef Documentation

◆ UnorderedDescriptorMap

template<typename TDescriptor >
using Ocean::Tracking::PoseEstimationT::UnorderedDescriptorMap = std::unordered_map<Index32, TDescriptor>

Definition of an unordered map mapping object point ids to descriptors.

Member Function Documentation

◆ determineDescriptorDistances()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
std::vector< TDescriptorDistance > Ocean::Tracking::PoseEstimationT::determineDescriptorDistances ( const TObjectPointDescriptor *  objectPointDescriptors,
const TImagePointDescriptor *  imagePointDescriptors,
const Index32 objectPointDescriptorIndices,
const Index32 imagePointDescriptorIndices,
const size_t  numberCorrespondences 
)
static

Returns the individual descriptor distances for a given set of corresponding feature descriptor pairs.

This function can be used to e.g., analyze the distribution of descriptor distances and e.g., to determine an ideal threshold for valid descriptor correspondences.

Parameters
objectPointDescriptorsThe descriptors of the object points, must be valid
imagePointDescriptorsThe descriptors of the image points, must be valid
objectPointDescriptorIndicesThe indices of the object point descriptors for which a corresponding image point descriptor exists, must be valid
imagePointDescriptorIndicesThe indices of the image point descriptors for which a corresponding object point descriptor exists, one for each object point descriptor, with the same order as the object point descriptors, must be valid
numberCorrespondencesThe number of specified descriptor correspondences, with range [1, infinity)
Returns
The descriptor distances, one of each corresponding descriptor pair, in the same order as the provided correspondences
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineGuidedBruteForceMatchings()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineGuidedBruteForceMatchings ( const AnyCamera camera,
const HomogenousMatrix4 world_T_roughCamera,
const Vector3 objectPoints,
const TObjectPointDescriptor *  objectPointDescriptors,
const size_t  numberObjectPoints,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
const size_t  numberImagePoints,
TDescriptorDistance  maximalDescriptorDistance,
const Scalar  maximalProjectionError,
Index32 objectPointDescriptorIndices,
Worker worker 
)
static

Determines the guided matching (without known rough camera pose) between image point and object point features applying a brute-force search.

Parameters
cameraThe camera profile defining the projection, must be valid
world_T_roughCameraThe known rough camera pose transforming camera to world, must be valid
objectPointsThe 3D object points to be used, must be valid
objectPointDescriptorsThe object point descriptors, one for each 3D object point, must be valid
numberObjectPointsThe number of given object points (and object point descriptors), with range [1, infinity)
imagePointsThe 2D image points to be used, must be valid
imagePointDescriptorsThe image point descriptors, one for each 2D image point, must be valid
numberImagePointsThe number of given image points (and image point descriptors), with range [1, infinity)
maximalDescriptorDistanceThe maximal distance between two corresponding descriptors, with range [0, infinity)
maximalProjectionErrorThe maximal projection error of valid 2D/3D feature correspondences, in pixel, with range [0, infinity)
objectPointDescriptorIndicesThe resulting indices of object point descriptors matching to the individual image point descriptors, one object point descriptor index of each given image point descriptor, -1 for image point descriptors for which no matching object point descriptor could be found
workerOptional worker to distribute the computation
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineGuidedBruteForceMatchingsSubset()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineGuidedBruteForceMatchingsSubset ( const AnyCamera camera,
const HomogenousMatrix4 world_T_roughCamera,
const Vector3 objectPoints,
const TObjectPointDescriptor *  objectPointDescriptors,
const size_t  numberObjectPoints,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
TDescriptorDistance  maximalDescriptorDistance,
const Scalar  maximalProjectionError,
Index32 objectPointDescriptorIndices,
const unsigned int  firstImagePoint,
const unsigned int  numberImagePoints 
)
staticprotected

Determines the guided matching (without known rough camera pose) between a subset of image point and object point features applying a brute-force search.

Parameters
cameraThe camera profile defining the projection, must be valid
world_T_roughCameraThe known rough camera pose transforming camera to world, must be valid
objectPointsThe 3D object points to be used, must be valid
objectPointDescriptorsThe object point descriptors, one for each 3D object point, must be valid
numberObjectPointsThe number of given object points (and object point descriptors), with range [1, infinity)
imagePointsThe 2D image points to be used, must be valid
imagePointDescriptorsThe image point descriptors, one for each 2D image point, must be valid
maximalDescriptorDistanceThe maximal distance between two corresponding descriptors, with range [0, infinity)
maximalProjectionErrorThe maximal projection error of valid 2D/3D feature correspondences, in pixel, with range [0, infinity)
objectPointDescriptorIndicesThe resulting indices of object point descriptors matching to the individual image point descriptors, one object point descriptor index of each given image point descriptor, -1 for image point descriptors for which no matching object point descriptor could be found
firstImagePointThe first image point to be handled, with range [0, numberImagePoints - 1]
numberImagePointsThe number of image points to be handled, with range [1, numberImagePoints - firstImagePoint]
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineGuidedMatchings()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineGuidedMatchings ( const AnyCamera camera,
const HomogenousMatrix4 world_T_camera,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
const size_t  numberImagePoints,
const Vector3 objectPoints,
const Geometry::Octree objectPointOctree,
const Index32 objectPointIds,
const UnorderedDescriptorMap< TObjectPointDescriptor > &  objectPointDescriptorMap,
Vectors2 matchedImagePoints,
Vectors3 matchedObjectPoints,
const TDescriptorDistance  maximalDescriptorDistance,
Indices32 matchedImagePointIndices = nullptr,
Indices32 matchedObjectPointIds = nullptr,
Worker worker = nullptr 
)
static

Determines the guided matching between 2D/3D correspondences.

Parameters
cameraThe camera profile to be used, must be valid
world_T_cameraThe known (rough) camera pose transforming camera to world, with default camera looking into the negative z-space an y-axis upwards, must be valid
imagePointsThe 2D image points of all possible 2D features, must be valid
imagePointDescriptorsThe descriptors for all 2D image points, one for each image points, must be valid
numberImagePointsThe number of 2D image points, with range [4, infinity)
objectPointsThe 3D object points of all possible 3D features, must be valid
objectPointOctreeThe octree with all 3D object points
objectPointIdsThe ids of all 3D object points, one for each 3D object point, must be valid
objectPointDescriptorMapThe map mapping 3D object point ids to their descriptors
matchedImagePointsThe resulting 2D image points which have been determined during the matching
matchedObjectPointsThe resulting 3D object points which have been determined during the matching
maximalDescriptorDistanceThe maximal descriptor distance so that two descriptors are still considered to match, with range [0, infinity)
matchedImagePointIndicesOptional resulting indices of the image points which have been matched, one for each resulting 2D image points, nullptr if not of interest
matchedObjectPointIdsOptional resulting object point ids of the object points which have been matched, one for each resulting 3D image points, nullptr if not of interest
workerOptional worker to distribute the computation
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineGuidedMatchingsSubset()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineGuidedMatchingsSubset ( const AnyCamera camera,
const HomogenousMatrix4 world_T_camera,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
const Vector3 objectPoints,
const Geometry::Octree objectPointOctree,
const Index32 objectPointIds,
const UnorderedDescriptorMap< TObjectPointDescriptor > *  objectPointDescriptorMap,
Vectors2 matchedImagePoints,
Vectors3 matchedObjectPoints,
Indices32 matchedImagePointIndices,
Indices32 matchedObjectPointIds,
const TDescriptorDistance  maximalDescriptorDistance,
Lock lock,
const unsigned int  firstImagePoint,
const unsigned int  numberImagePoints 
)
staticprotected

Determines the guided matching between 2D/3D correspondences for a subset of the given 2D image points.

Parameters
cameraThe camera profile to be used, must be valid
world_T_cameraThe known (rough) camera pose transforming camera to world, with default camera looking into the negative z-space an y-axis upwards, must be valid
imagePointsThe 2D image points of all possible 2D features, must be valid
imagePointDescriptorsThe descriptors for all 2D image points, one for each image points, must be valid
objectPointsThe 3D object points of all possible 3D features, must be valid
objectPointOctreeThe octree with all 3D object points
objectPointIdsThe ids of all 3D object points, one for each 3D object point, must be valid
objectPointDescriptorMapThe map mapping 3D object point ids to their descriptors
matchedImagePointsThe resulting 2D image points which have been determined during the matching
matchedObjectPointsThe resulting 3D object points which have been determined during the matching
maximalDescriptorDistanceThe maximal descriptor distance so that two descriptors are still considered to match, with range [0, infinity)
matchedImagePointIndicesThe resulting indices of the image points which have been matched, one for each resulting 2D image points, nullptr if not of interest
matchedObjectPointIdsThe resulting object point ids of the object points which have been matched, one for each resulting 3D image points, nullptr if not of interest
lockThe lock object in case this function is executed across multiple thread, nullptr if executed in one thread
firstImagePointThe index of the first image point to be handled, with range [0, numberImagePoints - 1]
numberImagePointsThe number of image points to be handled, with range [1, numberImagePoints - firstImagePoint]
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determinePoseBruteForce()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
bool Ocean::Tracking::PoseEstimationT::determinePoseBruteForce ( const AnyCamera camera,
const Vector3 objectPoints,
const TObjectPointDescriptor *  objectPointDescriptors,
const size_t  numberObjectPoints,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
const size_t  numberImagePoints,
RandomGenerator randomGenerator,
HomogenousMatrix4 world_T_camera,
const unsigned int  minimalNumberCorrespondences,
const TDescriptorDistance  maximalDescriptorDistance,
const Scalar  maximalProjectionError,
const Scalar  inlierRate = Scalar(0.15),
Indices32 usedObjectPointIndices = nullptr,
Indices32 usedImagePointIndices = nullptr,
const HomogenousMatrix4 world_T_roughCamera = HomogenousMatrix4(false),
Worker worker = nullptr 
)
static

Determines the 6-DOF pose for 2D/3D correspondences applying a brute-force search.

The function can be used to verify the performance/correctness of pose estimation functions avoiding a brute-force search.

Parameters
cameraThe camera profile to be used, must be valid
objectPointsThe 3D object points of all possible 3D features, must be valid
objectPointDescriptorsThe descriptors for all 3D object points, one descriptor for each 3D object point (however, TObjectPointDescriptor allows to e.g., define a array/vector of several descriptors per object point), must be valid
numberObjectPointsThe number of given 3D object points (and object point descriptors), with range [4, infinity)
imagePointsThe 2D image points of all possible 2D features, must be valid
imagePointDescriptorsThe descriptors for all 2D image points, one for each image points, must be valid
numberImagePointsThe number of 2D image points, with range [4, infinity)
randomGeneratorThe random generator to be used
world_T_cameraThe resulting camera pose transforming camera to world, with default camera looking into the negative z-space an y-axis upwards
minimalNumberCorrespondencesThe minimal number of 2D/3D correspondences so that a camera pose counts as valid, with range [4, infinity)
maximalDescriptorDistanceThe maximal descriptor distance so that two descriptors are still considered to match, with range [0, infinity)
maximalProjectionErrorThe maximal projection error between a projected 3D object point and a 2D image point so that both points count as corresponding, in pixel, with range [0, infinity)
inlierRateThe rate of correspondence inliers within the entire set of correspondences, e.g., 0.15 means that 15% of matched features are correct and can be used to determine a valid pose, with range (0, 1]
usedObjectPointIndicesOptional resulting indices of the 3D object points which have been used to determine the camera pose, nullptr if not of interest
usedImagePointIndicesOptional resulting indices of the 2D image points which have been used to determine the camera pose, nullptr if not of interest
world_T_roughCameraOptional known rough camera pose allowing to skip the unguided matching, invalid if unknown
workerOptional worker to distribute the computation
Returns
True, if succeeded
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determinePoseBruteForceWithArbitraryDescriptorOrder()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
bool Ocean::Tracking::PoseEstimationT::determinePoseBruteForceWithArbitraryDescriptorOrder ( const AnyCamera camera,
const Vector3 objectPoints,
const TObjectPointDescriptor *  objectPointDescriptors,
const Index32 objectPointIndices,
const size_t  numberObjectDescriptors,
const Vector2 imagePoints,
const TImagePointDescriptor *  imagePointDescriptors,
const size_t  numberImagePoints,
RandomGenerator randomGenerator,
HomogenousMatrix4 world_T_camera,
const unsigned int  minimalNumberCorrespondences,
const TDescriptorDistance  maximalDescriptorDistance,
const Scalar  maximalProjectionError,
const Scalar  inlierRate = Scalar(0.15),
Indices32 usedObjectPointIndices = nullptr,
Indices32 usedImagePointIndices = nullptr,
const HomogenousMatrix4 world_T_roughCamera = HomogenousMatrix4(false) 
)
static

Determines the 6-DOF pose for 2D/3D correspondences applying a brute-force search.

The function can be used to verify the performance/correctness of pose estimation functions avoiding a brute-force search. This function uses descriptors for 3D object points which can be stored in an arbitrary order (even multiple individual descriptors can exist for one 3D object point). The relationship between object point descriptors and their corresponding 3D object point locations is defined via 'objectPointIndices'.

Parameters
cameraThe camera profile to be used, must be valid
objectPointsThe 3D object points of all possible 3D features, must be valid
objectPointDescriptorsThe descriptors for all 3D object points, some descriptors may describe the same 3D object points (e.g., because of different viewing locations), must be valid
objectPointIndicesThe indices of the corresponding 3D object points, one for each object point descriptor, mainly a map mapping descriptor indices to point indices, must be valid
numberObjectDescriptorsThe number of given descriptors for the 3D object points, with range [4, infinity)
imagePointsThe 2D image points of all possible 2D features, must be valid
imagePointDescriptorsThe descriptors for all 2D image points, one for each image points, must be valid
numberImagePointsThe number of 2D image points, with range [4, infinity)
randomGeneratorThe random generator to be used
world_T_cameraThe resulting camera pose transforming camera to world, with default camera looking into the negative z-space an y-axis upwards
minimalNumberCorrespondencesThe minimal number of 2D/3D correspondences so that a camera pose counts as valid, with range [4, infinity)
maximalDescriptorDistanceThe maximal descriptor distance so that two descriptors are still considered to match, with range [0, infinity)
maximalProjectionErrorThe maximal projection error between a projected 3D object point and a 2D image point so that both points count as corresponding, in pixel, with range [0, infinity)
inlierRateThe rate of correspondence inliers within the entire set of correspondences, e.g., 0.15 means that 15% of matched features are correct and can be used to determine a valid pose, with range (0, 1]
usedObjectPointIndicesOptional resulting indices of the 3D object points which have been used to determine the camera pose, nullptr if not of interest
usedImagePointIndicesOptional resulting indices of the 2D image points which have been used to determine the camera pose, nullptr if not of interest
world_T_roughCameraOptional known rough camera pose allowing to skip the unguided matching, invalid if unknown
Returns
True, if succeeded
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineUnguidedBruteForceMatchings()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineUnguidedBruteForceMatchings ( const TObjectPointDescriptor *  objectPointDescriptors,
const size_t  numberObjectPointDescriptors,
const TImagePointDescriptor *  imagePointDescriptors,
const size_t  numberImagePointDescriptors,
TDescriptorDistance  maximalDescriptorDistance,
Index32 objectPointDescriptorIndices,
Worker worker,
TDescriptorDistance *  distances = nullptr 
)
static

Determines the unguided matching (without apriori information) between image point and object point features applying a brute-force search.

Parameters
objectPointDescriptorsThe object point descriptors to be used, must be valid
numberObjectPointDescriptorsThe number of given object point descriptors, with range [1, infinity)
imagePointDescriptorsThe image point descriptors to be used, must be valid
numberImagePointDescriptorsThe number of given image point descriptors, with range [1, infinity)
maximalDescriptorDistanceThe maximal distance between two corresponding descriptors, with range [0, infinity)
objectPointDescriptorIndicesThe resulting indices of object point descriptors matching to the individual image point descriptors, one object point descriptor index of each given image point descriptor, -1 for image point descriptors for which no matching object point descriptor could be found
workerOptional worker to distribute the computation
distancesOptional resulting distances between the individual matched descriptors, one for each image point descriptor, undefined if no matching exists, nullptr if not of interest
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

◆ determineUnguidedBruteForceMatchingsSubset()

template<typename TImagePointDescriptor , typename TObjectPointDescriptor , typename TDescriptorDistance , TDescriptorDistance(*)(const TImagePointDescriptor &, const TObjectPointDescriptor &) tImageObjectDistanceFunction>
void Ocean::Tracking::PoseEstimationT::determineUnguidedBruteForceMatchingsSubset ( const TObjectPointDescriptor *  objectPointDescriptors,
const size_t  numberObjectPointDescriptors,
const TImagePointDescriptor *  imagePointDescriptors,
TDescriptorDistance  maximalDescriptorDistance,
Index32 objectPointDescriptorIndices,
TDescriptorDistance *  distances,
const unsigned int  firstImagePointDescriptor,
const unsigned int  numberImagePointDescriptors 
)
staticprotected

Determines the unguided matching between a subset of image point and object point features applying a brute-force search.

Parameters
objectPointDescriptorsThe object point descriptors to be used, must be valid
numberObjectPointDescriptorsThe number of given object point descriptors, with range [1, infinity)
imagePointDescriptorsThe image point descriptors to be used, must be valid
maximalDescriptorDistanceThe maximal distance between two corresponding descriptors, with range [0, infinity)
objectPointDescriptorIndicesThe resulting indices of object point descriptors matching to the individual image point descriptors, one object point descriptor index of each given image point descriptor, -1 for image point descriptors for which no matching object point descriptor could be found
distancesOptional resulting distances between the individual matched descriptors, one for each image point descriptor, nullptr if not of interest
firstImagePointDescriptorThe first image point descriptor to be handled, with range [0, numberImagePointDescriptors - 1]
numberImagePointDescriptorsThe number of image point descriptors to be handled, with range [1, numberImagePointDescriptors - firstImagePointDescriptor]
Template Parameters
TImagePointDescriptorThe data type of the descriptor for the 2D image points
TObjectPointDescriptorThe data type of the descriptor for the 3D object points
TDescriptorDistanceThe data type of the distance between image point and object point descriptors, e.g., 'uint32_t' or 'float'
tImageObjectDistanceFunctionThe function pointer to a function allowing to determine the descriptor distance between an image point feature descriptor and an object point feature descriptor, must be valid

The documentation for this class was generated from the following file: