Ocean
|
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...
Public Types | |
typedef std::pair< Vector3, Vector3 > | NormalPair |
Definition of a pair storing two corresponding normals. More... | |
Public Member Functions | |
HomographyPlaneFinder () | |
Creates a new plane finder object. More... | |
const Vectors2 & | initialImagePoints () const |
Returns the first point set that is stored. More... | |
const Vectors2 & | currentImagePoints () 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 Vectors2 & | firstImagePoints () const |
Returns the first set of image points. More... | |
const Vectors2 & | lastImagePoints () 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< NormalPair > | NormalPairs |
Definition of a vector holding pairs of normals. More... | |
Protected Types inherited from Ocean::Tracking::PlaneFinder | |
typedef CorrespondenceSet< Vector2 > | ImagePointCorrespondenceSet |
Definition of a correspondence set object with handling 2D vectors. More... | |
Static Protected Member Functions | |
static Scalar | maximalCosBetweenNormalPairs (const NormalPair &minus, const NormalPair ¢er, 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... | |
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.
typedef std::pair<Vector3, Vector3> Ocean::Tracking::HomographyPlaneFinder::NormalPair |
Definition of a pair storing two corresponding normals.
|
protected |
Definition of a vector holding pairs of normals.
|
inline |
Creates a new plane finder object.
|
virtual |
Adds new image points as new set of correspondences.
After new points have added the homography determination needs to be invoked.
Reimplemented from Ocean::Tracking::PlaneFinder.
|
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.
Reimplemented from Ocean::Tracking::PlaneFinder.
|
virtual |
Adds new image points as new set of correspondences.
After new points have added the homography determination needs to be invoked.
Reimplemented from Ocean::Tracking::PlaneFinder.
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).
pinhole | The pinhole camera profile defining the projection, must be valid |
|
inline |
Returns the current point set that is stored.
|
staticprotected |
Determines the pair of normals with smallest angle.
normalPairs | The pairs of normals, at least 3 |
index | The resulting index of the best pairs, with range [0, normalPairs.size()) |
angle | The resulting angle between the best pairs of normals |
bool Ocean::Tracking::HomographyPlaneFinder::determineMostAccuratePlanes | ( | Plane3 | planes[2] | ) |
Determines the pair of planes which have been determined in the previous calls of addPlaneCandidates().
planes | The two resulting planes |
bool Ocean::Tracking::HomographyPlaneFinder::hasAccuratePlane | ( | const Scalar | maxAngle | ) |
Checks whether one of the last three successive frames provided almost identical plane normals.
maxAngle | The maximal angle between two plane normals, in radian, with range [0, PI/2) |
|
inline |
Returns the first point set that is stored.
|
staticprotected |
Determines the maximal cosine value between three pairs of plane normals.
minus | The previous pairs of plane normals |
center | The current pairs of plane normals |
plus | The next pairs of plane normals |
|
protected |
Successive plane normal sets.
|
protected |
Number of image points sets that have been added.
|
protected |
Random number generator.