Click or drag to resize
Accord.NET (logo)

CoplanarPosit Class

3D pose estimation algorithm (coplanar case).
Inheritance Hierarchy
SystemObject
  Accord.Math.GeometryCoplanarPosit

Namespace:  Accord.Math.Geometry
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public class CoplanarPosit
Request Example View Source

The CoplanarPosit type exposes the following members.

Constructors
  NameDescription
Public methodCoplanarPosit
Initializes a new instance of the Posit class.
Top
Properties
  NameDescription
Public propertyAlternateEstimatedRotation
Alternate estimated pose recently found.
Public propertyAlternateEstimatedTranslation
Alternated estimated translation recently found.
Public propertyAlternateEstimationError
Error of the alternate pose estimation.
Public propertyBestEstimatedRotation
Best estimated pose recently found.
Public propertyBestEstimatedTranslation
Best estimated translation recently found.
Public propertyBestEstimationError
Error of the best pose estimation.
Public propertyFocalLength
Effective focal length of the camera used to capture the model.
Public propertyModel
Coordinates of the model points which pose should be estimated.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEstimatePose
Estimate pose of a model from it's projected 2D coordinates.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks

The class implements an algorithm for 3D object's pose estimation from it's 2D coordinates obtained by perspective projection, when the object is described coplanar points. The idea of the implemented math and algorithm is described in "Iterative Pose Estimation using Coplanar Feature Points" paper written by Oberkampf, Daniel DeMenthon and Larry Davis (the implementation of the algorithm is very close translation of the pseudo code given by the paper, so should be easy to follow).

Note Note
At this point the implementation works only with models described by 4 points, which is the minimum number of points enough for 3D pose estimation.

Note Note
The 4 model's point are supposed to be coplanar, i.e. supposed to reside all within same planer. See Posit for none coplanar case.

Read 3D Pose Estimation article for additional information and samples.

Sample usage:

// points of real object - model
Vector3[] copositObject = new Vector3[4]
{ 
    new Vector3( -56.5f, 0,  56.5f ),
    new Vector3(  56.5f, 0,  56.5f ),
    new Vector3(  56.5f, 0, -56.5f ),
    new Vector3( -56.5f, 0, -56.5f ),
};

// focal length of camera used to capture the object
float focalLength = 640; // depends on your camera or projection system

// initialize CoPOSIT object
CoplanarPosit coposit = new CoplanarPosit( copositObject, focalLength );

// 2D points of te object - projection
Accord.Point[] projectedPoints = new Accord.Point[4]
{
    new Accord.Point( -77,  48 ),
    new Accord.Point(  44,  66 ),
    new Accord.Point(  75, -36 ),
    new Accord.Point( -61, -58 ),
};

// estimate pose
Matrix3x3 rotationMatrix;
Vector3 translationVector;
coposit.EstimatePose( projectedPoints,
    out rotationMatrix, out translationVector );
See Also