#include <Base/Image/Image.hh>
#include <Base/Image/ImageIO.hh>
#include <sstream>
#define HOMGPOINT2D_TYPE double
using namespace BIAS;
using namespace std;
int main()
{
double point[]={2.0, 3.0, 1.0}, point2[3]={0.0, 0.0, 0.0};
ostringstream ascii;
string filename="metadata";
string mipfilename=filename+".mip";
string pgmfilename=filename+".pgm";
string tag;
md=im.GetMetaData();
BIASASSERT(md!=NULL);
(char *)point);
(char *)point);
ascii <<" [ "<<point[0]<<" "<<point[1]<<" "<<point[2]<<" ]";
md->
Add(
"#[HomgPoint2D]", ascii.str());
md->
Add(
"#[HomgPoint2D]", ascii.str());
BIASERR("error writing image "<<filename);
}
BIASERR("error exporting image "<<filename);
}
BIASERR("error reading image "<<filename<<".mip");
}
BIASASSERT(md!=NULL);
cerr << "found "<<md->size()<<" metadatas in "<<mipfilename<<endl;
point2[0]=((HOMGPOINT2D_TYPE *)appdata.
data)[0];
point2[1]=((HOMGPOINT2D_TYPE *)appdata.
data)[1];
point2[2]=((HOMGPOINT2D_TYPE *)appdata.
data)[2];
cout << " found MD_HomgPoint2D in "<<filename<<".mip : [ "
<<point2[0]<<" "<<point2[1]<<" "<<point2[2]<<" ]"<<endl;
} else {
BIASERR("MD_HomgPoint2D not found in "<<filename<<".mip");
}
BIASERR("error importing image "<<filename);
}
BIASASSERT(md!=NULL);
cerr << "found "<<md->size()<<" metadatas in "<<pgmfilename<<endl;
if (md->
Find(
"#[HomgPoint2D]", appdata)!=-1){
cout << " found ascii in "<<filename<<".pgm : "
} else {
BIASERR("#[HomgPoint2D] not found in "<<filename<<".pgm");
}
return 0;
}