Go to the documentation of this file.
18 using namespace std::placeholders;
20 using namespace gtsam;
50 std::vector<FundamentalMatrix> Fs = {
54 for (
const auto&
trueF : Fs) {
65 d << 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7;
78 TEST(SimpleStereo, Conversion) {
84 TEST(SimpleStereo, LocalCoordinates) {
91 TEST(SimpleStereo, Retract) {
97 TEST(SimpleStereo, RoundTrip) {
99 d << 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7;
106 TEST(SimpleStereo, EpipolarLine) {
123 TEST(PixelStereo, Conversion) {
129 auto actual = convertedF.
matrix();
130 actual *=
expected(1, 2) / actual(1, 2);
135 TEST(PixelStereo, PointInBToHorizontalLineInA) {
152 TEST(RotatedPixelStereo, Conversion) {
158 auto actual = convertedF.
matrix();
159 actual *=
expected(1, 2) / actual(1, 2);
164 TEST(RotatedPixelStereo, PointInBToHorizontalLineInA) {
187 auto actual = convertedF.
matrix();
188 actual *=
expected(1, 2) / actual(1, 2);
196 const double radius = 1.0;
197 for (
int i = 0;
i < 3; ++
i) {
198 double angle =
i * 2.0 *
M_PI / 3.0;
199 double c =
cos(angle),
s =
sin(angle);
210 std::array<SimpleFundamentalMatrix, 3>
F;
211 for (
size_t i = 0;
i < 3; ++
i) {
212 size_t j = (
i + 1) % 3;
217 return {
F[0],
F[1],
F[2]};
236 std::array<Point2, 3>
p;
237 for (
size_t i = 0;
i < 3; ++
i) {
static int runAllTests(TestResult &result)
SimpleFundamentalMatrix stereoWithPrincipalPoints(rotatedE, focalLength, focalLength, principalPoint, principalPoint)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
#define GTSAM_CONCEPT_TESTABLE_INST(T)
Concept check for values that can be used in unit tests.
Jet< T, N > sin(const Jet< T, N > &f)
#define EXPECT(condition)
typedef and functions to augment Eigen's MatrixXd
Vector localCoordinates(const SimpleFundamentalMatrix &F) const
Return local coordinates with respect to another SimpleFundamentalMatrix.
TEST(FundamentalMatrix, LocalCoordinates)
SimpleFundamentalMatrix pixelStereo(defaultE, focalLength, focalLength, zero, zero)
EssentialMatrix rotatedE(aRb, Unit3(1, 0, 0))
FundamentalMatrix trueF(trueU.matrix(), trueS, trueV.matrix())
Jet< T, N > cos(const Jet< T, N > &f)
3D rotation represented as a rotation matrix or quaternion
TripleF< SimpleFundamentalMatrix > generateTripleF(const std::array< Pose3, 3 > &cameraPoses)
Function to generate a TripleF from camera poses.
std::array< Pose3, 3 > generateCameraPoses()
Generate three cameras on a circle, looking in.
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Matrix3 matrix() const
Return the fundamental matrix representation.
SimpleFundamentalMatrix stereoF(defaultE, 1.0, 1.0, zero, zero)
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Point2 principalPoint(640/2, 480/2)
SimpleFundamentalMatrix rotatedPixelStereo(rotatedE, focalLength, focalLength, zero, zero)
SimpleFundamentalMatrix retract(const Vector &delta) const
Retract the given vector to get a new SimpleFundamentalMatrix.
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
std::array< Pose3, 3 > cameraPoses
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation
Class for representing a simple fundamental matrix.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
#define GTSAM_CONCEPT_MANIFOLD_INST(T)
**
Vector localCoordinates(const FundamentalMatrix &F) const
Return local coordinates with respect to another FundamentalMatrix.
The most common 5DOF 3D->2D calibration.
A simple camera class with a Cal3_S2 calibration.
Represents a 3D point on a unit sphere.
static const CalibratedCamera camera(kDefaultPose)
EssentialMatrix defaultE(Rot3(), Unit3(1, 0, 0))
Represents a fundamental matrix in computer vision, which encodes the epipolar geometry between two v...
Point2 project(const Point3 &point, OptionalJacobian< 2, 6 > Dcamera={}, OptionalJacobian< 2, 3 > Dpoint={}) const
FundamentalMatrix retract(const Vector &delta) const
Retract the given vector to get a new FundamentalMatrix.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:07:26