Skip to content

Commit bce9050

Browse files
committed
adding 11 point example for cal3bundler
1 parent 91e58f5 commit bce9050

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

examples/CreateSFMExampleData.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,46 @@ void create18PointExample1() {
111111

112112
// Create test data, we need 15 points
113113
vector<Point3> P;
114-
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1),
115-
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1),
116-
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1),
117-
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5),
118-
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5),
119-
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);
114+
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1), //
115+
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1), //
116+
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1), //
117+
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5), //
118+
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5), //
119+
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);
120120

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

126+
/* ************************************************************************* */
127+
void create11PointExample2() {
128+
// Create two cameras poses
129+
Rot3 aRb = Rot3::Yaw(M_PI_2);
130+
Point3 aTb(10, 0, 0);
131+
Pose3 pose1, pose2(aRb, aTb);
132+
133+
// Create test data, we need 11 points
134+
vector<Point3> P;
135+
P += Point3(0, 0, 100), Point3(0, 0, 100), Point3(0, 0, 100), //
136+
Point3(-10, 0, 100), Point3(10, 0, 100), //
137+
Point3(0, 50, 50), Point3(0, -50, 50), //
138+
Point3(-10, 50, 50), Point3(10, -50, 50), //
139+
Point3(-20, 0, 80), Point3(20, -50, 80);
140+
141+
// Assumes example is run in ${GTSAM_TOP}/build/examples
142+
const string filename = "../../examples/data/11pointExample2.txt";
143+
Cal3Bundler K(500, 0, 0);
144+
createExampleBALFile(filename, P, pose1, pose2, K);
145+
}
146+
126147
/* ************************************************************************* */
127148

128149
int main(int argc, char* argv[]) {
129150
create5PointExample1();
130151
create5PointExample2();
131152
create18PointExample1();
153+
create11PointExample2();
132154
return 0;
133155
}
134156

0 commit comments

Comments
 (0)