25 #ifndef __BIAS_PMDIMAGEIO_H__
26 #define __BIAS_PMDIMAGEIO_H__
28 #include <bias_config.h>
33 #if TIFFLIB_VERSION < 20051230
34 # error You need at least TIFF version 3.8.0 (TIFFLIB_VERSION >= 20051230) for PMD multi plane tiff.
36 #endif //BIAS_HAVE_TIFF
39 #include <Base/Image/Image.hh>
42 # include <Base/Common/XMLIO.hh>
50 #define TIFFTAG_PRINCIPALPOINT 33550
52 #define TIFFTAG_FOCALLENGTHX 33920
53 #define TIFFTAG_ASPECTRATIO 33921
55 #define TIFFTAG_UNDISTORTION 34263
57 #define TIFFTAG_CAMERACENTER 34736
58 #define TIFFTAG_CAMERAROTATION 34737
59 #endif //BIAS_HAVE_TIFF
78 double UndistCoeff[4];
79 double CameraCenter[3];
80 double CameraRotation[3];
105 static int Save(
const std::string& FileName,
106 uint8* Img2D, uint16* ImgDepth,
110 static int Save(
const std::string& FileName,
111 uint16* Img2D, uint16* ImgDepth,
123 static int Save(
const std::string& FileName,
138 static int Load(
const std::string& FileName,
139 uint8* &Img2D, uint16* &ImgDepth,
140 uint16* &ImgModCoeff,
143 static int Load(
const std::string& FileName,
144 uint16* &Img2D, uint16* &ImgDepth,
145 uint16* &ImgModCoeff,
157 static int Load(
const std::string& FileName,
167 static int LoadFromTIFF(
const std::string& FileName,
177 static int LoadFromTXT(
int width,
int height,
178 const std::string& FileName2D,
179 const std::string& FileNameDepth,
180 const std::string& FileNameModCoeff,
186 #ifdef BIAS_HAVE_XML2
191 static int LoadFromXML(
const std::string& FileName,
198 static int LoadFromXML(
const std::string& FileName,
202 std::vector<PMDImageMetaData> &MetaData2D,
203 std::vector<PMDImageMetaData> &MetaDataDepth);
217 static int LoadXML(
const std::string& FileName,
218 uint16* &Img2D, uint16* &ImgDepth,
219 uint16* &ImgModCoeff,
222 static int LoadXML(
XMLIO &myXML, xmlNodePtr &rootNode,
223 uint16* &Img2D, uint16* &ImgDepth,
224 uint16* &ImgModCoeff,
235 static int GetBitRep(
const std::string& FileName);
240 static void NewTagsInitialize_();
244 static void NewTagsCallback_(TIFF *tif);
246 static int LoadMetaData_(TIFF* tiffimage,
249 static int Load2DImage8Bit_(TIFF *tiffimage, uint8* &Img2D,
251 static int Load2DImage16Bit_(TIFF *tiffimage, uint16* &Img2D,
253 static int LoadDepthImage_(TIFF *tiffimage, uint16* &ImgDepth,
255 static int LoadModCoeffImage_(TIFF *tiffimage, uint16* &ImgModCoeff,
258 static void Grey16to8Bit_(uint16* src, uint8* &dst,
unsigned int size);
259 static uint16 DepthConvert_(
float depth);
260 static float DepthConvert_(uint16 depth);
261 static uint16 ModCoeffConvert_(
float modcoeff);
262 static float ModCoeffConvert_(uint16 modcoeff);
264 static int PostprocessData_(uint8* data2d, uint16* dataDepth,
265 uint16* dataModCoeff,
274 static uint16 Convert_(
float val,
float lower,
float upper);
275 static float Convert_(uint16 val,
float lower,
float upper);
278 static int SaveMetaData_(TIFF* tiffimage,
281 static int Save2DImage8Bit_(TIFF *tiffimage, uint8* Img2D,
284 static int Save2DImage16Bit_(TIFF *tiffimage, uint16* Img2D,
287 static int SaveDepthImage_(TIFF *tiffimage, uint16* ImgDepth,
290 static int SaveModCoeffImage_(TIFF *tiffimage, uint16* ImgModCoeff,
296 #endif //BIAS_HAVE_TIFF
static TIFFExtendProc ParentExtender
Save 2D/3D-image-data together with some metadata in a single tiff-datafile.
Wrapper class for reading and writing XML files based on the XML library libxml2. ...