10 #include <gtsam/nonlinear/expressions.h> 20 typedef Expression<Point2> Point2_;
21 typedef Expression<Rot2> Rot2_;
22 typedef Expression<Pose2> Pose2_;
24 inline Point2_ transformTo(
const Pose2_& x,
const Point2_& p) {
30 typedef Expression<Point3> Point3_;
31 typedef Expression<Unit3> Unit3_;
32 typedef Expression<Rot3> Rot3_;
33 typedef Expression<Pose3> Pose3_;
35 inline Point3_ transformTo(
const Pose3_& x,
const Point3_& p) {
39 inline Point3_ transformFrom(
const Pose3_& x,
const Point3_& p) {
43 inline Point3_
rotate(
const Rot3_& x,
const Point3_& p) {
47 inline Point3_ unrotate(
const Rot3_& x,
const Point3_& p) {
53 typedef Expression<Cal3_S2> Cal3_S2_;
54 typedef Expression<Cal3Bundler> Cal3Bundler_;
62 inline Point2_
project(
const Unit3_& p_cam) {
64 return Point2_(f, p_cam);
69 template <
class CAMERA,
class POINT>
70 Point2 project4(
const CAMERA& camera,
const POINT& p, OptionalJacobian<2, CAMERA::dimension> Dcam,
71 OptionalJacobian<2, FixedDimension<POINT>::value> Dpoint) {
72 return camera.project2(p, Dcam, Dpoint);
76 template <
class CAMERA,
class POINT>
77 Point2_ project2(
const Expression<CAMERA>& camera_,
const Expression<POINT>& p_) {
78 return Point2_(internal::project4<CAMERA, POINT>, camera_, p_);
83 template <
class CALIBRATION,
class POINT>
84 inline Point2 project6(
const Pose3& x,
const Point3& p,
const Cal3_S2& K,
85 OptionalJacobian<2, 6> Dpose, OptionalJacobian<2, 3> Dpoint,
86 OptionalJacobian<2, 5> Dcal) {
87 return PinholeCamera<Cal3_S2>(x, K).project(p, Dpose, Dpoint, Dcal);
91 template <
class CALIBRATION,
class POINT>
92 inline Point2_ project3(
const Pose3_& x,
const Expression<POINT>& p,
93 const Expression<CALIBRATION>& K) {
94 return Point2_(internal::project6<CALIBRATION, POINT>, x, p, K);
97 template <
class CALIBRATION>
98 Point2_ uncalibrate(
const Expression<CALIBRATION>& K,
const Point2_& xy_hat) {
99 return Point2_(K, &CALIBRATION::uncalibrate, xy_hat);
Point3 transformTo(const Point3 &p, OptionalJacobian< 3, 6 > Dpose=boost::none, OptionalJacobian< 3, 3 > Dpoint=boost::none) const
takes point in world coordinates and transforms it to Pose coordinates
Definition: Pose3.cpp:328
Calibration used by Bundler.
The most common 5DOF 3D->2D calibration.
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Point3 rotate(const Point3 &p, OptionalJacobian< 3, 3 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
rotate point from rotated coordinate frame to world
Definition: Rot3M.cpp:120
Point3 transformFrom(const Point3 &p, OptionalJacobian< 3, 6 > Dpose=boost::none, OptionalJacobian< 3, 3 > Dpoint=boost::none) const
takes point in Pose coordinates and transforms it to world coordinates
Definition: Pose3.cpp:312
Point3 unrotate(const Point3 &p, OptionalJacobian< 3, 3 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
rotate point from world to rotated frame
Definition: Rot3.cpp:134
Base class for all pinhole cameras.
Point2_ project(const Point3_ &p_cam)
Expression version of PinholeBase::Project.
Definition: expressions.h:57
Expression class that supports automatic differentiation.
Definition: Expression.h:49
Point2 transformTo(const Point2 &point, OptionalJacobian< 2, 3 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none) const
Return point coordinates in pose coordinate frame.
Definition: Pose2.cpp:201
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
P rotate(const T &r, const P &pt)
rotation functions
Definition: lieProxies.h:47
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,...
Definition: CalibratedCamera.cpp:88