I have the following yml file:
Contours count: 8
Contours:
-
Name: MI
Count: 28
Points:
-
x: 1116.
y: 687.
-
x: 1.1224088134765625e+003
y: 680.5911865234375000
-
I have the following c++ code, under Qt, and opencv 2.3.1:
cv::FileNode Points = fs["Contours"];
if (Points.type() != cv::FileNode::SEQ)
ui->textEdit->append("is not a sequence! FAIL");
cv::FileNodeIterator it = Points.begin(), it_end = Points.end();
int idx = 0; int Count = 0;
std::vector<uchar> lbpval;
for( ; it != it_end; ++it, idx++ )
{
Count += (int)(*it)["Count"];
QString s = QString::number(Count);
ui->textEdit->append(s);
}
I walk until Contours go to Count, iterate them, and find the total sum, but i am stuck at the Points node. How can i parse this node?
1 Answer