Ocean
Ocean::Tracking::HomographyPlaneFinder Class Reference

This class implements a 3D plane finder that determines the plane by calculation of a homography between two frames taken from two individual camera positions. More...

Inheritance diagram for Ocean::Tracking::HomographyPlaneFinder:

Public Types

typedef std::pair< Vector3, Vector3NormalPair
 Definition of a pair storing two corresponding normals. More...
 

Public Member Functions

 HomographyPlaneFinder ()
 Creates a new plane finder object. More...
 
const Vectors2initialImagePoints () const
 Returns the first point set that is stored. More...
 
const Vectors2currentImagePoints () const
 Returns the current point set that is stored. More...
 
virtual bool addImagePoint (const Vectors2 &imagePoints)
 Adds new image points as new set of correspondences. More...
 
virtual bool addImagePoint (Vectors2 &&imagePoints)
 Adds new image points as new set of correspondences. More...
 
virtual bool addImagePoint (const Vectors2 &imagePoints, const Indices32 &validIndices)
 Adds a new subset of image points that corresponds to a subset of the stored sets of image points. More...
 
bool addPlaneCandidates (const PinholeCamera &pinhole)
 Determines a new set of plane candidates matching with the currently stored image point correspondences. More...
 
bool hasAccuratePlane (const Scalar maxAngle)
 Checks whether one of the last three successive frames provided almost identical plane normals. More...
 
bool determineMostAccuratePlanes (Plane3 planes[2])
 Determines the pair of planes which have been determined in the previous calls of addPlaneCandidates(). More...
 
- Public Member Functions inherited from Ocean::Tracking::PlaneFinder
size_t size () const
 Returns the number of stored correspondence sets. More...
 
size_t imagePoints () const
 Returns the number of image points within each individual correspondence set. More...
 
const Vectors2firstImagePoints () const
 Returns the first set of image points. More...
 
const Vectors2lastImagePoints () const
 Returns the last set of image points. More...
 
Scalar sqrDistance () const
 Calculates the summed square distance between the first image points and the corresponding image points in the most recent set of image points. More...
 
bool reduce (const Indices32 &validIndices)
 Reduces the image points within each set of corresponding image points. More...
 

Protected Types

typedef std::vector< NormalPairNormalPairs
 Definition of a vector holding pairs of normals. More...
 
- Protected Types inherited from Ocean::Tracking::PlaneFinder
typedef CorrespondenceSet< Vector2ImagePointCorrespondenceSet
 Definition of a correspondence set object with handling 2D vectors. More...
 

Static Protected Member Functions

static Scalar maximalCosBetweenNormalPairs (const NormalPair &minus, const NormalPair &center, const NormalPair &plus)
 Determines the maximal cosine value between three pairs of plane normals. More...
 
static bool determineBestNormalPair (const NormalPairs &normalPairs, size_t &index, Scalar &angle)
 Determines the pair of normals with smallest angle. More...
 

Protected Attributes

NormalPairs planeFinderNormalPairs
 Successive plane normal sets. More...
 
RandomGenerator randomGenerator
 Random number generator. More...
 
size_t planeImagePointsSets
 Number of image points sets that have been added. More...
 
- Protected Attributes inherited from Ocean::Tracking::PlaneFinder
ImagePointCorrespondenceSet imagePointCorrespondences
 The set of image point correspondences. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ocean::Tracking::PlaneFinder
 PlaneFinder ()
 Creates a new plane finder object. More...
 
virtual ~PlaneFinder ()=default
 Destructs this object. More...
 

Detailed Description

This class implements a 3D plane finder that determines the plane by calculation of a homography between two frames taken from two individual camera positions.

The resulting plane quality can be improved by using more than two frames.
Two possible plane solutions will be provided.
NOTE This class is almost obsolete we keep it for demonstration purpose only.

Member Typedef Documentation

◆ NormalPair

Definition of a pair storing two corresponding normals.

◆ NormalPairs

Definition of a vector holding pairs of normals.

Constructor & Destructor Documentation

◆ HomographyPlaneFinder()

Ocean::Tracking::HomographyPlaneFinder::HomographyPlaneFinder ( )
inline

Creates a new plane finder object.

Member Function Documentation

◆ addImagePoint() [1/3]

