i'm beginning in c++ and i try to use xml in my code, this is my source code :
cv::FileStorage fs("facedata.xml", cv::FileStorage::WRITE);
cv::Mat mask = cv::Mat::zeros(8, 8, CV_32FC1); // all 0
mask(Rect(2,2,4,4)) = 1;
fs << "histo" <<mask;
CvMat * Mat=cvCreateMat(8,8,CV_32FC1);
cvZero(Mat);
fs.release();
cv::FileStorage fs2("facedata.xml", cv::FileStorage::READ);
CvScalar pix;
int K,L;
fs2 [ "histo" ]>> Mat;
for ( K=0;K<8;K++)
for ( L=0;L<8;L++){
pix=cvGet2D( Mat,K,L);
cout<<(int) pix.val[0]<<endl;}
but Mat
does not return the content of histo
, i need your help.