Loading...
Searching...
No Matches
gtsam::PinholePose< CALIBRATION > Class Template Reference
Geometry

## Detailed Description

template<typename CALIBRATION>
class gtsam::PinholePose< CALIBRATION >

A pinhole camera class that has a Pose3 and a fixed Calibration.

Instead of using this class, one might consider calibrating the measurements and using CalibratedCamera, which would then be faster.

Inheritance diagram for gtsam::PinholePose< CALIBRATION >:

## Testable

std::ostream & | operator<< (std::ostream &os, const PinholePose &camera)
| stream operator
bool | equals (const Base &camera, double tol=1e-9) const
| assert equality up to a tolerance
void | print (const std::string &s="PinholePose") const override
| print

## Standard Constructors

| PinholePose ()
| default constructor
| PinholePose (const Pose3 &pose)
| constructor with pose, uses default calibration
| PinholePose (const Pose3 &pose, const boost::shared_ptr< CALIBRATION > &K)
| constructor with pose and calibration

## Advanced Constructors

| PinholePose (const Vector &v)
| Init from 6D vector.
| PinholePose (const Vector &v, const Vector &K)
| Init from Vector and calibration.
| PinholePose (const Pose3 &pose, const Vector &K)

## Standard Interface

const boost::shared_ptr< CALIBRATION > & | sharedCalibration () const
| return shared pointer to calibration
const CALIBRATION & | calibration () const override
| return calibration
Point2 | project2 (const Point3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none) const
| project a point from world coordinate to the image, 2 derivatives only
Point2 | project2 (const Unit3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none) const
| project2 version for point at infinity

## Manifold

size_t | dim () const
PinholePose | retract (const Vector6 &d) const
| move a cameras according to d
Vector6 | localCoordinates (const PinholePose &p) const
| return canonical coordinate
Matrix34 | cameraProjectionMatrix () const
| for Linear Triangulation
Vector | defaultErrorWhenTriangulatingBehindCamera () const
| for Nonlinear Triangulation
static size_t | Dim ()
static PinholePose | Identity ()
| for Canonical

## Named Constructors

static PinholePose | Level (const boost::shared_ptr< CALIBRATION > &K, const Pose2 &pose2, double height)
| Create a level camera at the given 2D pose and height.
static PinholePose | Level (const Pose2 &pose2, double height)
| PinholePose::level with default calibration.
static PinholePose | Lookat (const Point3 &eye, const Point3 &target, const Point3 &upVector, const boost::shared_ptr< CALIBRATION > &K=boost::make_shared< CALIBRATION >())
| Create a camera at the given eye position looking at a target point in the scene with the specified up direction vector.

## Public Types

enum | { dimension = 6 }
Public Types inherited from gtsam::PinholeBaseK< CALIBRATION >
typedef CALIBRATION | CalibrationType
Public Types inherited from gtsam::PinholeBase
typedef Rot3 | Rotation
| Pose Concept requirements.
typedef Point3 | Translation
typedef Point2 | Measurement
| Some classes template on either PinholeCamera or StereoCamera, and this typedef informs those classes what "project" returns.
typedef Point2Vector | MeasurementVector

## Friends

class | boost::serialization::access
| Serialization function.

## Additional Inherited Members

