24 using namespace gtsam;
44 Base(model, key), K_(calib), P_(P), p_(p) {
62 int main(
int argc,
char* argv[]) {
72 std::shared_ptr<ResectioningFactor> factor;
85 Pose3(
Rot3(1, 0, 0, 0, -1, 0, 0, 0, -1),
Point3(0, 0, 2)));
89 result.
print(
"Final result:\n");
const gtsam::Symbol key('X', 0)
int main(int argc, char *argv[])
virtual const Values & optimize()
Cal3_S2::shared_ptr K_
camera's intrinsic parameters
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
noiseModel::Diagonal::shared_ptr model
Point2 p_
2D measurement of the 3D point
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Vector evaluateError(const Pose3 &pose, OptionalMatrixType H) const override
evaluate the error
NonlinearFactorGraph graph
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Base class for all pinhole cameras.
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
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
Matrix * OptionalMatrixType
std::shared_ptr< Cal3_S2 > shared_ptr
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
The most common 5DOF 3D->2D calibration.
noiseModel::Diagonal::shared_ptr SharedDiagonal
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
ResectioningFactor(const SharedNoiseModel &model, const Key &key, const Cal3_S2::shared_ptr &calib, const Point2 &p, const Point3 &P)
Construct factor given known point P and its projection p.
static shared_ptr Sigmas(const Vector &sigmas, bool smart=true)
Point3 P_
3D point on the calibration rig
NoiseModelFactorN< Pose3 > Base
void insert(Key j, const Value &val)
static const CalibratedCamera camera(kDefaultPose)
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel
The most common 5DOF 3D->2D calibration.
All noise models live in the noiseModel namespace.