addressed final comments

release/4.3a0
lcarlone 2021-12-04 19:21:25 -05:00
parent 260312af38
commit 653dbbb935
4 changed files with 15 additions and 8 deletions

View File

@ -313,9 +313,8 @@ public:
}
/// for Linear Triangulation
Matrix34 getCameraProjectionMatrix() const {
Matrix34 P = Matrix34(PinholeBase::pose().inverse().matrix().block(0, 0, 3, 4));
return K_.K() * P;
Matrix34 cameraProjectionMatrix() const {
return K_.K() * PinholeBase::pose().inverse().matrix().block(0, 0, 3, 4);
}
/// for Nonlinear Triangulation

View File

@ -417,7 +417,7 @@ public:
}
/// for Linear Triangulation
Matrix34 getCameraProjectionMatrix() const {
Matrix34 cameraProjectionMatrix() const {
Matrix34 P = Matrix34(PinholeBase::pose().inverse().matrix().block(0, 0, 3, 4));
return K_->K() * P;
}

View File

@ -30,6 +30,13 @@
namespace gtsam {
/**
* Empty calibration. Only needed to play well with other cameras
* (e.g., when templating functions wrt cameras), since other cameras
* have constuctors in the form camera(pose,calibration)
* @addtogroup geometry
* \nosubgrouping
*/
class GTSAM_EXPORT EmptyCal {
public:
enum { dimension = 0 };
@ -42,7 +49,8 @@ class GTSAM_EXPORT EmptyCal {
};
/**
* A spherical camera class that has a Pose3 and measures bearing vectors
* A spherical camera class that has a Pose3 and measures bearing vectors.
* The camera has an Empty calibration and the only 6 dof are the pose
* @addtogroup geometry
* \nosubgrouping
*/
@ -183,7 +191,7 @@ class GTSAM_EXPORT SphericalCamera {
}
/// for Linear Triangulation
Matrix34 getCameraProjectionMatrix() const {
Matrix34 cameraProjectionMatrix() const {
return Matrix34(pose_.inverse().matrix().block(0, 0, 3, 4));
}

View File

@ -206,7 +206,7 @@ std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>>
projectionMatricesFromCameras(const CameraSet<CAMERA> &cameras) {
std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices;
for (const CAMERA &camera: cameras) {
projection_matrices.push_back(camera.getCameraProjectionMatrix());
projection_matrices.push_back(camera.cameraProjectionMatrix());
}
return projection_matrices;
}
@ -218,7 +218,7 @@ std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projectionMatricesFrom
std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices;
for (size_t i = 0; i < poses.size(); i++) {
PinholePose<CALIBRATION> camera(poses.at(i), sharedCal);
projection_matrices.push_back(camera.getCameraProjectionMatrix());
projection_matrices.push_back(camera.cameraProjectionMatrix());
}
return projection_matrices;
}