27 using namespace gtsam;
29 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V41 31 static const Cal3_S2 K(625, 625, 0, 0, 0);
51 TEST( SimpleCamera, level2)
55 SimpleCamera
camera = SimpleCamera::Level(
K,
pose2, 0.1);
65 TEST( SimpleCamera, lookat)
69 SimpleCamera camera = SimpleCamera::Lookat(
C,
Point3(0,0,0),
Point3(0,0,1));
72 Point3 xc(0,1,0),yc(0,0,-1),zc(-1,0,0);
103 TEST( SimpleCamera, backproject2)
106 Rot3 rot(1., 0., 0., 0., 0., 1., 0., -1., 0.);
111 pair<Point2, bool>
x = camera.projectSafe(
expected);
120 return SimpleCamera(pose,
K).project(point);
123 TEST( SimpleCamera, Dproject_point_pose)
135 TEST( SimpleCamera, simpleCamera)
137 Cal3_S2 K(468.2,427.2,91.2,300,200);
139 0.41380,0.90915,0.04708,
140 -0.57338,0.22011,0.78917,
141 0.70711,-0.35355,0.61237);
146 3.53553e2, 3.39645e2, 2.77744e2, -1.44946e6,
147 -1.03528e2, 2.33212e1, 4.59607e2, -6.32525e5,
148 7.07107e-1, -3.53553e-1,6.12372e-1, -9.18559e2).finished();
149 SimpleCamera actual = simpleCamera(P);
static Point2 project2(const CalibratedCamera &camera, const Point3 &point)
int EIGEN_BLAS_FUNC() rot(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy, RealScalar *pc, RealScalar *ps)
static Point2 project(const Pose3 &pose, const Unit3 &pointAtInfinity, const Cal3_S2::shared_ptr &cal)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
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
Rot2 R(Rot2::fromAngle(0.1))
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
Some functions to compute numerical derivatives.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const boost::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
const Pose3 & pose() const
return pose, constant version
static Point3 backproject(const Pose3 &pose, const Point2 &point, const double &depth)
PinholeCamera< Cal3_S2 > camera2(pose2,*sharedCal)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(boost::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
Eigen::Triplet< double > T
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const Point3 point3(0.08, 0.08, 0.0)
static const Point3 point2(-0.08, 0.08, 0.0)
static const Pose3 pose1(Rot3(), Point3(0, 1, 0.5))
Matrix< Scalar, Dynamic, Dynamic > C
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
A simple camera class with a Cal3_S2 calibration.
static const Point3 point4(0.08,-0.08, 0.0)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
const Point3 point1(3.0, 4.0, 2.0)
static const CalibratedCamera camera(kDefaultPose)
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
#define TEST(testGroup, testName)