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 | List of all members
BIAS::PMDImageProc Class Reference

#include <Image/PMDImageProc.hh>

Static Public Member Functions

static int AddNoiseToDepthImage (Image< float > &ImgDepth)
 This function adds noise to a depth image. More...
 
static double CalcSigmaDepth (const Image< float > &ImgDepth, const unsigned int x, const unsigned int y, const unsigned int HalfWinSize)
 Give the standard deviation for a pixel in the depth image. More...
 
static int CrossCheck (Image< float > &cIm, const Projection &cP, std::vector< const Image< float > * > &cImCheck, std::vector< const Projection * > &cPCheck, int searchSize=3)
 Projects all points != 0 in image cIm to both other images cIm1 and cIm2 and checks whether the 3D point projects to a valid point !=0 in the other images or if a valid point !=0 exists in the neighbourhood of size searchSize. More...
 
static void DeleteHighVarianceValues (BIAS::Image< float > &img, const double sigmaThresh, const int halfwinSize=1)
 Deletes (sets to 0) pixels in PMD-Image with a local variance > sigmaThresh. More...
 
static int DenoiseDepthImage (Image< float > &ImgDepth, int size=1, double sigmaVarianz=0.5)
 This function denoises a PMD-Depth image by Median and variance filtering. More...
 
static void Fit2DToDepthImage (Image< float > &depthImage, Image< unsigned char > &textureImage, Projection &depthProj, Projection &textureProj, Image< unsigned char > &newColorImage)
 calculates a color image of the size of the depth image by projecting every pixel of the depth image to 3D space and projecting it back to the color image using the color image projection More...
 
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 same ray. More...
 
static int FitDepthTo2DImage (Image< float > &ImageDepth, const BIAS::Projection &proj2D, const BIAS::Projection &projDepth, int kernelsize=0)
 
