gtsam  4.0.0
gtsam
SmartProjectionFactor.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
20 #pragma once
21 
23 
25 #include <gtsam/inference/Symbol.h>
26 #include <gtsam/slam/dataset.h>
27 
28 #include <boost/optional.hpp>
29 #include <boost/make_shared.hpp>
30 #include <vector>
31 
32 namespace gtsam {
33 
36  HESSIAN, IMPLICIT_SCHUR, JACOBIAN_Q, JACOBIAN_SVD
37 };
38 
41  IGNORE_DEGENERACY, ZERO_ON_DEGENERACY, HANDLE_INFINITY
42 };
43 
44 /*
45  * Parameters for the smart projection factors
46  */
47 struct GTSAM_EXPORT SmartProjectionParams {
48 
51 
54  TriangulationParameters triangulation;
56 
62 
64  // Constructor
65  SmartProjectionParams(LinearizationMode linMode = HESSIAN,
66  DegeneracyMode degMode = IGNORE_DEGENERACY, bool throwCheirality = false,
67  bool verboseCheirality = false) :
68  linearizationMode(linMode), degeneracyMode(degMode), retriangulationThreshold(
69  1e-5), throwCheirality(throwCheirality), verboseCheirality(
70  verboseCheirality) {
71  }
72 
73  virtual ~SmartProjectionParams() {
74  }
75 
76  void print(const std::string& str) const {
77  std::cout << "linearizationMode: " << linearizationMode << "\n";
78  std::cout << " degeneracyMode: " << degeneracyMode << "\n";
79  std::cout << triangulation << std::endl;
80  }
81 
82  LinearizationMode getLinearizationMode() const {
83  return linearizationMode;
84  }
85  DegeneracyMode getDegeneracyMode() const {
86  return degeneracyMode;
87  }
88  TriangulationParameters getTriangulationParameters() const {
89  return triangulation;
90  }
91  bool getVerboseCheirality() const {
92  return verboseCheirality;
93  }
94  bool getThrowCheirality() const {
95  return throwCheirality;
96  }
97  void setLinearizationMode(LinearizationMode linMode) {
98  linearizationMode = linMode;
99  }
100  void setDegeneracyMode(DegeneracyMode degMode) {
101  degeneracyMode = degMode;
102  }
103  void setRankTolerance(double rankTol) {
104  triangulation.rankTolerance = rankTol;
105  }
106  void setEnableEPI(bool enableEPI) {
107  triangulation.enableEPI = enableEPI;
108  }
109  void setLandmarkDistanceThreshold(double landmarkDistanceThreshold) {
110  triangulation.landmarkDistanceThreshold = landmarkDistanceThreshold;
111  }
112  void setDynamicOutlierRejectionThreshold(double dynOutRejectionThreshold) {
113  triangulation.dynamicOutlierRejectionThreshold = dynOutRejectionThreshold;
114  }
115 
116 private:
117 
119  friend class boost::serialization::access;
120  template<class ARCHIVE>
121  void serialize(ARCHIVE & ar, const unsigned int version) {
122  ar & BOOST_SERIALIZATION_NVP(linearizationMode);
123  ar & BOOST_SERIALIZATION_NVP(degeneracyMode);
124  ar & BOOST_SERIALIZATION_NVP(triangulation);
125  ar & BOOST_SERIALIZATION_NVP(retriangulationThreshold);
126  ar & BOOST_SERIALIZATION_NVP(throwCheirality);
127  ar & BOOST_SERIALIZATION_NVP(verboseCheirality);
128  }
129 };
130 
140 template<class CAMERA>
141 class SmartProjectionFactor: public SmartFactorBase<CAMERA> {
142 
143 public:
144 
145 private:
149 
150 protected:
151 
154  SmartProjectionParams params_;
156 
160  mutable std::vector<Pose3> cameraPosesTriangulation_;
161 
163 public:
164 
166  typedef boost::shared_ptr<This> shared_ptr;
167 
170 
175 
181  SmartProjectionFactor(const SharedNoiseModel& sharedNoiseModel,
182  const boost::optional<Pose3> body_P_sensor = boost::none,
183  const SmartProjectionParams& params = SmartProjectionParams()) :
184  Base(sharedNoiseModel, body_P_sensor), params_(params), //
185  result_(TriangulationResult::Degenerate()) {
186  }
187 
190  }
191 
197  void print(const std::string& s = "", const KeyFormatter& keyFormatter =
198  DefaultKeyFormatter) const {
199  std::cout << s << "SmartProjectionFactor\n";
200  std::cout << "linearizationMode:\n" << params_.linearizationMode
201  << std::endl;
202  std::cout << "triangulationParameters:\n" << params_.triangulation
203  << std::endl;
204  std::cout << "result:\n" << result_ << std::endl;
205  Base::print("", keyFormatter);
206  }
207 
209  virtual bool equals(const NonlinearFactor& p, double tol = 1e-9) const {
210  const This *e = dynamic_cast<const This*>(&p);
211  return e && params_.linearizationMode == e->params_.linearizationMode
212  && Base::equals(p, tol);
213  }
214 
216  bool decideIfTriangulate(const Cameras& cameras) const {
217  // several calls to linearize will be done from the same linearization point, hence it is not needed to re-triangulate
218  // Note that this is not yet "selecting linearization", that will come later, and we only check if the
219  // current linearization is the "same" (up to tolerance) w.r.t. the last time we triangulated the point
220 
221  size_t m = cameras.size();
222 
223  bool retriangulate = false;
224 
225  // if we do not have a previous linearization point or the new linearization point includes more poses
226  if (cameraPosesTriangulation_.empty()
227  || cameras.size() != cameraPosesTriangulation_.size())
228  retriangulate = true;
229 
230  if (!retriangulate) {
231  for (size_t i = 0; i < cameras.size(); i++) {
232  if (!cameras[i].pose().equals(cameraPosesTriangulation_[i],
233  params_.retriangulationThreshold)) {
234  retriangulate = true; // at least two poses are different, hence we retriangulate
235  break;
236  }
237  }
238  }
239 
240  if (retriangulate) { // we store the current poses used for triangulation
241  cameraPosesTriangulation_.clear();
242  cameraPosesTriangulation_.reserve(m);
243  for (size_t i = 0; i < m; i++)
244  // cameraPosesTriangulation_[i] = cameras[i].pose();
245  cameraPosesTriangulation_.push_back(cameras[i].pose());
246  }
247 
248  return retriangulate; // if we arrive to this point all poses are the same and we don't need re-triangulation
249  }
250 
252  TriangulationResult triangulateSafe(const Cameras& cameras) const {
253 
254  size_t m = cameras.size();
255  if (m < 2) // if we have a single pose the corresponding factor is uninformative
256  return TriangulationResult::Degenerate();
257 
258  bool retriangulate = decideIfTriangulate(cameras);
259  if (retriangulate)
260  result_ = gtsam::triangulateSafe(cameras, this->measured_,
261  params_.triangulation);
262  return result_;
263  }
264 
266  bool triangulateForLinearize(const Cameras& cameras) const {
267  triangulateSafe(cameras); // imperative, might reset result_
268  return bool(result_);
269  }
270 
272  boost::shared_ptr<RegularHessianFactor<Base::Dim> > createHessianFactor(
273  const Cameras& cameras, const double lambda = 0.0, bool diagonalDamping =
274  false) const {
275 
276  size_t numKeys = this->keys_.size();
277  // Create structures for Hessian Factors
278  std::vector<Key> js;
279  std::vector<Matrix> Gs(numKeys * (numKeys + 1) / 2);
280  std::vector<Vector> gs(numKeys);
281 
282  if (this->measured_.size() != cameras.size()) {
283  std::cout
284  << "SmartProjectionHessianFactor: this->measured_.size() inconsistent with input"
285  << std::endl;
286  exit(1);
287  }
288 
289  triangulateSafe(cameras);
290 
291  if (params_.degeneracyMode == ZERO_ON_DEGENERACY && !result_) {
292  // failed: return"empty" Hessian
293  for(Matrix& m: Gs)
294  m = Matrix::Zero(Base::Dim, Base::Dim);
295  for(Vector& v: gs)
296  v = Vector::Zero(Base::Dim);
297  return boost::make_shared<RegularHessianFactor<Base::Dim> >(this->keys_,
298  Gs, gs, 0.0);
299  }
300 
301  // Jacobian could be 3D Point3 OR 2D Unit3, difference is E.cols().
302  std::vector<typename Base::MatrixZD> Fblocks;
303  Matrix E;
304  Vector b;
305  computeJacobiansWithTriangulatedPoint(Fblocks, E, b, cameras);
306 
307  // Whiten using noise model
308  Base::whitenJacobians(Fblocks, E, b);
309 
310  // build augmented hessian
311  SymmetricBlockMatrix augmentedHessian = //
312  Cameras::SchurComplement(Fblocks, E, b, lambda, diagonalDamping);
313 
314  return boost::make_shared<RegularHessianFactor<Base::Dim> >(this->keys_,
315  augmentedHessian);
316  }
317 
318  // create factor
319  boost::shared_ptr<RegularImplicitSchurFactor<CAMERA> > createRegularImplicitSchurFactor(
320  const Cameras& cameras, double lambda) const {
321  if (triangulateForLinearize(cameras))
322  return Base::createRegularImplicitSchurFactor(cameras, *result_, lambda);
323  else
324  // failed: return empty
325  return boost::shared_ptr<RegularImplicitSchurFactor<CAMERA> >();
326  }
327 
329  boost::shared_ptr<JacobianFactorQ<Base::Dim, 2> > createJacobianQFactor(
330  const Cameras& cameras, double lambda) const {
331  if (triangulateForLinearize(cameras))
332  return Base::createJacobianQFactor(cameras, *result_, lambda);
333  else
334  // failed: return empty
335  return boost::make_shared<JacobianFactorQ<Base::Dim, 2> >(this->keys_);
336  }
337 
339  boost::shared_ptr<JacobianFactorQ<Base::Dim, 2> > createJacobianQFactor(
340  const Values& values, double lambda) const {
341  return createJacobianQFactor(this->cameras(values), lambda);
342  }
343 
345  boost::shared_ptr<JacobianFactor> createJacobianSVDFactor(
346  const Cameras& cameras, double lambda) const {
347  if (triangulateForLinearize(cameras))
348  return Base::createJacobianSVDFactor(cameras, *result_, lambda);
349  else
350  // failed: return empty
351  return boost::make_shared<JacobianFactorSVD<Base::Dim, 2> >(this->keys_);
352  }
353 
355  virtual boost::shared_ptr<RegularHessianFactor<Base::Dim> > linearizeToHessian(
356  const Values& values, double lambda = 0.0) const {
357  return createHessianFactor(this->cameras(values), lambda);
358  }
359 
361  virtual boost::shared_ptr<RegularImplicitSchurFactor<CAMERA> > linearizeToImplicit(
362  const Values& values, double lambda = 0.0) const {
363  return createRegularImplicitSchurFactor(this->cameras(values), lambda);
364  }
365 
367  virtual boost::shared_ptr<JacobianFactorQ<Base::Dim, 2> > linearizeToJacobian(
368  const Values& values, double lambda = 0.0) const {
369  return createJacobianQFactor(this->cameras(values), lambda);
370  }
371 
377  boost::shared_ptr<GaussianFactor> linearizeDamped(const Cameras& cameras,
378  const double lambda = 0.0) const {
379  // depending on flag set on construction we may linearize to different linear factors
380  switch (params_.linearizationMode) {
381  case HESSIAN:
382  return createHessianFactor(cameras, lambda);
383  case IMPLICIT_SCHUR:
384  return createRegularImplicitSchurFactor(cameras, lambda);
385  case JACOBIAN_SVD:
386  return createJacobianSVDFactor(cameras, lambda);
387  case JACOBIAN_Q:
388  return createJacobianQFactor(cameras, lambda);
389  default:
390  throw std::runtime_error("SmartFactorlinearize: unknown mode");
391  }
392  }
393 
399  boost::shared_ptr<GaussianFactor> linearizeDamped(const Values& values,
400  const double lambda = 0.0) const {
401  // depending on flag set on construction we may linearize to different linear factors
402  Cameras cameras = this->cameras(values);
403  return linearizeDamped(cameras, lambda);
404  }
405 
407  virtual boost::shared_ptr<GaussianFactor> linearize(
408  const Values& values) const {
409  return linearizeDamped(values);
410  }
411 
416  bool triangulateAndComputeE(Matrix& E, const Cameras& cameras) const {
417  bool nonDegenerate = triangulateForLinearize(cameras);
418  if (nonDegenerate)
419  cameras.project2(*result_, boost::none, E);
420  return nonDegenerate;
421  }
422 
427  bool triangulateAndComputeE(Matrix& E, const Values& values) const {
428  Cameras cameras = this->cameras(values);
429  return triangulateAndComputeE(E, cameras);
430  }
431 
436  std::vector<typename Base::MatrixZD>& Fblocks, Matrix& E, Vector& b,
437  const Cameras& cameras) const {
438 
439  if (!result_) {
440  // Handle degeneracy
441  // TODO check flag whether we should do this
442  Unit3 backProjected = cameras[0].backprojectPointAtInfinity(
443  this->measured_.at(0));
444  Base::computeJacobians(Fblocks, E, b, cameras, backProjected);
445  } else {
446  // valid result: just return Base version
447  Base::computeJacobians(Fblocks, E, b, cameras, *result_);
448  }
449  }
450 
453  std::vector<typename Base::MatrixZD>& Fblocks, Matrix& E, Vector& b,
454  const Values& values) const {
455  Cameras cameras = this->cameras(values);
456  bool nonDegenerate = triangulateForLinearize(cameras);
457  if (nonDegenerate)
458  computeJacobiansWithTriangulatedPoint(Fblocks, E, b, cameras);
459  return nonDegenerate;
460  }
461 
464  std::vector<typename Base::MatrixZD>& Fblocks, Matrix& Enull, Vector& b,
465  const Values& values) const {
466  Cameras cameras = this->cameras(values);
467  bool nonDegenerate = triangulateForLinearize(cameras);
468  if (nonDegenerate)
469  Base::computeJacobiansSVD(Fblocks, Enull, b, cameras, *result_);
470  return nonDegenerate;
471  }
472 
474  Vector reprojectionErrorAfterTriangulation(const Values& values) const {
475  Cameras cameras = this->cameras(values);
476  bool nonDegenerate = triangulateForLinearize(cameras);
477  if (nonDegenerate)
478  return Base::unwhitenedError(cameras, *result_);
479  else
480  return Vector::Zero(cameras.size() * 2);
481  }
482 
489  double totalReprojectionError(const Cameras& cameras,
490  boost::optional<Point3> externalPoint = boost::none) const {
491 
492  if (externalPoint)
493  result_ = TriangulationResult(*externalPoint);
494  else
495  result_ = triangulateSafe(cameras);
496 
497  if (result_)
498  // All good, just use version in base class
499  return Base::totalReprojectionError(cameras, *result_);
500  else if (params_.degeneracyMode == HANDLE_INFINITY) {
501  // Otherwise, manage the exceptions with rotation-only factors
502  Unit3 backprojected = cameras.front().backprojectPointAtInfinity(
503  this->measured_.at(0));
504  return Base::totalReprojectionError(cameras, backprojected);
505  } else
506  // if we don't want to manage the exceptions we discard the factor
507  return 0.0;
508  }
509 
511  virtual double error(const Values& values) const {
512  if (this->active(values)) {
513  return totalReprojectionError(Base::cameras(values));
514  } else { // else of active flag
515  return 0.0;
516  }
517  }
518 
521  return result_;
522  }
523 
525  TriangulationResult point(const Values& values) const {
526  Cameras cameras = this->cameras(values);
527  return triangulateSafe(cameras);
528  }
529 
531  bool isValid() const {
532  return result_;
533  }
534 
536  bool isDegenerate() const {
537  return result_.degenerate();
538  }
539 
541  bool isPointBehindCamera() const {
542  return result_.behindCamera();
543  }
544 
545 private:
546 
548  friend class boost::serialization::access;
549  template<class ARCHIVE>
550  void serialize(ARCHIVE & ar, const unsigned int version) {
551  ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
552  ar & BOOST_SERIALIZATION_NVP(params_);
553  ar & BOOST_SERIALIZATION_NVP(result_);
554  ar & BOOST_SERIALIZATION_NVP(cameraPosesTriangulation_);
555  }
556 }
557 ;
558 
560 template<class CAMERA>
561 struct traits<SmartProjectionFactor<CAMERA> > : public Testable<
562  SmartProjectionFactor<CAMERA> > {
563 };
564 
565 } // \ namespace gtsam
double dynamicOutlierRejectionThreshold
If this is nonnegative the we will check if the average reprojection error is smaller than this thres...
Definition: triangulation.h:338
virtual bool equals(const NonlinearFactor &p, double tol=1e-9) const
equals
Definition: SmartProjectionFactor.h:209
TriangulationResult is an optional point, along with the reasons why it is invalid.
Definition: triangulation.h:384
TriangulationResult point(const Values &values) const
COMPUTE the landmark.
Definition: SmartProjectionFactor.h:525
bool triangulateForLinearize(const Cameras &cameras) const
triangulate
Definition: SmartProjectionFactor.h:266
Nonlinear factor base class.
Definition: NonlinearFactor.h:52
SmartProjectionFactor: triangulates point and keeps an estimate of it around.
Definition: SmartProjectionFactor.h:141
TriangulationResult result_
result from triangulateSafe
Definition: SmartProjectionFactor.h:159
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
boost::shared_ptr< RegularHessianFactor< Base::Dim > > createHessianFactor(const Cameras &cameras, const double lambda=0.0, bool diagonalDamping=false) const
linearize returns a Hessianfactor that is an approximation of error(p)
Definition: SmartProjectionFactor.h:272
This is the base class for all factor types.
Definition: Factor.h:51
double rankTolerance
threshold to decide whether triangulation is result.degenerate
Definition: triangulation.h:324
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:140
bool isValid() const
Is result valid?
Definition: SmartProjectionFactor.h:531
bool triangulateAndComputeJacobians(std::vector< typename Base::MatrixZD > &Fblocks, Matrix &E, Vector &b, const Values &values) const
Version that takes values, and creates the point.
Definition: SmartProjectionFactor.h:452
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:1072
virtual boost::shared_ptr< RegularHessianFactor< Base::Dim > > linearizeToHessian(const Values &values, double lambda=0.0) const
linearize to a Hessianfactor
Definition: SmartProjectionFactor.h:355
DegeneracyMode
How to manage degeneracy.
Definition: SmartProjectionFactor.h:40
virtual double error(const Values &values) const
Calculate total reprojection error.
Definition: SmartProjectionFactor.h:511
bool throwCheirality
If true, re-throws Cheirality exceptions (default: false)
Definition: SmartProjectionFactor.h:60
bool verboseCheirality
If true, prints text for Cheirality exceptions (default: false)
Definition: SmartProjectionFactor.h:61
std::vector< Pose3 > cameraPosesTriangulation_
current triangulation poses
Definition: SmartProjectionFactor.h:160
boost::shared_ptr< GaussianFactor > linearizeDamped(const Values &values, const double lambda=0.0) const
Linearize to Gaussian Factor.
Definition: SmartProjectionFactor.h:399
SmartProjectionFactor()
Default constructor, only for serialization.
Definition: SmartProjectionFactor.h:174
Base class for smart factors This base class has no internal point, but it has a measurement, noise model and an optional sensor pose.
Definition: SmartFactorBase.h:47
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
Definition: SymmetricBlockMatrix.h:51
boost::shared_ptr< JacobianFactor > createJacobianSVDFactor(const Cameras &cameras, double lambda) const
different (faster) way to compute Jacobian factor
Definition: SmartProjectionFactor.h:345
bool enableEPI
if set to true, will refine triangulation using LM
Definition: triangulation.h:325
double retriangulationThreshold
threshold to decide whether to re-triangulate
Definition: SmartProjectionFactor.h:55
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
Base class to create smart factors on poses or cameras.
LinearizationMode linearizationMode
How to linearize the factor.
Definition: SmartProjectionFactor.h:49
LinearizationMode
Linearization mode: what factor to linearize to.
Definition: SmartProjectionFactor.h:35
Definition: triangulation.h:322
Functions for triangulation.
boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > createJacobianQFactor(const Values &values, double lambda) const
Create a factor, takes values.
Definition: SmartProjectionFactor.h:339
virtual ~SmartProjectionFactor()
Virtual destructor.
Definition: SmartProjectionFactor.h:189
boost::shared_ptr< GaussianFactor > linearizeDamped(const Cameras &cameras, const double lambda=0.0) const
Linearize to Gaussian Factor.
Definition: SmartProjectionFactor.h:377
double landmarkDistanceThreshold
if the landmark is triangulated at distance larger than this, result is flagged as degenerate...
Definition: triangulation.h:331
TriangulationResult triangulateSafe(const std::vector< CAMERA > &cameras, const std::vector< Point2 > &measured, const TriangulationParameters &params)
triangulateSafe: extensive checking of the outcome
Definition: triangulation.h:440
bool isPointBehindCamera() const
return the cheirality status flag
Definition: SmartProjectionFactor.h:541
bool triangulateAndComputeJacobiansSVD(std::vector< typename Base::MatrixZD > &Fblocks, Matrix &Enull, Vector &b, const Values &values) const
takes values
Definition: SmartProjectionFactor.h:463
virtual boost::shared_ptr< GaussianFactor > linearize(const Values &values) const
linearize
Definition: SmartProjectionFactor.h:407
A set of cameras, all with their own calibration.
Definition: CameraSet.h:34
boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > createJacobianQFactor(const Cameras &cameras, double lambda) const
create factor
Definition: SmartProjectionFactor.h:329
bool decideIfTriangulate(const Cameras &cameras) const
Check if the new linearization point is the same as the one used for previous triangulation.
Definition: SmartProjectionFactor.h:216
bool isDegenerate() const
return the degenerate state
Definition: SmartProjectionFactor.h:536
CameraSet< CAMERA > Cameras
shorthand for a set of cameras
Definition: SmartProjectionFactor.h:169
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print
Definition: SmartProjectionFactor.h:197
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
bool equals(const CameraSet &p, double tol=1e-9) const
equals
Definition: CameraSet.h:82
double totalReprojectionError(const Cameras &cameras, boost::optional< Point3 > externalPoint=boost::none) const
Calculate the error of the factor.
Definition: SmartProjectionFactor.h:489
utility functions for loading datasets
TriangulationResult triangulateSafe(const Cameras &cameras) const
triangulateSafe
Definition: SmartProjectionFactor.h:252
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition: SmartProjectionFactor.h:166
TriangulationResult point() const
return the landmark
Definition: SmartProjectionFactor.h:520
SmartProjectionFactor(const SharedNoiseModel &sharedNoiseModel, const boost::optional< Pose3 > body_P_sensor=boost::none, const SmartProjectionParams &params=SmartProjectionParams())
Constructor.
Definition: SmartProjectionFactor.h:181
std::vector< Z > project2(const POINT &point, boost::optional< FBlocks & > Fs=boost::none, boost::optional< Matrix & > E=boost::none) const
Project a point (possibly Unit3 at infinity), with derivatives Note that F is a sparse block-diagonal...
Definition: CameraSet.h:101
Definition: SmartProjectionFactor.h:47
virtual boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > linearizeToJacobian(const Values &values, double lambda=0.0) const
linearize to a JacobianfactorQ
Definition: SmartProjectionFactor.h:367
void computeJacobiansWithTriangulatedPoint(std::vector< typename Base::MatrixZD > &Fblocks, Matrix &E, Vector &b, const Cameras &cameras) const
Compute F, E only (called below in both vanilla and SVD versions) Assumes the point has been computed...
Definition: SmartProjectionFactor.h:435
Vector reprojectionErrorAfterTriangulation(const Values &values) const
Calculate vector of re-projection errors, before applying noise model.
Definition: SmartProjectionFactor.h:474
bool triangulateAndComputeE(Matrix &E, const Values &values) const
Triangulate and compute derivative of error with respect to point.
Definition: SmartProjectionFactor.h:427
bool triangulateAndComputeE(Matrix &E, const Cameras &cameras) const
Triangulate and compute derivative of error with respect to point.
Definition: SmartProjectionFactor.h:416
virtual boost::shared_ptr< RegularImplicitSchurFactor< CAMERA > > linearizeToImplicit(const Values &values, double lambda=0.0) const
linearize to an Implicit Schur factor
Definition: SmartProjectionFactor.h:361
DegeneracyMode degeneracyMode
How to linearize the factor.
Definition: SmartProjectionFactor.h:50
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33