template<class CAMERA>
class gtsam::SmartProjectionFactor< CAMERA >
SmartProjectionFactor: triangulates point and keeps an estimate of it around.
This factor operates with monocular cameras, where a camera is expected to behave like PinholeCamera or PinholePose. This factor is intended to be used directly with PinholeCamera, which optimizes the camera pose and calibration. This also requires that values contains the involved cameras (instead of poses and calibrations separately). If the calibration is fixed use SmartProjectionPoseFactor instead!
|
| SmartProjectionFactor () |
| Default constructor, only for serialization.
|
|
| SmartProjectionFactor (const SharedNoiseModel &sharedNoiseModel, const boost::optional< Pose3 > body_P_sensor=boost::none, const SmartProjectionParams ¶ms=SmartProjectionParams()) |
| Constructor. More...
|
|
virtual | ~SmartProjectionFactor () |
| Virtual destructor.
|
|
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
| print More...
|
|
virtual bool | equals (const NonlinearFactor &p, double tol=1e-9) const |
| equals
|
|
bool | decideIfTriangulate (const Cameras &cameras) const |
| Check if the new linearization point is the same as the one used for previous triangulation.
|
|
TriangulationResult | triangulateSafe (const Cameras &cameras) const |
| triangulateSafe
|
|
bool | triangulateForLinearize (const Cameras &cameras) const |
| triangulate
|
|
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)
|
|
boost::shared_ptr< RegularImplicitSchurFactor< CAMERA > > | createRegularImplicitSchurFactor (const Cameras &cameras, double lambda) const |
|
boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > | createJacobianQFactor (const Cameras &cameras, double lambda) const |
| create factor
|
|
boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > | createJacobianQFactor (const Values &values, double lambda) const |
| Create a factor, takes values.
|
|
boost::shared_ptr< JacobianFactor > | createJacobianSVDFactor (const Cameras &cameras, double lambda) const |
| different (faster) way to compute Jacobian factor
|
|
virtual boost::shared_ptr< RegularHessianFactor< Base::Dim > > | linearizeToHessian (const Values &values, double lambda=0.0) const |
| linearize to a Hessianfactor
|
|
virtual boost::shared_ptr< RegularImplicitSchurFactor< CAMERA > > | linearizeToImplicit (const Values &values, double lambda=0.0) const |
| linearize to an Implicit Schur factor
|
|
virtual boost::shared_ptr< JacobianFactorQ< Base::Dim, 2 > > | linearizeToJacobian (const Values &values, double lambda=0.0) const |
| linearize to a JacobianfactorQ
|
|
boost::shared_ptr< GaussianFactor > | linearizeDamped (const Cameras &cameras, const double lambda=0.0) const |
| Linearize to Gaussian Factor. More...
|
|
boost::shared_ptr< GaussianFactor > | linearizeDamped (const Values &values, const double lambda=0.0) const |
| Linearize to Gaussian Factor. More...
|
|
virtual boost::shared_ptr< GaussianFactor > | linearize (const Values &values) const |
| linearize
|
|
bool | triangulateAndComputeE (Matrix &E, const Cameras &cameras) const |
| Triangulate and compute derivative of error with respect to point. More...
|
|
bool | triangulateAndComputeE (Matrix &E, const Values &values) const |
| Triangulate and compute derivative of error with respect to point. More...
|
|
void | computeJacobiansWithTriangulatedPoint (std::vector< typename Base::MatrixZD, Eigen::aligned_allocator< 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 Note E can be 2m*3 or 2m*2, in case point is degenerate.
|
|
bool | triangulateAndComputeJacobians (std::vector< typename Base::MatrixZD, Eigen::aligned_allocator< typename Base::MatrixZD > > &Fblocks, Matrix &E, Vector &b, const Values &values) const |
| Version that takes values, and creates the point.
|
|
bool | triangulateAndComputeJacobiansSVD (std::vector< typename Base::MatrixZD, Eigen::aligned_allocator< typename Base::MatrixZD > > &Fblocks, Matrix &Enull, Vector &b, const Values &values) const |
| takes values
|
|
Vector | reprojectionErrorAfterTriangulation (const Values &values) const |
| Calculate vector of re-projection errors, before applying noise model.
|
|
double | totalReprojectionError (const Cameras &cameras, boost::optional< Point3 > externalPoint=boost::none) const |
| Calculate the error of the factor. More...
|
|
virtual double | error (const Values &values) const |
| Calculate total reprojection error.
|
|
TriangulationResult | point () const |
| return the landmark
|
|
TriangulationResult | point (const Values &values) const |
| COMPUTE the landmark.
|
|
bool | isValid () const |
| Is result valid?
|
|
bool | isDegenerate () const |
| return the degenerate state
|
|
bool | isPointBehindCamera () const |
| return the cheirality status flag
|
|
bool | isOutlier () const |
| return the outlier state
|
|
bool | isFarPoint () const |
| return the farPoint state
|
|
| SmartFactorBase () |
| Default Constructor, for serialization.
|
|
| SmartFactorBase (const SharedNoiseModel &sharedNoiseModel, boost::optional< Pose3 > body_P_sensor=boost::none, size_t expectedNumberCameras=10) |
| Constructor.
|
|
virtual | ~SmartFactorBase () |
| Virtual destructor, subclasses from NonlinearFactor.
|
|
void | add (const Z &measured_i, const Key &cameraKey_i) |
| Add a new measurement and pose key. More...
|
|
void | add (ZVector &measurements, KeyVector &cameraKeys) |
| Add a bunch of measurements, together with the camera keys.
|
|
template<class SFM_TRACK > |
void | add (const SFM_TRACK &trackToAdd) |
| Adds an entire SfM_track (collection of cameras observing a single point). More...
|
|
virtual size_t | dim () const |
| get the dimension (number of rows!) of the factor
|
|
const ZVector & | measured () const |
| return the measurements
|
|
virtual Cameras | cameras (const Values &values) const |
| Collect all cameras: important that in key order.
|
|
template<class POINT > |
Vector | unwhitenedError (const Cameras &cameras, const POINT &point, boost::optional< typename Cameras::FBlocks & > Fs=boost::none, boost::optional< Matrix & > E=boost::none) const |
| Compute reprojection errors [h(x)-z] = [cameras.project(p)-z] and derivatives.
|
|
virtual void | correctForMissingMeasurements (const Cameras &cameras, Vector &ue, boost::optional< typename Cameras::FBlocks & > Fs=boost::none, boost::optional< Matrix & > E=boost::none) const |
| This corrects the Jacobians for the case in which some pixel measurement is missing (nan) In practice, this does not do anything in the monocular case, but it is implemented in the stereo version.
|
|
template<class POINT > |
Vector | whitenedError (const Cameras &cameras, const POINT &point) const |
| Calculate vector of re-projection errors [h(x)-z] = [cameras.project(p) - z] Noise model applied.
|
|
template<class POINT > |
double | totalReprojectionError (const Cameras &cameras, const POINT &point) const |
| Calculate the error of the factor. More...
|
|
template<class POINT > |
void | computeJacobians (FBlocks &Fs, Matrix &E, Vector &b, const Cameras &cameras, const POINT &point) const |
| Compute F, E, and b (called below in both vanilla and SVD versions), where F is a vector of derivatives wrpt the cameras, and E the stacked derivatives with respect to the point. More...
|
|
template<class POINT > |
void | computeJacobiansSVD (FBlocks &Fs, Matrix &Enull, Vector &b, const Cameras &cameras, const POINT &point) const |
| SVD version.
|
|
boost::shared_ptr< RegularHessianFactor< Dim > > | createHessianFactor (const Cameras &cameras, const Point3 &point, const double lambda=0.0, bool diagonalDamping=false) const |
| Linearize to a Hessianfactor.
|
|
void | updateAugmentedHessian (const Cameras &cameras, const Point3 &point, const double lambda, bool diagonalDamping, SymmetricBlockMatrix &augmentedHessian, const KeyVector allKeys) const |
| Add the contribution of the smart factor to a pre-allocated Hessian, using sparse linear algebra. More...
|
|
void | whitenJacobians (FBlocks &F, Matrix &E, Vector &b) const |
| Whiten the Jacobians computed by computeJacobians using noiseModel_.
|
|
boost::shared_ptr< RegularImplicitSchurFactor< CAMERA > > | createRegularImplicitSchurFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0, bool diagonalDamping=false) const |
| Return Jacobians as RegularImplicitSchurFactor with raw access.
|
|
boost::shared_ptr< JacobianFactorQ< Dim, ZDim > > | createJacobianQFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0, bool diagonalDamping=false) const |
| Return Jacobians as JacobianFactorQ.
|
|
boost::shared_ptr< JacobianFactor > | createJacobianSVDFactor (const Cameras &cameras, const Point3 &point, double lambda=0.0) const |
| Return Jacobians as JacobianFactorSVD TODO lambda is currently ignored.
|
|
Pose3 | body_P_sensor () const |
|
| NonlinearFactor () |
| Default constructor for I/O only.
|
|
template<typename CONTAINER > |
| NonlinearFactor (const CONTAINER &keys) |
| Constructor from a collection of the keys involved in this factor.
|
|
virtual | ~NonlinearFactor () |
| Destructor.
|
|
virtual bool | active (const Values &) const |
| Checks whether a factor should be used based on a set of values. More...
|
|
virtual shared_ptr | clone () const |
| Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses. More...
|
|
shared_ptr | rekey (const std::map< Key, Key > &rekey_mapping) const |
| Creates a shared_ptr clone of the factor with different keys using a map from old->new keys.
|
|
shared_ptr | rekey (const KeyVector &new_keys) const |
| Clones a factor and fully replaces its keys. More...
|
|
Key | front () const |
| First key.
|
|
Key | back () const |
| Last key.
|
|
const_iterator | find (Key key) const |
| find
|
|
const KeyVector & | keys () const |
| Access the factor's involved variable keys.
|
|
const_iterator | begin () const |
| Iterator at beginning of involved variable keys.
|
|
const_iterator | end () const |
| Iterator at end of involved variable keys.
|
|
size_t | size () const |
|
void | print (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print
|
|
void | printKeys (const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const |
| print only keys
|
|
KeyVector & | keys () |
|
iterator | begin () |
| Iterator at beginning of involved variable keys.
|
|
iterator | end () |
| Iterator at end of involved variable keys.
|
|