32 using namespace gtsam;
83 Point3 xc(0,1,0),yc(0,0,-1),zc(-1,0,0);
90 Matrix R = camera2.pose().rotation().matrix();
126 Rot3 rot(1., 0., 0., 0., 0., 1., 0., -1., 0.);
131 pair<Point2, bool>
x = camera.projectSafe(expected);
141 return Camera(pose, cal).project2(point);
158 return camera.project2(point);
180 camera.project2(
point1, Dpose, Dpoint);
190 return Camera(pose, cal).project(pointAtInfinity);
219 const double depth(10);
220 camera.backproject(point, depth, Dpose, Dpoint, Ddepth, Dcal);
234 return camera.range(point);
250 return camera.range(pose);
266 static const std::shared_ptr<Cal3Bundler>
K2 =
267 std::make_shared<Cal3Bundler>(625, 1
e-3, 1e-3);
287 return camera.range(camera3);
Pinhole camera with known calibration.
static const Point3 point1(-0.08,-0.08, 0.0)
int EIGEN_BLAS_FUNC() rot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
static const CalibratedCamera camera3(pose1)
static Point2 project(const Pose3 &pose, const Unit3 &pointAtInfinity, const Cal3_S2::shared_ptr &cal)
internal::FixedSizeMatrix< Y, X4 >::type numericalDerivative44(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
static Point2 project3(const Pose3 &pose, const Point3 &point, const Cal3_S2::shared_ptr &cal)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
TEST(PinholePose, constructor)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set origin
static const Camera camera1(pose1, K)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Rot2 R(Rot2::fromAngle(0.1))
static double range2(const Camera &camera, const Camera2 &camera2)
PinholePose< Cal3_S2 > Camera
Some functions to compute numerical derivatives.
static const Cal3_S2::shared_ptr K
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
static double range1(const Camera &camera, const Pose3 &pose)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
static const Unit3 point3_inf(0.16, 0.16, -1.0)
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
static const Unit3 point2_inf(-0.16, 0.16, -1.0)
static const Point3 point3(0.08, 0.08, 0.0)
Represents a 3D point on a unit sphere.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative41(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
std::shared_ptr< Cal3_S2 > shared_ptr
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative32(std::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
#define EXPECT(condition)
static Point3 backproject(const Pose3 &pose, const Cal3_S2 &cal, const Point2 &p, const double &depth)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative31(std::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
static const Point3 point2(-0.08, 0.08, 0.0)
The most common 5DOF 3D->2D calibration.
PinholePose< Cal3Bundler > Camera2
static double range3(const Camera &camera, const CalibratedCamera &camera3)
Matrix< Scalar, Dynamic, Dynamic > C
static const Camera2 camera2(pose1, K2)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative42(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
Calibration used by Bundler.
static const Unit3 point4_inf(0.16,-0.16, -1.0)
static double range0(const Camera &camera, const Point3 &point)
Unit3 pointAtInfinity(0, 0, -1000)
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative43(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
Vector5 vector() const
vectorized form (column-wise)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
static const Camera camera(pose, K)
static const Point3 point4(0.08,-0.08, 0.0)
double distance3(const Point3 &p1, const Point3 &q, OptionalJacobian< 1, 3 > H1, OptionalJacobian< 1, 3 > H2)
distance between two points
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Calibration used by Bundler.
static Point2 project4(const Camera &camera, const Point3 &point)
The most common 5DOF 3D->2D calibration.
static const std::shared_ptr< Cal3Bundler > K2
static const Unit3 point1_inf(-0.16,-0.16, -1.0)