28 using namespace gtsam;
30 int main(
int argc,
char* argv[]) {
60 bool separateCalibration =
true;
61 return optimize(db, graph, initial, separateCalibration);
static Point2 project(const Pose3 &pose, const Unit3 &pointAtInfinity, const Cal3_S2::shared_ptr &cal)
const Pose3 & pose() const
return pose
static SharedNoiseModel gNoiseModel
Define the structure for SfM data.
void insert(Key j, const Value &val)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
const Calibration & calibration() const override
return calibration
NonlinearFactorGraph graph
std::vector< SfmTrack > tracks
Sparse set of points.
Common code for timeSFMBAL scripts.
std::pair< size_t, Point2 > SfmMeasurement
A measurement with its camera index.
size_t number_tracks() const
The number of reconstructed 3D points.
Point3_ transformFrom(const Pose3_ &x, const Point3_ &p)
Pose3 inverse() const
inverse transformation with derivatives
Define the structure for the 3D points.
void addExpressionFactor(const SharedNoiseModel &R, const T &z, const Expression< T > &h)
Matrix< Scalar, Dynamic, Dynamic > C
std::vector< SfmCamera > cameras
Set of cameras.
SfmData preamble(int argc, char *argv[])
Point3 p
3D position of the point
int optimize(const SfmData &db, const NonlinearFactorGraph &graph, const Values &initial, bool separateCalibration=false)
int main(int argc, char *argv[])
static const CalibratedCamera camera(kDefaultPose)
Calibration used by Bundler.
Point2 uncalibrate(const CAL &K, const Point2 &p, OptionalJacobian< 2, 5 > Dcal, OptionalJacobian< 2, 2 > Dp)