我要做的是从迭代中获取第一个矩阵,并将其保存为单独的矩阵,然后我可以使用它来对其余数据执行函数。下面是我的迭代代码;
FileNode n = fs.root();
for (FileNodeIterator current = n.begin(); current != n.end(); current++)
{
FileNode item = *current;
Mat v, pose;
item["pose"] >> v;
string Frame;
Frame = item.name();
if (v.rows != 0) // finding the nodes that contain data and saving them as "pose"
{
transpose(v, pose);
pose.size();
cout << "The size of pose for " << Frame;
cout << " is: \n" << pose.size()<< "\n Data was collected for this frame: \n" << pose << endl;
}
if (v.rows != 6) // Nodes with no data
{
cout << "The size of pose for " << Frame;
cout << " is: \n" << v.size() << "\n No Data was collected for this frame. \n" << endl;
}
有没有办法获取“pose”的第一个实例并将其保存为另一个矩阵,例如“base”?