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 /// for Linear Triangulation
Matrix34 getCameraProjectionMatrix() const { Matrix34 cameraProjectionMatrix() const {
Matrix34 P = Matrix34(PinholeBase::pose().inverse().matrix().block(0, 0, 3, 4)); return K_.K() * PinholeBase::pose().inverse().matrix().block(0, 0, 3, 4);
return K_.K() * P;
} }
/// for Nonlinear Triangulation /// for Nonlinear Triangulation

View File

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

View File

@ -30,6 +30,13 @@
namespace gtsam { 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 { class GTSAM_EXPORT EmptyCal {
public: public:
enum { dimension = 0 }; 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 * @addtogroup geometry
* \nosubgrouping * \nosubgrouping
*/ */
@ -183,7 +191,7 @@ class GTSAM_EXPORT SphericalCamera {
} }
/// for Linear Triangulation /// for Linear Triangulation
Matrix34 getCameraProjectionMatrix() const { Matrix34 cameraProjectionMatrix() const {
return Matrix34(pose_.inverse().matrix().block(0, 0, 3, 4)); 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) { projectionMatricesFromCameras(const CameraSet<CAMERA> &cameras) {
std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices; std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices;
for (const CAMERA &camera: cameras) { for (const CAMERA &camera: cameras) {
projection_matrices.push_back(camera.getCameraProjectionMatrix()); projection_matrices.push_back(camera.cameraProjectionMatrix());
} }
return projection_matrices; return projection_matrices;
} }
@ -218,7 +218,7 @@ std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projectionMatricesFrom
std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices; std::vector<Matrix34, Eigen::aligned_allocator<Matrix34>> projection_matrices;
for (size_t i = 0; i < poses.size(); i++) { for (size_t i = 0; i < poses.size(); i++) {
PinholePose<CALIBRATION> camera(poses.at(i), sharedCal); PinholePose<CALIBRATION> camera(poses.at(i), sharedCal);
projection_matrices.push_back(camera.getCameraProjectionMatrix()); projection_matrices.push_back(camera.cameraProjectionMatrix());
} }
return projection_matrices; return projection_matrices;
} }