virtual bool Ocean::Tracking::HomographyPlaneFinder::addImagePoint ( const Vectors2 imagePoints)
virtual

Adds new image points as new set of correspondences.

After new points have added the homography determination needs to be invoked.

See also
PlaneFinder::addImagePoint(), applyHomographyDetermination().

Reimplemented from Ocean::Tracking::PlaneFinder.

◆ addImagePoint() [2/3]

virtual bool Ocean::Tracking::HomographyPlaneFinder::addImagePoint ( const Vectors2 imagePoints,
const Indices32 validIndices 
)
virtual

Adds a new subset of image points that corresponds to a subset of the stored sets of image points.

After new points have added the homography determination needs to be invoked.

See also
PlaneFinder::addImagePoint(), applyHomographyDetermination().

Reimplemented from Ocean::Tracking::PlaneFinder.

◆ addImagePoint() [3/3]

virtual bool Ocean::Tracking::HomographyPlaneFinder::addImagePoint ( Vectors2 &&  imagePoints)
virtual

Adds new image points as new set of correspondences.

After new points have added the homography determination needs to be invoked.

See also
PlaneFinder::addImagePoint(), applyHomographyDetermination().

Reimplemented from Ocean::Tracking::PlaneFinder.

◆ addPlaneCandidates()

bool Ocean::Tracking::HomographyPlaneFinder::addPlaneCandidates ( const PinholeCamera pinhole)

Determines a new set of plane candidates matching with the currently stored image point correspondences.

The new candidates will be added to the large set of possible plane candidates finally allowing to determine the most reliable/accurate plane(s).

Parameters
pinholeThe pinhole camera profile defining the projection, must be valid
Returns
True, if succeeded
See also
determineMostAccuratePlanes().

◆ currentImagePoints()

const Vectors2 & Ocean::Tracking::HomographyPlaneFinder::currentImagePoints ( ) const
inline

Returns the current point set that is stored.

Returns
current set of points

◆ determineBestNormalPair()

static bool Ocean::Tracking::HomographyPlaneFinder::determineBestNormalPair ( const NormalPairs normalPairs,
size_t &  index,
Scalar angle 
)
staticprotected

Determines the pair of normals with smallest angle.

Parameters
normalPairsThe pairs of normals, at least 3
indexThe resulting index of the best pairs, with range [0, normalPairs.size())
angleThe resulting angle between the best pairs of normals
Returns
True, if succeeded

◆ determineMostAccuratePlanes()

bool Ocean::Tracking::HomographyPlaneFinder::determineMostAccuratePlanes ( Plane3  planes[2])

Determines the pair of planes which have been determined in the previous calls of addPlaneCandidates().

Parameters
planesThe two resulting planes
Returns
True, if succeeded

◆ hasAccuratePlane()

bool Ocean::Tracking::HomographyPlaneFinder::hasAccuratePlane ( const Scalar  maxAngle)

Checks whether one of the last three successive frames provided almost identical plane normals.

Parameters
maxAngleThe maximal angle between two plane normals, in radian, with range [0, PI/2)

◆ initialImagePoints()

const Vectors2 & Ocean::Tracking::HomographyPlaneFinder::initialImagePoints ( ) const
inline

Returns the first point set that is stored.

Returns
First set of points

◆ maximalCosBetweenNormalPairs()

static Scalar Ocean::Tracking::HomographyPlaneFinder::maximalCosBetweenNormalPairs ( const NormalPair minus,
const NormalPair center,
const NormalPair plus 
)
staticprotected

Determines the maximal cosine value between three pairs of plane normals.

Parameters
minusThe previous pairs of plane normals
centerThe current pairs of plane normals
plusThe next pairs of plane normals
Returns
The maximal cosine value, with range [-1, 1]

Field Documentation

◆ planeFinderNormalPairs

NormalPairs Ocean::Tracking::HomographyPlaneFinder::planeFinderNormalPairs
protected

Successive plane normal sets.

◆ planeImagePointsSets

size_t Ocean::Tracking::HomographyPlaneFinder::planeImagePointsSets
protected

Number of image points sets that have been added.

◆ randomGenerator

RandomGenerator Ocean::Tracking::HomographyPlaneFinder::randomGenerator
protected

Random number generator.


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