Go to the documentation of this file.
36 using namespace gtsam;
39 int main(
int argc,
char* argv[]) {
54 std::array<std::array<Point2, 8>, 4>
p;
55 for (
size_t i = 0;
i < 4; ++
i) {
57 for (
size_t j = 0;
j < 8; ++
j) {
72 for (
size_t a = 0;
a < 4; ++
a) {
73 size_t b = (
a + 1) % 4;
74 size_t c = (
a + 2) % 4;
77 std::vector<std::tuple<Point2, Point2, Point2>> tuples1, tuples2, tuples3;
80 for (
size_t j = 0;
j < 8; ++
j) {
81 tuples1.emplace_back(
p[
a][
j],
p[
b][
j],
p[
c][
j]);
82 tuples2.emplace_back(
p[
a][
j],
p[
c][
j],
p[
b][
j]);
83 tuples3.emplace_back(
p[
c][
j],
p[
b][
j],
p[
a][
j]);
97 return (std::string)edge;
105 delta << 1, 2, 3, 4, 5, 6, 7;
110 for (
size_t a = 0;
a < 4; ++
a) {
111 size_t b = (
a + 1) % 4;
112 size_t c = (
a + 2) % 4;
121 params.setlambdaInitial(1000.0);
122 params.setVerbosityLM(
"SUMMARY");
126 cout <<
"initial error = " <<
graph.
error(initialEstimate) << endl;
131 cout <<
"Ground Truth F1:\n" <<
F1.matrix() << endl;
132 cout <<
"Ground Truth F2:\n" << F2.matrix() << endl;
virtual const Values & optimize()
std::vector< Point3 > createPoints()
Create a set of ground-truth landmarks.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
The most common 5DOF 3D->2D calibration.
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
const KeyFormatter & formatter
static const SmartProjectionParams params
const Cal3_S2 cal(focalLength, focalLength, 0.0, principalPoint.x(), principalPoint.y())
double error(const Values &values) const
Base class for all pinhole cameras.
virtual Matrix3 K() const
return calibration matrix K
int main(int argc, char *argv[])
const gtsam::Symbol key('X', 0)
std::vector< Pose3 > posesOnCircle(int num_cameras=8, double R=30)
void printErrors(const Values &values, const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter, const std::function< bool(const Factor *, double, size_t)> &printCondition=[](const Factor *, double, size_t) {return true;}) const
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Factor Graph consisting of non-linear factors.
void insert(Key j, const Value &val)
The most common 5DOF 3D->2D calibration.
static const CalibratedCamera camera(kDefaultPose)
NonlinearFactorGraph graph
Represents a fundamental matrix in computer vision, which encodes the epipolar geometry between two v...
std::uint64_t Key
Integer nonlinear key type.
Simple example for the structure-from-motion problems.
A non-templated config holding any types of Manifold-group elements.
Point2 project(const Point3 &point, OptionalJacobian< 2, 6 > Dcamera={}, OptionalJacobian< 2, 3 > Dpoint={}) const
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:42