std::pair< Point2, bool > | projectSafe (const Point3 &pw) const
| Project a point into the image and check depth.
template<class POINT>
Point2 | _project (const POINT &pw, OptionalJacobian< 2, 6 > Dpose, OptionalJacobian< 2, FixedDimension< POINT >::value > Dpoint, OptionalJacobian< 2, DimK > Dcal) const
| Templated projection of a point (possibly at infinity) from world coordinate to the image.
Point2 | project (const Point3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none, OptionalJacobian< 2, DimK > Dcal=boost::none) const
| project a 3D point from world coordinates into the image
Point2 | reprojectionError (const Point3 &pw, const Point2 &measured, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none, OptionalJacobian< 2, DimK > Dcal=boost::none) const
| project a 3D point from world coordinates into the image
Point2 | project (const Unit3 &pw, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none, OptionalJacobian< 2, DimK > Dcal=boost::none) const
| project a point at infinity from world coordinates into the image
Point3 | backproject (const Point2 &p, double depth, OptionalJacobian< 3, 6 > Dresult_dpose=boost::none, OptionalJacobian< 3, 2 > Dresult_dp=boost::none, OptionalJacobian< 3, 1 > Dresult_ddepth=boost::none, OptionalJacobian< 3, DimK > Dresult_dcal=boost::none) const
| backproject a 2-dimensional point to a 3-dimensional point at given depth
Unit3 | backprojectPointAtInfinity (const Point2 &p) const
| backproject a 2-dimensional point to a 3-dimensional point at infinity
double | range (const Point3 &point, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 3 > Dpoint=boost::none) const
| Calculate range to a landmark.
double | range (const Pose3 &pose, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 6 > Dpose=boost::none) const
| Calculate range to another pose.
double | range (const CalibratedCamera &camera, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 6 > Dother=boost::none) const
| Calculate range to a CalibratedCamera.
template<class CalibrationB>
double | range (const PinholeBaseK< CalibrationB > &camera, OptionalJacobian< 1, 6 > Dcamera=boost::none, OptionalJacobian< 1, 6 > Dother=boost::none) const
| Calculate range to a PinholePoseK derived class.
| PinholeBaseK ()
| default constructor
| PinholeBaseK (const Pose3 &pose)
| constructor with pose
| PinholeBaseK (const Vector &v)
std::pair< Point2, bool > | projectSafe (const Point3 &pw) const
| Project a point into the image and check depth.
Point2 | project2 (const Point3 &point, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 3 > Dpoint=boost::none) const
| Project point into the image Throws a CheiralityException if point behind image plane iff GTSAM_THROW_CHEIRALITY_EXCEPTION.
Point2 | project2 (const Unit3 &point, OptionalJacobian< 2, 6 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none) const
| Project point at infinity into the image Throws a CheiralityException if point behind image plane iff GTSAM_THROW_CHEIRALITY_EXCEPTION.
| PinholeBase ()
| Default constructor.
| PinholeBase (const Pose3 &pose)
| Constructor with pose.
| PinholeBase (const Vector &v)
virtual | ~PinholeBase ()=default
| Default destructor.
bool | equals (const PinholeBase &camera, double tol=1e-9) const
| assert equality up to a tolerance
const Pose3 & | pose () const
| return pose, constant version
const Rot3 & | rotation () const
| get rotation
const Point3 & | translation () const
| get translation
const Pose3 & | getPose (OptionalJacobian< 6, 6 > H) const
| return pose, with derivative
static Pose3 | LevelPose (const Pose2 &pose2, double height)
| Create a level pose at the given 2D pose and height.
static Pose3 | LookatPose (const Point3 &eye, const Point3 &target, const Point3 &upVector)
| Create a camera pose at the given eye position looking at a target point in the scene with the specified up direction vector.
static Point2 | Project (const Point3 &pc, OptionalJacobian< 2, 3 > Dpoint=boost::none)
| Project from 3D point in camera coordinates into image Does not throw a CheiralityException, even if pc behind image plane.
static Point2 | Project (const Unit3 &pc, OptionalJacobian< 2, 2 > Dpoint=boost::none)
| Project from 3D point at infinity in camera coordinates into image Does not throw a CheiralityException, even if pc behind image plane.
static Point3 | BackprojectFromCamera (const Point2 &p, const double depth, OptionalJacobian< 3, 2 > Dpoint=boost::none, OptionalJacobian< 3, 1 > Ddepth=boost::none)
| backproject a 2-dimensional point to a 3-dimensional point at given depth
static std::pair< size_t, size_t > | translationInterval ()
| Return the start and end indices (inclusive) of the translation component of the exponential map parameterization.
static Matrix26 | Dpose (const Point2 &pn, double d)
| Calculate Jacobian with respect to pose.
static Matrix23 | Dpoint (const Point2 &pn, double d, const Matrix3 &Rt)
| Calculate Jacobian with respect to point.

## Member Function Documentation

## calibration()

template<typename CALIBRATION>

const CALIBRATION & gtsam::PinholePose< CALIBRATION >::calibration | ( |  | ) | const

inline override virtual

return calibration

Implements gtsam::PinholeBaseK< CALIBRATION >.

## Dim()

template<typename CALIBRATION>

size_t gtsam::PinholePose< CALIBRATION >::Dim | ( |  | ) |

inline static

Deprecated

## dim()

template<typename CALIBRATION>

size_t gtsam::PinholePose< CALIBRATION >::dim | ( |  | ) | const

inline

Deprecated

## Level()

template<typename CALIBRATION>

PinholePose gtsam::PinholePose< CALIBRATION >::Level | ( | const boost::shared_ptr< CALIBRATION > & | K,
|  | const Pose2 & | pose2,
|  | double | height )

inline static

Create a level camera at the given 2D pose and height.

Parameters

  K | the calibration
  pose2 | specifies the location and viewing direction (theta 0 = looking in direction of positive X axis)
  height | camera height

## Lookat()

template<typename CALIBRATION>

PinholePose gtsam::PinholePose< CALIBRATION >::Lookat | ( | const Point3 & | eye,
|  | const Point3 & | target,
|  | const Point3 & | upVector,
|  | const boost::shared_ptr< CALIBRATION > & | K = boost::make_shared<CALIBRATION>() )

inline static

Create a camera at the given eye position looking at a target point in the scene with the specified up direction vector.

Parameters

  eye | specifies the camera position
  target | the point to look at
  upVector | specifies the camera up direction vector, doesn't need to be on the image plane nor orthogonal to the viewing axis
  K | optional calibration parameter

## print()

template<typename CALIBRATION>

void gtsam::PinholePose< CALIBRATION >::print | ( | const std::string & | s = "PinholePose< CALIBRATION >" | ) | const

inline override virtual

print

Reimplemented from gtsam::PinholeBase.

## project2()

template<typename CALIBRATION>

Point2 gtsam::PinholePose< CALIBRATION >::project2 | ( | const Point3 & | pw,
|  | OptionalJacobian< 2, 6 > | Dpose = boost::none,
|  | OptionalJacobian< 2, 3 > | Dpoint = boost::none ) const

inline

project a point from world coordinate to the image, 2 derivatives only

Parameters

  pw | is a point in world coordinates
  Dpose | is the Jacobian w.r.t. the whole camera (really only the pose)
  Dpoint | is the Jacobian w.r.t. point3

The documentation for this class was generated from the following file:

- /build/gtsam-gchP9J/gtsam-4.2.2+dfsg/gtsam/geometry/PinholePose.h