Skip to content

Commit

Permalink
adding 11 point example for cal3bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushbaid committed Jun 10, 2021
1 parent 91e58f5 commit bce9050
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions examples/CreateSFMExampleData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,46 @@ void create18PointExample1() {

// Create test data, we need 15 points
vector<Point3> P;
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1),
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1),
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1),
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5),
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5),
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1), //
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1), //
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1), //
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5), //
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5), //
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);

// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/18pointExample1.txt";
createExampleBALFile(filename, P, pose1, pose2);
}

/* ************************************************************************* */
void create11PointExample2() {
// Create two cameras poses
Rot3 aRb = Rot3::Yaw(M_PI_2);
Point3 aTb(10, 0, 0);
Pose3 pose1, pose2(aRb, aTb);

// Create test data, we need 11 points
vector<Point3> P;
P += Point3(0, 0, 100), Point3(0, 0, 100), Point3(0, 0, 100), //
Point3(-10, 0, 100), Point3(10, 0, 100), //
Point3(0, 50, 50), Point3(0, -50, 50), //
Point3(-10, 50, 50), Point3(10, -50, 50), //
Point3(-20, 0, 80), Point3(20, -50, 80);

// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/11pointExample2.txt";
Cal3Bundler K(500, 0, 0);
createExampleBALFile(filename, P, pose1, pose2, K);
}

/* ************************************************************************* */

int main(int argc, char* argv[]) {
create5PointExample1();
create5PointExample2();
create18PointExample1();
create11PointExample2();
return 0;
}

Expand Down

0 comments on commit bce9050

Please # to comment.