![]() |
My Project
|
Trifocal tensor works for three images like a fundamental matrix works for two images. More...
#include <TrifocalTensor.h>
Public Member Functions | |
TrifocalTensor (const Pose &P1, const Pose &P2) | |
Constructs a tensor from identity pose and two other known poses. See computeTensor. More... | |
TrifocalTensor (const Pose &P0, const Pose &P1, const Pose &P2) | |
Constructs a tensor from three known poses. See computeTensor. More... | |
void | computeTensor (const Pose &P1, const Pose &P2) |
Initializes the tensor from identity pose and two other known poses. More... | |
void | computeTensor (const Pose &P0, const Pose &P1, const Pose &P2) |
Initializes the tensor from three known poses. More... | |
void | project (const cv::Point2d &p0, const cv::Point2d &p1, cv::Point2d &p2) |
Computes the projection of a point in the third pose. More... | |
double | projectError (const cv::Point2d &p0, const cv::Point2d &p1, const cv::Point2d &p2) |
Computes how much three points differ from the tensor. More... | |
Trifocal tensor works for three images like a fundamental matrix works for two images.
Given three camera poses P0, P1, P2 and a 3D point X, we can calculate a trifocal tensor T(P0, P1, P2). The tensor relates projections of X in P0, P1 and P2 in such a way that when any two projections are known the third projection can be calculated.
This implementation of trifocal tensor assumes that the camera poses P0, P1 and P2 are known. When projections of X in P0 and P1 are known the projection in P2 can be computed using the tensor.
The current implementation cannot be used to directly compute the tensor from point correspondencies alone. The implementation can be used for example for optimizing three camera poses when point correspondences are known in the three images by minimizing the trifocal 'projection error' computed by projectError -method.
Definition at line 71 of file TrifocalTensor.h.
TrifocalTensor | ( | const Pose & | P1, |
const Pose & | P2 | ||
) |
Constructs a tensor from identity pose and two other known poses. See computeTensor.
P1 | The second pose relative to the first pose. |
P2 | The third pose relative to the first pose. |
TrifocalTensor | ( | const Pose & | P0, |
const Pose & | P1, | ||
const Pose & | P2 | ||
) |
Constructs a tensor from three known poses. See computeTensor.
P0 | The first camera pose. |
P1 | The second pose relative to the first pose. |
P2 | The third pose relative to the first pose. |
Initializes the tensor from three known poses.
P0 | The first camera pose. |
P1 | The second pose relative to the first pose. |
P2 | The third pose relative to the first pose. |
Initializes the tensor from identity pose and two other known poses.
The first pose is identity and the two other poses are relative translations/rotation between the first and the second pose and between the first and the third pose.
P1 | The second pose relative to the first pose. |
P2 | The third pose relative to the first pose. |
void project | ( | const cv::Point2d & | p0, |
const cv::Point2d & | p1, | ||
cv::Point2d & | p2 | ||
) |
Computes the projection of a point in the third pose.
When we have three images, each a projection of a scene from the three different camera poses (identity and the two poses that were used to initialize the tensor) and a 2D point correspondence between the first and the second images, a position in the third image is computed.
p0 | 2D position in a image projected from the first pose. |
p1 | 2D position in a image projected from the second pose. |
p2 | Computed 2D position in a image projected form the third pose. |
double projectError | ( | const cv::Point2d & | p0, |
const cv::Point2d & | p1, | ||
const cv::Point2d & | p2 | ||
) |
Computes how much three points differ from the tensor.
When we have three images, each a projection of a scene from the three different camera poses (identity and the two poses that were used to initialize the tensor) and a 2D point correspondence between the first the second and the third images, we compute how well the three projections match with the trifocal tensor.
When the third point lies exactly where the tensor projects the first two points, the returned error is zero.
p0 | 2D position in a image projected from the first pose. |
p1 | 2D position in a image projected from the second pose. |
p2 | 2D position in a image projected form the third pose. |