static int FitModCoeffTo2DImage (Image< float > &ImgModCoeff, const Image< float > &ImgDepth, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
static KMatrix KFromMeta (const PMDImageMetaData &MetaData)
 
static void LimitDepthSpread (BIAS::Image< float > &depthImage, float maxDeviation)
 use to limit the depth spread to a certain range around the More...
 
static void MarkHighVarianceValues (const BIAS::Image< float > &img, BIAS::Image< float > &mark, double sigmaThresh, int halfwinSize=1)
 Markes pixels in PMD-Image with a local variance > sigmaThresh. More...
 
static PMDImageMetaData MetaFromPoseAndK (const Pose &Po, const KMatrix &K, int width, int height, int channels)
 
static Pose PoseFromMeta (const PMDImageMetaData &MetaData)
 
static void ScaleDepthImage (Image< float > &ImgDepth, double scaleFactor)
 This function scales the depth image with the given scale factor. More...
 

Static Protected Member Functions

static int FitDepthTo2DImageFree_ (Image< float > &ImgToModify, const Image< float > &ImgDepth, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
static int FitDepthTo2DImageHomogr_ (Image< float > &ImgToModify, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 
static int FitDepthTo2DImageKOnly_ (Image< float > &ImgToModify, const PMDImageMetaData &MetaData2D, PMDImageMetaData &MetaDataDepth)
 These methods transform the depth image to fit the 2D-image. More...
 
static HMatrix HFromMeta_ (const PMDImageMetaData &MetaData2D, const PMDImageMetaData &MetaDataDepth)
 Create a H-Matrix that converts the depth image to the 2D view. More...
 

Detailed Description

Definition at line 41 of file PMDImageProc.hh.

Member Function Documentation

int PMDImageProc::AddNoiseToDepthImage ( Image< float > &  ImgDepth)
static

This function adds noise to a depth image.

The intention is to add noise to a synthetically created depth image. The noise sigma is similar to that of a good conditioned PMD-measurement.

Definition at line 512 of file PMDImageProc.cpp.

References CalcSigmaDepth(), BIAS::ImageBase::GetHeight(), BIAS::Random::GetNormalDistributed(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::PixelValue(), and BIAS::Image< StorageType >::SetPixel().

double PMDImageProc::CalcSigmaDepth ( const Image< float > &  ImgDepth,
const unsigned int  x,
const unsigned int  y,
const unsigned int  HalfWinSize 
)
static

Give the standard deviation for a pixel in the depth image.

Measurement precision polynome was taken from: M.Stommel K.-D.Kuhnert "Fusion of Stereo-Camera and PMD-Camera Data for Real-Time Suited Precise 3D Environment Reconstruction"

Returns
the sigma of the pixel depth depending on the precision formula and the surrounding pixels.

Definition at line 544 of file PMDImageProc.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::Image< StorageType >::PixelValue().

Referenced by AddNoiseToDepthImage().

int PMDImageProc::CrossCheck ( BIAS::Image< float > &  cIm,
const Projection cP,
std::vector< const Image< float > * > &  cImCheck,
std::vector< const Projection * > &  cPCheck,
int  searchSize = 3 
)
static

Projects all points != 0 in image cIm to both other images cIm1 and cIm2 and checks whether the 3D point projects to a valid point !=0 in the other images or if a valid point !=0 exists in the neighbourhood of size searchSize.

If no valid points can be found in the other images in cImCheck the pixel in image cIm is invalidated (=0).

Parameters
cIm[in][out],:the image to check and invalidate.
cImCheck[in],:the images to check against.
cPCheck[in],:the projections to check against, same order as in cImCheck.
searchSize[in],:the area around a projected pixel to search for neighbours (default = 3).
Returns
number of deleted pixels, -1 on error
Author
ischiller
Date
08/2010

Definition at line 645 of file PMDImageProc.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint2D, and BIAS::ProjectionParametersBase::UnProjectToPoint().

void PMDImageProc::DeleteHighVarianceValues ( BIAS::Image< float > &  img,
const double  sigmaThresh,
const int  halfwinSize = 1 
)
static

Deletes (sets to 0) pixels in PMD-Image with a local variance > sigmaThresh.

Eleminates depth noise.

Author
grest

Definition at line 581 of file PMDImageProc.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), and BIAS::ImageBase::GetWidth().

int PMDImageProc::DenoiseDepthImage ( Image< float > &  ImgDepth,
int  size = 1,
double  sigmaVarianz = 0.5 
)
static
void PMDImageProc::Fit2DToDepthImage ( Image< float > &  depthImage,
Image< unsigned char > &  textureImage,
Projection depthProj,
Projection textureProj,
Image< unsigned char > &  newColorImage 
)
static

calculates a color image of the size of the depth image by projecting every pixel of the depth image to 3D space and projecting it back to the color image using the color image projection

Parameters
depthImage[in]: the depth imahe to use
textureImage[in]: the original color image
depthProj[in]: projection corresponding to depthImage
textureProj[in]: projection corresponding to textureImage
newColorImage[out],:calculated new color image, same size as depthImage
Author
ischiller
Date
08/2010

Definition at line 324 of file PMDImageProc.cpp.

References BIAS::Projection::DoesPointProjectIntoImage(), BIAS::Image< StorageType >::FillImageWithConstValue(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::HomgPoint2D, BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::ReInit(), and BIAS::Projection::UnProjectToPoint().

int PMDImageProc::FitDepthTo2DImage ( Image< float > &  ImgDepth,
const PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static

convert a depth image such that the depth and the grey value at the same pixel position belong to the same ray.

The transformation information is taken from the metadata. MetaDataDepth is changed for the converted depth image and is identical to MetaData2D afterwards

Parameters
ImgDepthis the image to convert. This image has to contain depth information and is changed in size and contents.
MetaData2Dthis is the metadata for the 2D-image.
MetaDataDepththe metadata for the depth image. Is adapted to reflect the image transformation.
Author
Birger Streckel
Examples:
ExamplePMDImageIO.cpp.

Definition at line 131 of file PMDImageProc.cpp.

References BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, and BIAS::Equal().

int PMDImageProc::FitDepthTo2DImage ( Image< float > &  ImageDepth,
const BIAS::Projection proj2D,
const BIAS::Projection projDepth,
int  kernelsize = 0 
)
static
int PMDImageProc::FitDepthTo2DImageFree_ ( Image< float > &  ImgToModify,
const Image< float > &  ImgDepth,
const PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
staticprotected
int PMDImageProc::FitDepthTo2DImageHomogr_ ( Image< float > &  ImgToModify,
const PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
staticprotected
int PMDImageProc::FitDepthTo2DImageKOnly_ ( Image< float > &  ImgToModify,
const PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
staticprotected

These methods transform the depth image to fit the 2D-image.

After transformation the Depth for every 2D-point is at the same pixel position in the depth image. There are 3 steps of transformaiton complexity: Only K, Only Rot+K, Free.

Author
Birger Streckel

Definition at line 189 of file PMDImageProc.cpp.

References BIAS::PMDImageMetaData::height, BIAS::KMatrix::Invert(), BIAS::Matrix3x3< T >::IsIdentity(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map(), BIAS::HomographyMapping< InputStorageType, OutputStorageType >::SetHomography(), and BIAS::PMDImageMetaData::width.

int PMDImageProc::FitModCoeffTo2DImage ( Image< float > &  ImgModCoeff,
const Image< float > &  ImgDepth,
const PMDImageMetaData MetaData2D,
PMDImageMetaData MetaDataDepth 
)
static
HMatrix PMDImageProc::HFromMeta_ ( const PMDImageMetaData MetaData2D,
const PMDImageMetaData MetaDataDepth 
)
staticprotected
KMatrix PMDImageProc::KFromMeta ( const PMDImageMetaData MetaData)
static
void PMDImageProc::LimitDepthSpread ( BIAS::Image< float > &  depthImage,
float  maxDeviation 
)
static
void PMDImageProc::MarkHighVarianceValues ( const BIAS::Image< float > &  img,
BIAS::Image< float > &  mark,
double  sigmaThresh,
int  halfwinSize = 1 
)
static

Markes pixels in PMD-Image with a local variance > sigmaThresh.

Eleminates depth noise.

Author
grest

Definition at line 612 of file PMDImageProc.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::ReInit().

PMDImageMetaData PMDImageProc::MetaFromPoseAndK ( const Pose Po,
const KMatrix K,
int  width,
int  height,
int  channels 
)
static
Pose PMDImageProc::PoseFromMeta ( const PMDImageMetaData MetaData)
static
void PMDImageProc::ScaleDepthImage ( Image< float > &  ImgDepth,
double  scaleFactor 
)
static

This function scales the depth image with the given scale factor.

Definition at line 532 of file PMDImageProc.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::PixelValue(), and BIAS::Image< StorageType >::SetPixel().


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