addressed final comments
parent
260312af38
commit
653dbbb935
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue