Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
BIAS::PMDImageIO Class Reference

Save 2D/3D-image-data together with some metadata in a single tiff-datafile. More...

#include <Base/Image/PMDImageIO.hh>

Static Public Member Functions

static int GetBitRep (const std::string &FileName)
 Returns the bit representation (8 or 16) for the 2D-image in the PMD-image filename. More...
 
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. More...
 
static int Load (const std::string &FileName, uint16 *&Img2D, uint16 *&ImgDepth, uint16 *&ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
static int Load (const std::string &FileName, Image< unsigned char > &Img2D, Image< float > &ImgDepth, Image< float > &ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 Load a PMD-data 2d/3d-image from disk, automatically detecting TIFF or XML file format and calling the appropriate subroutine. More...
 
static int LoadFromTIFF (const std::string &FileName, Image< unsigned char > &Img2D, Image< float > &ImgDepth, Image< float > &ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 Load a PMD-data 2d/3d-image from TIFF-file. More...
 
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. More...
 
static int LoadFromXML (const std::string &FileName, Image< unsigned char > &Img2D, Image< float > &ImgDepth, Image< float > &ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 Load a PMD-data 2d/3d-image from PMDtec's XMK format. More...
 
static int LoadFromXML (const std::string &FileName, std::vector< Image< unsigned char > > &Imgs2D, std::vector< Image< float > > &ImgDepth, std::vector< Image< float > > &ImgModCoeff, std::vector< PMDImageMetaData > &MetaData2D, std::vector< PMDImageMetaData > &MetaDataDepth)
 
static int LoadXML (const std::string &FileName, uint16 *&Img2D, uint16 *&ImgDepth, uint16 *&ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 Load a PMD-image in the PMD-technologies XML-format from disk for a specification see the CamVis Pro instruction manual. More...
 
static int LoadXML (XMLIO &myXML, xmlNodePtr &rootNode, uint16 *&Img2D, uint16 *&ImgDepth, uint16 *&ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
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. More...
 
static int Save (const std::string &FileName, uint16 *Img2D, uint16 *ImgDepth, uint16 *ImgModCoeff, const PMDImageMetaData &MetaData2D, const PMDImageMetaData &MetaDataDepth)
 
static int Save (const std::string &FileName, BIAS::Image< unsigned char > &Img2D, BIAS::Image< float > &ImgDepth, BIAS::Image< float > &ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 Save a PMD-data 2d/3d-tiff image to disk. More...
 

Static Protected Member Functions

static uint16 Convert_ (float val, float lower, float upper)
 
static float Convert_ (uint16 val, float lower, float upper)
 
static uint16 DepthConvert_ (float depth)
 
static float DepthConvert_ (uint16 depth)
 
static void Grey16to8Bit_ (uint16 *src, uint8 *&dst, unsigned int size)
 
static int Load2DImage16Bit_ (TIFF *tiffimage, uint16 *&Img2D, PMDImageMetaData &MetaData2D)
 
static int Load2DImage8Bit_ (TIFF *tiffimage, uint8 *&Img2D, PMDImageMetaData &MetaData2D)
 
static int LoadDepthImage_ (TIFF *tiffimage, uint16 *&ImgDepth, PMDImageMetaData &MetaDataDepth)
 
static int LoadMetaData_ (TIFF *tiffimage, PMDImageMetaData &MetaData)
 
static int LoadModCoeffImage_ (TIFF *tiffimage, uint16 *&ImgModCoeff, PMDImageMetaData MetaDataDepth)
 
static uint16 ModCoeffConvert_ (float modcoeff)
 
static float ModCoeffConvert_ (uint16 modcoeff)
 
static void NewTagsCallback_ (TIFF *tif)
 
static void NewTagsInitialize_ ()
 
static int PostprocessData_ (uint8 *data2d, uint16 *dataDepth, uint16 *dataModCoeff, Image< unsigned char > &Img2D, Image< float > &ImgDepth, Image< float > &ImgModCoeff, PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
static int Save2DImage16Bit_ (TIFF *tiffimage, uint16 *Img2D, PMDImageMetaData MetaData2D, int LinesPerStrip)
 
static int Save2DImage8Bit_ (TIFF *tiffimage, uint8 *Img2D, PMDImageMetaData MetaData2D, int LinesPerStrip)
 
static int SaveDepthImage_ (TIFF *tiffimage, uint16 *ImgDepth, PMDImageMetaData MetaDataDepth, int LinesPerStrip)
 
static int SaveMetaData_ (TIFF *tiffimage, const PMDImageMetaData &MetaData)
 
static int SaveModCoeffImage_ (TIFF *tiffimage, uint16 *ImgModCoeff, PMDImageMetaData MetaDataDepth, int LinesPerStrip)
 

Static Protected Attributes

static TIFFExtendProc ParentExtender = NULL
 

Detailed Description

Save 2D/3D-image-data together with some metadata in a single tiff-datafile.

The 2D-3D-data is aligned, such that for each pixel in the 2D-image the corresponding depth is stored at the same position in the depth image. A -1 in the depth image indicates that no depth data is available.

Author
streckel 02/2006

Definition at line 93 of file PMDImageIO.hh.

Member Function Documentation

uint16 PMDImageIO::Convert_ ( float  val,
float  lower,
float  upper 
)
staticprotected

Definition at line 1099 of file PMDImageIO.cpp.

float PMDImageIO::Convert_ ( uint16  val,
float  lower,
float  upper 
)
staticprotected

Definition at line 1106 of file PMDImageIO.cpp.

uint16 PMDImageIO::DepthConvert_ ( float  depth)
staticprotected

Definition at line 1114 of file PMDImageIO.cpp.

float PMDImageIO::DepthConvert_ ( uint16  depth)
staticprotected

Definition at line 1119 of file PMDImageIO.cpp.

int PMDImageIO::GetBitRep ( const std::string &  FileName)
static

Returns the bit representation (8 or 16) for the 2D-image in the PMD-image filename.

0 if there is no 2D image, -1 in case of error.

Author
Birger Streckel

Definition at line 1050 of file PMDImageIO.cpp.

void PMDImageIO::Grey16to8Bit_ ( uint16 *  src,
uint8 *&  dst,
unsigned int  size 
)
staticprotected

Definition at line 1078 of file PMDImageIO.cpp.

int PMDImageIO::Load ( const std::string &  FileName,
uint8 *&  Img2D,
uint16 *&  ImgDepth,
uint16 *&  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Load a PMD-data 2d/3d-tiff image from disk.

Parameters
FileNamecomplete name of file to be loaded
Img2Dto receive the 2d-image data from the file, new memory is allocated, if NULL tif contained no 2D-image
ImgDepthto receive the depth-image data from the file, new memory is allocated, if NULL tif contained no depth-image
MetaDatato receive the Metadata from the file
Author
Birger Streckel
Examples:
ExamplePMDImageIO.cpp.

Definition at line 570 of file PMDImageIO.cpp.

Referenced by BIAS::VideoSource_DiskPMD::GrabSingle(), and BIAS::VideoSource_DiskPMD::OpenDevice().

int PMDImageIO::Load ( const std::string &  FileName,
uint16 *&  Img2D,
uint16 *&  ImgDepth,
uint16 *&  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Definition at line 519 of file PMDImageIO.cpp.

int PMDImageIO::Load ( const std::string &  FileName,
Image< unsigned char > &  Img2D,
Image< float > &  ImgDepth,
Image< float > &  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Load a PMD-data 2d/3d-image from disk, automatically detecting TIFF or XML file format and calling the appropriate subroutine.

Parameters
FileNamecomplete name of file to be loaded
imgto receive the 2d-image data from the file
depthimgto receive the depth-image data from the file
MetaDatato receive the Metadata from the file
Author
Birger Streckel

Definition at line 825 of file PMDImageIO.cpp.

int PMDImageIO::Load2DImage16Bit_ ( TIFF *  tiffimage,
uint16 *&  Img2D,
PMDImageMetaData MetaData2D 
)
staticprotected
int PMDImageIO::Load2DImage8Bit_ ( TIFF *  tiffimage,
uint8 *&  Img2D,
PMDImageMetaData MetaData2D 
)
staticprotected
int PMDImageIO::LoadDepthImage_ ( TIFF *  tiffimage,
uint16 *&  ImgDepth,
PMDImageMetaData MetaDataDepth 
)
staticprotected
int PMDImageIO::LoadFromTIFF ( const std::string &  FileName,
Image< unsigned char > &  Img2D,
Image< float > &  ImgDepth,
Image< float > &  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Load a PMD-data 2d/3d-image from TIFF-file.

Author
Birger Streckel

Definition at line 956 of file PMDImageIO.cpp.

int PMDImageIO::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 
)
static
int PMDImageIO::LoadFromXML ( const std::string &  FileName,
Image< unsigned char > &  Img2D,
Image< float > &  ImgDepth,
Image< float > &  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Load a PMD-data 2d/3d-image from PMDtec's XMK format.

The 1st image is Load if the file contains a sequence.

Author
Birger Streckel

Definition at line 849 of file PMDImageIO.cpp.

References BIAS::PMDImageMetaData::channels, BIAS::PMDImageMetaData::height, and BIAS::PMDImageMetaData::width.

Referenced by BIAS::VideoSource_DiskPMD::OpenDevice().

int PMDImageIO::LoadFromXML ( const std::string &  FileName,
std::vector< Image< unsigned char > > &  Imgs2D,
std::vector< Image< float > > &  ImgDepth,
std::vector< Image< float > > &  ImgModCoeff,
std::vector< PMDImageMetaData > &  MetaData2D,
std::vector< PMDImageMetaData > &  MetaDataDepth 
)
static
int PMDImageIO::LoadMetaData_ ( TIFF *  tiffimage,
PMDImageMetaData MetaData 
)
staticprotected
int PMDImageIO::LoadModCoeffImage_ ( TIFF *  tiffimage,
uint16 *&  ImgModCoeff,
PMDImageMetaData  MetaDataDepth 
)
staticprotected
int PMDImageIO::LoadXML ( const std::string &  FileName,
uint16 *&  Img2D,
uint16 *&  ImgDepth,
uint16 *&  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Load a PMD-image in the PMD-technologies XML-format from disk for a specification see the CamVis Pro instruction manual.

Data from tag <grayscale> is Load to Img2D, <distance> is Load to ImgDepth and <amplitude> is Load to ImgModCoeff. All other tags <rawXY> are ignored. Is a sequence is given, only the first image is Load.

Parameters
FileNamecomplete name of file to be loaded
Img2Dto receive the 2d-image data from the file, new memory is allocated, if NULL tif contained no 2D-image
ImgDepthto receive the depth-image data from the file, new memory is allocated, if NULL tif contained no depth-image
MetaDatato receive the Metadata from the file
Author
Birger Streckel

Definition at line 624 of file PMDImageIO.cpp.

References BIAS::XMLIO::getChild(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::read().

int PMDImageIO::LoadXML ( XMLIO myXML,
xmlNodePtr &  rootNode,
uint16 *&  Img2D,
uint16 *&  ImgDepth,
uint16 *&  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static
uint16 PMDImageIO::ModCoeffConvert_ ( float  modcoeff)
staticprotected

Definition at line 1124 of file PMDImageIO.cpp.

float PMDImageIO::ModCoeffConvert_ ( uint16  modcoeff)
staticprotected

Definition at line 1128 of file PMDImageIO.cpp.

void PMDImageIO::NewTagsCallback_ ( TIFF *  tif)
staticprotected

Definition at line 1314 of file PMDImageIO.cpp.

void PMDImageIO::NewTagsInitialize_ ( )
staticprotected

Definition at line 1300 of file PMDImageIO.cpp.

int PMDImageIO::PostprocessData_ ( uint8 *  data2d,
uint16 *  dataDepth,
uint16 *  dataModCoeff,
Image< unsigned char > &  Img2D,
Image< float > &  ImgDepth,
Image< float > &  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
staticprotected
int PMDImageIO::Save ( const std::string &  FileName,
uint8 *  Img2D,
uint16 *  ImgDepth,
uint16 *  ImgModCoeff,
const PMDImageMetaData MetaData2D,
const PMDImageMetaData MetaDataDepth 
)
static

Save a PMD-data 2d/3d-tiff image to disk.

Parameters
FileNameOutput filename, should have the extension .tif
Img2Dpointer to the 2d-image data to save, if NULL only depth is written, metadata is also ignored
ImgDepthpointer to the depth data to save, if NULL only 2D-img is written, metadata is also ignored
MetaData2Dthe Metadata of the 2D-image to save
MetaDataDepththe Metadata of the depth image to use for padding
Author
Birger Streckel
Examples:
ExamplePMDImageIO.cpp.

Definition at line 235 of file PMDImageIO.cpp.

int PMDImageIO::Save ( const std::string &  FileName,
uint16 *  Img2D,
uint16 *  ImgDepth,
uint16 *  ImgModCoeff,
const PMDImageMetaData MetaData2D,
const PMDImageMetaData MetaDataDepth 
)
static

Definition at line 278 of file PMDImageIO.cpp.

int PMDImageIO::Save ( const std::string &  FileName,
BIAS::Image< unsigned char > &  Img2D,
BIAS::Image< float > &  ImgDepth,
BIAS::Image< float > &  ImgModCoeff,
PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

Save a PMD-data 2d/3d-tiff image to disk.

Parameters
FileNameOutput filename, should have the extension .tif
imgthe 2d-image data to save
depthimgthe depth data to save
MetaData2Dthe Metadata of the 2D-image to save
MetaDataDepththe Metadata of the depth image to use for padding
Author
Birger Streckel

Definition at line 743 of file PMDImageIO.cpp.

References BIAS::PMDImageMetaData::channels, BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), BIAS::PMDImageMetaData::height, BIAS::ImageBase::IsEmpty(), and BIAS::PMDImageMetaData::width.

int PMDImageIO::Save2DImage16Bit_ ( TIFF *  tiffimage,
uint16 *  Img2D,
PMDImageMetaData  MetaData2D,
int  LinesPerStrip 
)
staticprotected
int PMDImageIO::Save2DImage8Bit_ ( TIFF *  tiffimage,
uint8 *  Img2D,
PMDImageMetaData  MetaData2D,
int  LinesPerStrip 
)
staticprotected
int PMDImageIO::SaveDepthImage_ ( TIFF *  tiffimage,
uint16 *  ImgDepth,
PMDImageMetaData  MetaDataDepth,
int  LinesPerStrip 
)
staticprotected
int PMDImageIO::SaveMetaData_ ( TIFF *  tiffimage,
const PMDImageMetaData MetaData 
)
staticprotected
int PMDImageIO::SaveModCoeffImage_ ( TIFF *  tiffimage,
uint16 *  ImgModCoeff,
PMDImageMetaData  MetaDataDepth,
int  LinesPerStrip 
)
staticprotected

Member Data Documentation

TIFFExtendProc PMDImageIO::ParentExtender = NULL
staticprotected

Definition at line 294 of file PMDImageIO.hh.


The documentation for this class was generated from the following files: