Ocean
Ocean::Tracking::PointCorrespondences Class Reference

This class implements functions determining point correspondences or validates their accuracy. More...

Data Structures

class  Correspondence
 This class defines a correspondence object holding at most one correspondence candidate. More...
 
class  RedundantCorrespondence
 This class extends the correspondence object to allow at most two correspondence candidates. More...
 

Public Types

typedef std::vector< CorrespondenceCorrespondences
 Definition of a vector holding correspondence objects. More...
 
typedef std::vector< RedundantCorrespondenceRedundantCorrespondences
 Definition of a vector holding redundant correspondence sets. More...
 

Static Public Member Functions

static unsigned int determineValidCorrespondences (const HomogenousMatrix4 &extrinsic, const PinholeCamera &pinholeCamera, const Geometry::ObjectPoint *objectPoints, const Geometry::ImagePoint *imagePoints, const size_t correspondences, const bool distortImagePoints, const Scalar sqrPixelError=Scalar(1.5 *1.5), Indices32 *validCorrespondences=nullptr)
 Determines valid correspondences for a set of given object and corresponding image points combined with an extrinsic and intrinsic camera matrix. More...
 
static unsigned int determineValidCorrespondencesIF (const HomogenousMatrix4 &invertedFlippedExtrinsic, const PinholeCamera &pinholeCamera, const Geometry::ObjectPoint *objectPoints, const Geometry::ImagePoint *imagePoints, const size_t correspondences, const bool distortImagePoints, const Scalar sqrPixelError=Scalar(1.5 *1.5), Indices32 *validCorrespondences=nullptr)
 Determines valid correspondences for a set of given object and corresponding image points combined with an extrinsic and intrinsic camera matrix. More...
 
static void removeInvalidCorrespondences (const HomogenousMatrix4 &extrinsic, const PinholeCamera &pinholeCamera, Geometry::ObjectPoints &objectPoints, Geometry::ImagePoints &imagePoints, const bool distortImagePoints, const Scalar sqrPixelError=Scalar(1.5 *1.5))
 Determines valid correspondences in a set of given object and corresponding image points. More...
 
static void removeInvalidCorrespondencesIF (const HomogenousMatrix4 &invertedFlippedExtrinsic, const PinholeCamera &pinholeCamera, Geometry::ObjectPoints &objectPoints, Geometry::ImagePoints &imagePoints, const bool distortImagePoints, const Scalar sqrPixelError=Scalar(1.5 *1.5))
 Determines valid correspondences in a set of given object and corresponding image points. More...
 
