This class provides functions determining the camera's pose based on at least five 3D object and corresponding 2D image points.
More...
|
static bool | pose (const AnyCamera &camera, const Vector3 *objectPoints, const Vector2 *imagePoints, const size_t correspondences, HomogenousMatrix4 &world_T_camera) |
| Calculates the pose of a camera by a set of at least five image and object points. More...
|
|
|
static bool | calculatePointDistances (const Vector3 *objectPoints, const Vector3 *imageRays, const size_t correspondences, Scalars &distances) |
| Calculates distances between camera center and at least five 3D object points. More...
|
|
static bool | calculateResultant (const Scalar cos12, const Scalar cos13, const Scalar cos23, const Scalar d12_2, const Scalar d13_2, const Scalar d23_2, Scalar &a0, Scalar &a1, Scalar &a2, Scalar &a3, Scalar &a4) |
| Calculates the eighth degree polynomial resulting from three law of cosine polynomials. More...
|
|
static bool | calculateResultantOptimized (const Scalar cos12, const Scalar cos13, const Scalar cos23, const Scalar d12_2, const Scalar d13_2, const Scalar d23_2, Scalar &a0, Scalar &a1, Scalar &a2, Scalar &a3, Scalar &a4) |
| Calculates the eighth degree polynomial resulting from three law of cosine polynomials. More...
|
|
template<typename T > |
static bool | calculateCosineSolutions (const T x1, const T x1_2, const T cos12, const T d12_2, T &x2a, T &x2b) |
| Calculates the two possible solutions for the law of cosines. More...
|
|
template<typename T > |
static T | calculateCosineResults (const T x1, const T x1_2, const T x2, const T x2_2, const T cos12, const T d12_2) |
| Returns the result of the law of cosines. More...
|
|
This class provides functions determining the camera's pose based on at least five 3D object and corresponding 2D image points.
◆ calculatePointDistances()
static bool Ocean::Geometry::PnP::calculatePointDistances |
( |
const Vector3 * |
objectPoints, |
|
|
const Vector3 * |
imageRays, |
|
|
const size_t |
correspondences, |
|
|
Scalars & |
distances |
|
) |
| |
|
staticprotected |
Calculates distances between camera center and at least five 3D object points.
- Parameters
-
objectPoints | The object points for which the distances will be determined, must be valid |
imageRays | Three 3D rays with unit length, defined in the coordinate system of the camera, starting at the camera's center of projection (equal to the origin), hitting the image plane at image points corresponding to the 3D object points and pointing towards the object points, each ray corresponds to one 3D object point, must be valid |
correspondences | Number of point correspondences, with range [5, infinity) |
distances | Resulting distances between camera center and each of the object points |
- Returns
- True, if succeeded
◆ calculateResultant()
static bool Ocean::Geometry::PnP::calculateResultant |
( |
const Scalar |
cos12, |
|
|
const Scalar |
cos13, |
|
|
const Scalar |
cos23, |
|
|
const Scalar |
d12_2, |
|
|
const Scalar |
d13_2, |
|
|
const Scalar |
d23_2, |
|
|
Scalar & |
a0, |
|
|
Scalar & |
a1, |
|
|
Scalar & |
a2, |
|
|
Scalar & |
a3, |
|
|
Scalar & |
a4 |
|
) |
| |
|
staticprotected |
Calculates the eighth degree polynomial resulting from three law of cosine polynomials.
It uses the method of Sylvester resultants.
g(x) = a4 x^8 + a3 x^6 + a2 x^4 + a1 x1^2 + a0 = 0
- Parameters
-
cos12 | Cosine value of angle between first and second leg |
cos13 | Cosine value of angle between first and third leg |
cos23 | Cosine value of angle between second and third leg |
d12_2 | Square of distance between first and second object point |
d13_2 | Square of distance between first and third object point |
d23_2 | Square of distance between second and third object point |
a0 | Resulting parameter for x1^0 |
a1 | Resulting parameter for x1^2 |
a2 | Resulting parameter for x1^4 |
a3 | Resulting parameter for x1^6 |
a4 | Resulting parameter for x1^8 |
- Returns
- True, if succeeded
◆ calculateResultantOptimized()
static bool Ocean::Geometry::PnP::calculateResultantOptimized |
( |
const Scalar |
cos12, |
|
|
const Scalar |
cos13, |
|
|
const Scalar |
cos23, |
|
|
const Scalar |
d12_2, |
|
|
const Scalar |
d13_2, |
|
|
const Scalar |
d23_2, |
|
|
Scalar & |
a0, |
|
|
Scalar & |
a1, |
|
|
Scalar & |
a2, |
|
|
Scalar & |
a3, |
|
|
Scalar & |
a4 |
|
) |
| |
|
staticprotected |
Calculates the eighth degree polynomial resulting from three law of cosine polynomials.
It uses the method of Sylvester resultants.
It's optimized to performance.
g(x) = a4 x^8 + a3 x^6 + a2 x^4 + a1 x1^2 + a0 = 0
- Parameters
-
cos12 | Cosine value of angle between first and second leg |
cos13 | Cosine value of angle between first and third leg |
cos23 | Cosine value of angle between second and third leg |
d12_2 | Square of distance between first and second object point |
d13_2 | Square of distance between first and third object point |
d23_2 | Square of distance between second and third object point |
a0 | Resulting parameter for x1^0 |
a1 | Resulting parameter for x1^2 |
a2 | Resulting parameter for x1^4 |
a3 | Resulting parameter for x1^6 |
a4 | Resulting parameter for x1^8 |
- Returns
- True, if succeeded
◆ pose()
Calculates the pose of a camera by a set of at least five image and object points.
- Parameters
-
camera | The camera profile defining the projection, must be valid |
objectPoints | The 3D object points for which the camera pose will be determined, defined in world, must be valid |
imagePoints | The 2D image points located in the camera image, one for each 3D object point, must be valid |
correspondences | Number of point correspondences, with range [5, infinity) |
world_T_camera | Resulting camera pose, with default camera pointing towards the negative z-space, with y-axis upwards |
- Returns
- True, if succeeded
The documentation for this class was generated from the following file: