35 #include <Base/Image/ImageBase.hh>
36 #include <Base/Image/ImageConvert.hh>
37 #include <Base/Image/ImageIO.hh>
38 #include <Image/PMDImageProc.hh>
43 int main(
int argc,
char *argv[]) {
47 string PMDName =
"img.tif";
48 string PMDNameXML =
"";
50 cout<<
"ExamplePMDImageIO:"<<endl;
52 if (strstr(argv[1],
".xml")!=NULL) {
54 }
else if (strstr(argv[1],
".tif")!=NULL) {
56 }
else if (strstr(argv[1],
".bmp")!=NULL) {
58 im, dim, mcim, metad);
60 cerr << argv[1] <<
" <image>\n";
64 cout <<
"Read 2D-image:" << argv[1] << endl;
89 cout <<
"Wrote img.tif" << endl;
90 cout <<
"Metadata set: " << endl
95 cerr << argv[1] <<
" <image>\n";
99 cout <<
"Read 2D-image:" << argv[1] << endl;
102 cerr << argv[2] <<
" <image>\n";
106 cout <<
"Read depth-image:" << argv[2] << endl;
109 cerr << argv[3] <<
" <image>\n";
113 cout <<
"Read modulation-coefficients-image:" << argv[3] << endl;
135 cout <<
"Wrote img.tif" << endl;
136 cout <<
"Metadata set: " << endl
139 for (
int i=0; i<4; i++) {
146 if (PMDNameXML!=
"") {
147 #ifdef BIAS_HAVE_XML2
151 BIASERR(
"USE_XML2 switched off, cannot parse xml-file!");
157 cout <<
"Read " << PMDNameXML <<
" or " << PMDName << endl;
158 cout <<
"Metadata read: " << endl
164 for (
int i=0; i<4; i++) {
168 for (
int i=0; i<3; i++) {
172 for (
int i=0; i<3; i++) {
175 cout << endl <<
"Metadata depth read: " << endl
182 for (
int i=0; i<4; i++) {
186 for (
int i=0; i<3; i++) {
190 for (
int i=0; i<3; i++) {
(16bit) unsigned integer image storage type
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
static int FitDepthTo2DImage(Image< float > &ImgDepth, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
convert a depth image such that the depth and the grey value at the same pixel position belong to the...
static int Save(const std::string &FileName, uint8 *Img2D, uint16 *ImgDepth, uint16 *ImgModCoeff, const PMDImageMetaData &MetaData2D, const PMDImageMetaData &MetaDataDepth)
Save a PMD-data 2d/3d-tiff image to disk.
unsigned int GetWidth() const
static int LoadFromTXT(int width, int height, const std::string &FileName2D, const std::string &FileNameDepth, const std::string &FileNameModCoeff, Image< unsigned char > &Img2D, Image< float > &ImgDepth, Image< float > &ImgModCoeff, PMDImageMetaData &MetaDataDepth)
Load PMD-image from 3 space separated text files.
static int Load(const std::string &FileName, uint8 *&Img2D, uint16 *&ImgDepth, uint16 *&ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
Load a PMD-data 2d/3d-tiff image from disk.
unsigned int GetHeight() const
void FillImageWithXValue()
fills image with value depending on x coordinate
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
static int FitModCoeffTo2DImage(Image< float > &ImgModCoeff, const Image< float > &ImgDepth, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...