static RedundantCorrespondences determineNearestCandidates (const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ImagePoint *candidatePoints, const size_t numberCandidatePoints, const Scalar searchWindowRadius, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from an extra set of candidate image points. More...
 
static RedundantCorrespondences determineNearestCandidates (const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ImagePoint *candidatePoints, const size_t numberCandidatePoints, const unsigned int width, const unsigned int height, const Scalar searchWindowRadius, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from an extra set of candidate image points. More...
 
static RedundantCorrespondences determineNearestCandidates (const HomogenousMatrix4 &extrinsic, const PinholeCamera &pinholeCamera, const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ObjectPoint *candidatePoints, const size_t numberCandidatePoints, const bool distortImagePoints, const Scalar searchWindowRadius, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from a set of candidate projected object points (or simply a second set of image points). More...
 
static RedundantCorrespondences determineNearestCandidatesIF (const HomogenousMatrix4 &invertedFlippedExtrinsic, const PinholeCamera &pinholeCamera, const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ObjectPoint *candidatePoints, const size_t numberCandidatePoints, const bool distortImagePoints, const Scalar searchWindowRadius, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from a set of candidate object points. More...
 
static RedundantCorrespondences determineNearestCandidates (const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ImagePoint *candidatePoints, const size_t numberCandidatePoints, const Scalar searchWindowRadius, const Geometry::SpatialDistribution::DistributionArray &distributionCandidatePoints, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from a set of candidate image points. More...
 
static RedundantCorrespondences determineNearestCandidates (const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ImagePoint *candidatePoints, const Line2 *candidateLines, const size_t numberCandidatePoints, const unsigned int width, const unsigned int height, const Scalar searchWindowRadius, const Scalar maximalLineSqrDistance, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from a set of candidate image points. More...
 
static RedundantCorrespondences determineNearestCandidates (const Geometry::ImagePoint *imagePoints, const size_t numberImagePoints, const Geometry::ImagePoint *candidatePoints, const Line2 *candidateLines, const size_t numberCandidatePoints, const Scalar searchWindowRadius, const Scalar maximalLineSqrDistance, const Geometry::SpatialDistribution::DistributionArray &distributionCandidatePoints, Indices32 *candidateUseCounter=nullptr)
 Determines the nearest candidates for all given image points from a set of candidate image points. More...
 
static Indices32 filterValidCorrespondences (const Vector2 *firstPoints, const Vector2 *secondPoints, const size_t numberPoints, const Scalar thresholdFactor)
 Finds the valid correspondences of a set of given 2D point correspondences according to the median distance of the entire set. More...
 
static Indices32 filterValidCorrespondences (const Vectors2 &firstPoints, const Vectors2 &secondPoints, const Indices32 &subsetIndices, const Scalar thresholdFactor)
 Finds the valid correspondences of a set of given 2D point correspondences according to the median distance of a subset of the entire set. More...
 

Detailed Description

This class implements functions determining point correspondences or validates their accuracy.

Member Typedef Documentation

◆ Correspondences

Definition of a vector holding correspondence objects.

◆ RedundantCorrespondences

Definition of a vector holding redundant correspondence sets.

Member Function Documentation

◆ determineNearestCandidates() [1/6]

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ImagePoint candidatePoints,
const Line2 candidateLines,
const size_t  numberCandidatePoints,
const Scalar  searchWindowRadius,
const Scalar  maximalLineSqrDistance,
const Geometry::SpatialDistribution::DistributionArray distributionCandidatePoints,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from a set of candidate image points.


The spatial distribution of the candidate points must be provided explicitly.
Further, for each candidate point a given 2D line is provided that predicts the position of a corresponding image points (they must lie on these lines).

Parameters
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points from those the nearest correspondences has to be found
candidateLinesLines for each candidate point shrinking the search space to an almost 1D problem
numberCandidatePointsNumber of given candidate points
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
maximalLineSqrDistanceMaximal square distance between point and candidate line
distributionCandidatePointsDistribution of the candidate points (may contain more points as defined by the number of candidate points)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidates() [2/6]

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ImagePoint candidatePoints,
const Line2 candidateLines,
const size_t  numberCandidatePoints,
const unsigned int  width,
const unsigned int  height,
const Scalar  searchWindowRadius,
const Scalar  maximalLineSqrDistance,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from a set of candidate image points.


This function first distributes all candidate points into an array to speed up the search process.
Further, for each candidate point a given 2D line is provided that predicts the position of a corresponding image points (they must lie on these lines).

Parameters
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points from those the nearest correspondences has to be found
candidateLinesLines for each candidate point shrinking the search space to an almost 1D problem
numberCandidatePointsNumber of given candidate points
widthThe width of the image area in pixel
heightThe height of the image area in pixel
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
maximalLineSqrDistanceMaximal square distance between point and candidate line
candidateUseCounterOptional used counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidates() [3/6]

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ImagePoint candidatePoints,
const size_t  numberCandidatePoints,
const Scalar  searchWindowRadius,
const Geometry::SpatialDistribution::DistributionArray distributionCandidatePoints,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from a set of candidate image points.


The spatial distribution of the candidate points must be provided explicitly.

Parameters
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points to found the nearest correspondences from
numberCandidatePointsNumber of given candidate points
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
distributionCandidatePointsDistribution of the candidate points (may contain more points as defined by the number of candidate points)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidates() [4/6]

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ImagePoint candidatePoints,
const size_t  numberCandidatePoints,
const Scalar  searchWindowRadius,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from an extra set of candidate image points.


Parameters
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points to found the nearest correspondences from
numberCandidatePointsNumber of given candidate points
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidates() [5/6]

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ImagePoint candidatePoints,
const size_t  numberCandidatePoints,
const unsigned int  width,
const unsigned int  height,
const Scalar  searchWindowRadius,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from an extra set of candidate image points.


This function first distributes all candidate points into an array to speed up the search process.

Parameters
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points to found the nearest correspondences from
numberCandidatePointsNumber of given candidate points
widthThe width of the image area in pixel
heightThe height of the image area in pixel
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidates() [6/6]

PointCorrespondences::RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidates ( const HomogenousMatrix4 extrinsic,
const PinholeCamera pinholeCamera,
const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ObjectPoint candidatePoints,
const size_t  numberCandidatePoints,
const bool  distortImagePoints,
const Scalar  searchWindowRadius,
Indices32 candidateUseCounter = nullptr 
)
inlinestatic

Determines the nearest candidates for all given image points from a set of candidate projected object points (or simply a second set of image points).


All object points will be projected into the image plane to find the neighbors for the image points.

Parameters
extrinsicExtrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points to found the nearest correspondences from
numberCandidatePointsNumber of given candidate points
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineNearestCandidatesIF()

static RedundantCorrespondences Ocean::Tracking::PointCorrespondences::determineNearestCandidatesIF ( const HomogenousMatrix4 invertedFlippedExtrinsic,
const PinholeCamera pinholeCamera,
const Geometry::ImagePoint imagePoints,
const size_t  numberImagePoints,
const Geometry::ObjectPoint candidatePoints,
const size_t  numberCandidatePoints,
const bool  distortImagePoints,
const Scalar  searchWindowRadius,
Indices32 candidateUseCounter = nullptr 
)
static

Determines the nearest candidates for all given image points from a set of candidate object points.


All object points will be projected into the image plane to find the neighbors for the image points.

Parameters
invertedFlippedExtrinsicInverted and flipped extrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
imagePointsImage points to find the candidates for
numberImagePointsNumber of image points
candidatePointsCandidate points to found the nearest correspondences from
numberCandidatePointsNumber of given candidate points
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
searchWindowRadiusSize of the search window (as 'radius') to accept a candidate, with range (0, infinity)
candidateUseCounterOptional used-counter of the candidate points
Returns
Resulting redundant correspondences

◆ determineValidCorrespondences()

unsigned int Ocean::Tracking::PointCorrespondences::determineValidCorrespondences ( const HomogenousMatrix4 extrinsic,
const PinholeCamera pinholeCamera,
const Geometry::ObjectPoint objectPoints,
const Geometry::ImagePoint imagePoints,
const size_t  correspondences,
const bool  distortImagePoints,
const Scalar  sqrPixelError = Scalar(1.5 * 1.5),
Indices32 validCorrespondences = nullptr 
)
inlinestatic

Determines valid correspondences for a set of given object and corresponding image points combined with an extrinsic and intrinsic camera matrix.

Parameters
extrinsicExtrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
objectPoints3D Object points corresponding to the given pose
imagePoints2D Image points corresponding to the image points
correspondencesNumber of point correspondences to be used
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
sqrPixelErrorMaximal allowed squared pixel error for a correspondence to count as valid
validCorrespondencesOptional resulting valid correspondence indices
Returns
Number of valid correspondences
See also
determineValidCorrespondencesIF().

◆ determineValidCorrespondencesIF()

static unsigned int Ocean::Tracking::PointCorrespondences::determineValidCorrespondencesIF ( const HomogenousMatrix4 invertedFlippedExtrinsic,
const PinholeCamera pinholeCamera,
const Geometry::ObjectPoint objectPoints,
const Geometry::ImagePoint imagePoints,
const size_t  correspondences,
const bool  distortImagePoints,
const Scalar  sqrPixelError = Scalar(1.5 *1.5),
Indices32 validCorrespondences = nullptr 
)
static

Determines valid correspondences for a set of given object and corresponding image points combined with an extrinsic and intrinsic camera matrix.

Parameters
invertedFlippedExtrinsicInverted and flipped extrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
objectPoints3D Object points corresponding to the given pose
imagePoints2D Image points corresponding to the image points
correspondencesNumber of point correspondences to be used
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
sqrPixelErrorMaximal allowed squared pixel error for a correspondence to count as valid
validCorrespondencesOptional resulting valid correspondence indices
Returns
Number of valid correspondences
See also
determineValidCorrespondences().

◆ filterValidCorrespondences() [1/2]

static Indices32 Ocean::Tracking::PointCorrespondences::filterValidCorrespondences ( const Vector2 firstPoints,
const Vector2 secondPoints,
const size_t  numberPoints,
const Scalar  thresholdFactor 
)
static

Finds the valid correspondences of a set of given 2D point correspondences according to the median distance of the entire set.

Parameters
firstPointsPoints of the first set
secondPointsPoints of the second set, each point corresponds to one in the first set (with same index)
numberPointsNumber of provided points in each set
thresholdFactorFactor that is applied to the median distance to filter valid correspondences
Returns
Indices of all valid correspondences

◆ filterValidCorrespondences() [2/2]

static Indices32 Ocean::Tracking::PointCorrespondences::filterValidCorrespondences ( const Vectors2 firstPoints,
const Vectors2 secondPoints,
const Indices32 subsetIndices,
const Scalar  thresholdFactor 
)
static

Finds the valid correspondences of a set of given 2D point correspondences according to the median distance of a subset of the entire set.

This function needs a set of indices determining the subset of the given points that are investigated.

Parameters
firstPointsPoints of the first set
secondPointsPoints of the second set, each point corresponds to one in the first set (with same index)
subsetIndicesSubset of the given two point sets that are investigated for correspondence determination
thresholdFactorFactor that is applied to the median distance to filter valid correspondences
Returns
Indices of all valid correspondences

◆ removeInvalidCorrespondences()

void Ocean::Tracking::PointCorrespondences::removeInvalidCorrespondences ( const HomogenousMatrix4 extrinsic,
const PinholeCamera pinholeCamera,
Geometry::ObjectPoints objectPoints,
Geometry::ImagePoints imagePoints,
const bool  distortImagePoints,
const Scalar  sqrPixelError = Scalar(1.5 * 1.5) 
)
inlinestatic

Determines valid correspondences in a set of given object and corresponding image points.

Invalid correspondences will be removed from the given point set. Thus, this function detects outliers.

Parameters
extrinsicExtrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
objectPoints3D Object points corresponding to the given pose, each 3D point matches to a 2D point with the same index
imagePoints2D Image points corresponding to the image points, each 2D point matches to a 3D point with the same index
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
sqrPixelErrorMaximal allowed squared pixel error for a correspondence to count as valid

◆ removeInvalidCorrespondencesIF()

static void Ocean::Tracking::PointCorrespondences::removeInvalidCorrespondencesIF ( const HomogenousMatrix4 invertedFlippedExtrinsic,
const PinholeCamera pinholeCamera,
Geometry::ObjectPoints objectPoints,
Geometry::ImagePoints imagePoints,
const bool  distortImagePoints,
const Scalar  sqrPixelError = Scalar(1.5 *1.5) 
)
static

Determines valid correspondences in a set of given object and corresponding image points.

Invalid correspondences will be removed from the given point set. Thus, this function detects outliers.

Parameters
invertedFlippedExtrinsicInverted and flipped extrinsic camera matrix
pinholeCameraThe pinhole camera specifying the internal camera parameters and optionally distortion
objectPoints3D Object points corresponding to the given pose, each 3D point matches to a 2D point with the same index
imagePoints2D Image points corresponding to the image points, each 2D point matches to a 3D point with the same index
distortImagePointsTrue, to force the distortion of the image points using the distortion parameters of this camera object
sqrPixelErrorMaximal allowed squared pixel error for a correspondence to count as valid

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