28 using namespace gtsam;
30 #define time timeSingleThreaded 37 return camera.
project(point, H1, H2, {});
62 NonlinearFactor::shared_ptr
f1 =
63 std::make_shared<GeneralSFMFactor2<Cal3_S2> >(
z,
model, 1, 2, 3);
64 time(
"GeneralSFMFactor2<Cal3_S2> : ", f1, values);
69 NonlinearFactor::shared_ptr
f2 =
70 std::make_shared<ExpressionFactor<Point2> >(
model,
z,
72 time(
"Bin(Leaf,Un(Bin(Leaf,Leaf))): ", f2, values);
77 NonlinearFactor::shared_ptr
f3 =
78 std::make_shared<ExpressionFactor<Point2> >(
model,
z,
80 time(
"Ternary(Leaf,Leaf,Leaf) : ", f3, values);
89 time(
"GenericProjectionFactor<P,P>: ", g1, values);
94 NonlinearFactor::shared_ptr
g2 =
95 std::make_shared<ExpressionFactor<Point2> >(
model,
z,
97 time(
"Bin(Cnst,Un(Bin(Leaf,Leaf))): ", g2, values);
102 NonlinearFactor::shared_ptr g3 =
103 std::make_shared<ExpressionFactor<Point2> >(
model,
z,
105 time(
"Binary(Leaf,Leaf) : ", g3, values);
static Point2 project(const Pose3 &pose, const Unit3 &pointAtInfinity, const Cal3_S2::shared_ptr &cal)
noiseModel::Diagonal::shared_ptr model
Point2 myProject(const Pose3 &pose, const Point3 &point, OptionalJacobian< 2, 6 > H1, OptionalJacobian< 2, 3 > H2)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Expression< Point2 > Point2_
double f2(const Vector2 &x)
Point2 project(const Point3 &pw, OptionalJacobian< 2, 6 > Dpose={}, OptionalJacobian< 2, 3 > Dpoint={}, OptionalJacobian< 2, DimK > Dcal={}) const
project a 3D point from world coordinates into the image
gtsam::enable_if_t< needs_eigen_aligned_allocator< T >::value, std::shared_ptr< T > > make_shared(Args &&... args)
The most common 5DOF 3D->2D calibration.
Reprojection of a LANDMARK to a 2D point.
std::shared_ptr< Cal3_S2 > fixedK(new Cal3_S2())
Expression< Cal3_S2 > Cal3_S2_
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
Point2 f1(const Point3 &p, OptionalJacobian< 2, 3 > H)
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
double f3(double x1, double x2)
void insert(Key j, const Value &val)
Line3 transformTo(const Pose3 &wTc, const Line3 &wL, OptionalJacobian< 4, 6 > Dpose, OptionalJacobian< 4, 4 > Dline)
static const CalibratedCamera camera(kDefaultPose)
a general SFM factor with an unknown calibration
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Pose3 g2(g1.expmap(h *V1_g1))
static Point2 project3(const Pose3 &pose, const Point3 &point, const Cal3_S2 &cal)
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
Point2 uncalibrate(const CAL &K, const Point2 &p, OptionalJacobian< 2, 5 > Dcal, OptionalJacobian< 2, 2 > Dp)