27 using namespace gtsam;
46 static double fov = 60;
47 static size_t w = 640,
h = 480;
60 Camera
cam1(level_pose,
K2);
61 Camera
cam2(pose_right,
K2);
62 Camera
cam3(pose_above,
K2);
104 Camera
cam1(level_pose,
K);
105 Camera
cam2(pose_right,
K);
106 Camera
cam3(pose_above,
K);
124 template<
class CAMERA>
128 Pose3 cameraPose = camera.pose();
129 Pose3 perturbedCameraPose = cameraPose.
compose(noise_pose);
130 return CAMERA(perturbedCameraPose, camera.calibration());
133 template<
class CAMERA>
135 const CAMERA&
cam3,
Point3 landmark,
typename CAMERA::MeasurementVector& measurements_cam) {
136 Point2 cam1_uv1 = cam1.project(landmark);
137 Point2 cam2_uv1 = cam2.project(landmark);
138 Point2 cam3_uv1 = cam3.project(landmark);
139 measurements_cam.push_back(cam1_uv1);
140 measurements_cam.push_back(cam2_uv1);
141 measurements_cam.push_back(cam3_uv1);
Smart factor on poses, assuming camera calibration is fixed.
static PinholeCamera< Cal3_S2 > cam1(pose3, cal1)
static Cal3_S2 K2(1500, 1200, 0, w, h)
static StereoCamera cam2(pose3, cal4ptr)
Point3 landmark5(10,-0.5, 1.2)
CAMERA perturbCameraPose(const CAMERA &camera)
Camera cam3(pose_above, sharedBundlerK)
Point3 landmark3(3, 0, 3.0)
Point3 landmark4(10, 0.5, 1.2)
SmartProjectionPoseFactor< Cal3Bundler > SmartFactor
static Point3 landmark(0, 0, 5)
static boost::shared_ptr< Cal3Bundler > sharedBundlerK(new Cal3Bundler(500, 1e-3, 1e-3, 1000, 2000))
static Cal3Bundler K(500, 1e-3, 1e-3, 0, 0)
Smart factor on cameras (pose + calibration)
Class compose(const Class &g) const
PinholePose< Cal3Bundler > Camera
Point3 landmark1(5, 0.5, 1.2)
GeneralSFMFactor< Camera, Point3 > SFMFactor
Camera level_camera(level_pose, sharedBundlerK)
void projectToMultipleCameras(const CAMERA &cam1, const CAMERA &cam2, const CAMERA &cam3, Point3 landmark, typename CAMERA::MeasurementVector &measurements_cam)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static Cal3_S2::shared_ptr sharedK(new Cal3_S2(fov, w, h))
static SmartStereoProjectionParams params
static SharedNoiseModel unit2(noiseModel::Unit::Create(2))
Point2 project(const Point3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none, OptionalJacobian< 2, DimK > Dcal=boost::none) const
project a 3D point from world coordinates into the image
static Cal3_S2::shared_ptr sharedK2(new Cal3_S2(1500, 1200, 0, 640, 480))
static const CalibratedCamera camera(kDefaultPose)
a general SFM factor with an unknown calibration
boost::shared_ptr< Cal3_S2 > shared_ptr
Calibration used by Bundler.
Camera level_camera_right(pose_right, sharedBundlerK)
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
Point3 landmark2(5,-0.5, 1.2)