本文整理汇总了C++中SysSBA::setupSys方法的典型用法代码示例。如果您正苦于以下问题:C++ SysSBA::setupSys方法的具体用法?C++ SysSBA::setupSys怎么用?C++ SysSBA::setupSys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SysSBA
的用法示例。
在下文中一共展示了SysSBA::setupSys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pt
//.........这里部分代码省略.........
// add random noise to node positions
nd2.qrot.coeffs().head<3>() += qnoise*Vector3d::Random();
nd2.normRot();
cout << "Quaternion: " << nd2.qrot.coeffs().transpose() << endl << endl;
nd2.trans.head<3>() += tnoise*Vector3d::Random();
nd2.setTransform(); // set up world2node transform
nd2.setProjection();
#ifdef LOCAL_ANGLES
nd2.setDr(true); // set rotational derivatives
#else
nd2.setDr(false); // set rotational derivatives
#endif
sys.nodes[1] = nd2; // reset node
nd3.qrot.coeffs().head<3>() += qnoise*Vector3d::Random();
nd3.normRot();
// cout << "Quaternion: " << nd3.qrot.transpose() << endl << endl;
nd3.trans.head<3>() += tnoise*Vector3d::Random();
nd3.setTransform(); // set up world2node transform
nd3.setProjection(); // set up node2image projection
#ifdef LOCAL_ANGLES
nd3.setDr(true); // set rotational derivatives
#else
nd3.setDr(false); // set rotational derivatives
#endif
sys.nodes[2] = nd3; // reset node
#ifdef WRITE_GRAPH
writeGraphFile("sba-with-err.graph",sys);
#endif
#if 0
// set up system, no lambda for here
sys.setupSys(0.0);
ofstream(fd);
fd.open("A.txt");
fd.precision(8); // this is truly inane
fd << fixed;
fd << sys.A << endl;
fd.close();
fd.open("B.txt");
fd.precision(8);
fd << fixed;
fd << sys.B << endl;
fd.close();
#endif
#ifndef LOCAL_ANGLES
sys.useLocalAngles = false;
#endif
sys.nFixed = 1; // number of fixed cameras
sys.doSBA(10,1.0e-3,false);
cout << endl << "Quaternion: " << sys.nodes[1].qrot.coeffs().transpose() << endl;
// normalize output translation
Vector4d frt2a = sys.nodes[1].trans;
double s = frt2.head<3>().norm() / frt2a.head<3>().norm();
frt2a.head<3>() *= s;
cout << "Translation: " << frt2a.transpose() << endl << endl;
cout << "Quaternion: " << sys.nodes[2].qrot.coeffs().transpose() << endl;
Vector4d frt3a = sys.nodes[2].trans;
s = frt3.head<3>().norm() / frt3a.head<3>().norm();
frt3a.head<3>() *= s;
cout << "Translation: " << frt3a.transpose() << endl << endl;