Slight efficiencies

release/4.3a0
dellaert 2014-10-02 11:44:16 +02:00
parent bef23a2008
commit 0800b83285
2 changed files with 3 additions and 3 deletions

View File

@ -85,8 +85,8 @@ int main(int argc, char* argv[]) {
// Simulated measurements from each camera pose, adding them to the factor graph
for (size_t i = 0; i < poses.size(); ++i) {
for (size_t j = 0; j < points.size(); ++j) {
SimpleCamera camera(poses[i], *K);
for (size_t j = 0; j < points.size(); ++j) {
Point2 measurement = camera.project(points[j]);
graph.push_back(GenericProjectionFactor<Pose3, Point3, Cal3_S2>(measurement, measurementNoise, Symbol('x', i), Symbol('l', j), K));
}

View File

@ -67,11 +67,11 @@ int main(int argc, char* argv[]) {
// Simulated measurements from each camera pose, adding them to the factor graph
for (size_t i = 0; i < poses.size(); ++i) {
for (size_t j = 0; j < points.size(); ++j) {
Pose3_ x('x', i);
SimpleCamera camera(poses[i], K);
for (size_t j = 0; j < points.size(); ++j) {
Point2 measurement = camera.project(points[j]);
// Below an expression for the prediction of the measurement:
Pose3_ x('x', i);
Point3_ p('l', j);
Expression<Point2> prediction = uncalibrate(cK, project(transform_to(x, p)));
// Again, here we use a BADFactor