CoplanarPosit Class |
Namespace: Accord.Math.Geometry
The CoplanarPosit type exposes the following members.
Name | Description | |
---|---|---|
CoplanarPosit |
Initializes a new instance of the Posit class.
|
Name | Description | |
---|---|---|
AlternateEstimatedRotation |
Alternate estimated pose recently found.
| |
AlternateEstimatedTranslation |
Alternated estimated translation recently found.
| |
AlternateEstimationError |
Error of the alternate pose estimation.
| |
BestEstimatedRotation |
Best estimated pose recently found.
| |
BestEstimatedTranslation |
Best estimated translation recently found.
| |
BestEstimationError |
Error of the best pose estimation.
| |
FocalLength |
Effective focal length of the camera used to capture the model.
| |
Model |
Coordinates of the model points which pose should be estimated.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
EstimatePose |
Estimate pose of a model from it's projected 2D coordinates.
| |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(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.) | |
ToT | 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.) |
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 |
---|
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 |
---|
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 );