本文整理汇总了C++中SysSBA::writeA方法的典型用法代码示例。如果您正苦于以下问题:C++ SysSBA::writeA方法的具体用法?C++ SysSBA::writeA怎么用?C++ SysSBA::writeA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SysSBA
的用法示例。
在下文中一共展示了SysSBA::writeA方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pt
//.........这里部分代码省略.........
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;
// calculate cost, should be close to zero
double cost = 0.0;
EXPECT_EQ_ABS(cost,0.0,10.0);
// cameras should be close to their original positions,
// adjusted for scale on translations
for (int i=0; i<4; i++)
EXPECT_EQ_ABS(sys.nodes[1].qrot.coeffs()[i],frq2.coeffs()[i],0.01);
for (int i=0; i<4; i++)
EXPECT_EQ_ABS(sys.nodes[2].qrot.coeffs()[i],frq3.coeffs()[i],0.01);
for (int i=0; i<3; i++)
EXPECT_EQ_ABS(frt2a(i),frt2(i),0.01);
for (int i=0; i<3; i++)
EXPECT_EQ_ABS(frt3a(i),frt3(i),0.01);
#if 1
// writing out matrices, 3-node system
// global system
sys.useLocalAngles = false;
nd1.setDr(false);
nd2.setDr(false);
nd3.setDr(false);
sys.setupSys(0.0);
sys.A.block<6,6>(6,0) = sys.A.block<6,6>(0,6).transpose();
writeA("A3g.txt",sys);
// local system
sys.useLocalAngles = true;
nd1.setDr(true);
nd2.setDr(true);
nd3.setDr(true);
sys.setupSys(0.0);
sys.A.block<6,6>(6,0) = sys.A.block<6,6>(0,6).transpose();
writeA("A3l.txt",sys);
#endif
#if 0
// set up 2-node system
sys.nodes.clear();
sys.tracks.clear();
sys.nodes.push_back(nd1);
sys.nodes.push_back(nd2);
// set up projections onto nodes
ind = 0;
for(vector<Point,Eigen::aligned_allocator<Point> >::iterator itr = sys.points.begin(); itr!=sys.points.end(); itr++)
{
Point pt = *itr;
vector<Proj,Eigen::aligned_allocator<Proj> > prjs; // new point track
Proj prj;
prj.isValid = true;
prj.pti = ind;
prj.kpi = ind;
Vector2d ipt;
n2.setRandom();