Basic Image AlgorithmS Library
2.8.0
|
#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... | |
Definition at line 41 of file PMDImageProc.hh.
|
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().
|
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"
Definition at line 544 of file PMDImageProc.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), and BIAS::Image< StorageType >::PixelValue().
Referenced by AddNoiseToDepthImage().
|
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).
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). |
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().
|
static |
Deletes (sets to 0) pixels in PMD-Image with a local variance > sigmaThresh.
Eleminates depth noise.
Definition at line 581 of file PMDImageProc.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), and BIAS::ImageBase::GetWidth().
|
static |
This function denoises a PMD-Depth image by Median and variance filtering.
Sets noise pixels to zero.
Definition at line 498 of file PMDImageProc.cpp.
References BIAS::Median< InputStorageType, OutputStorageType >::Filter(), BIAS::FilterBase< InputStorageType, OutputStorageType >::SetBorderHandling(), and BIAS::Median< InputStorageType, OutputStorageType >::SetSize().
|
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
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 |
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().
|
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
ImgDepth | is the image to convert. This image has to contain depth information and is changed in size and contents. |
MetaData2D | this is the metadata for the 2D-image. |
MetaDataDepth | the metadata for the depth image. Is adapted to reflect the image transformation. |
Definition at line 131 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, and BIAS::Equal().
|
static |
Definition at line 42 of file PMDImageProc.cpp.
References BIAS::Dilation< InputStorageType, OutputStorageType >::Filter(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ProjectionParametersBase::GetImageSize(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::Vector3< T >::NormL2(), BIAS::Projection::Project(), BIAS::FilterBase< InputStorageType, OutputStorageType >::SetBorderHandling(), BIAS::Morphology< InputStorageType, OutputStorageType >::SetKernelSize(), BIAS::ImageBase::SetZero(), and BIAS::Projection::UnProjectToPoint().
|
staticprotected |
Definition at line 211 of file PMDImageProc.cpp.
References BIAS::Projection::CreatePerspective(), BIAS::DISTYPE_DEF, BIAS::Dilation< InputStorageType, OutputStorageType >::Filter(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::PMDImageMetaData::height, BIAS::Image< StorageType >::Init(), KFromMeta(), BIAS::Vector3< T >::NormL2(), BIAS::Image< StorageType >::PixelValue(), PoseFromMeta(), BIAS::Projection::Project(), BIAS::FilterBase< InputStorageType, OutputStorageType >::SetBorderHandling(), BIAS::Morphology< InputStorageType, OutputStorageType >::SetKernelSize(), BIAS::Image< StorageType >::SetPixel(), BIAS::ImageBase::SetZero(), BIAS::PMDImageMetaData::UndistCoeff, BIAS::Projection::UnProjectToPoint(), and BIAS::PMDImageMetaData::width.
|
staticprotected |
Definition at line 303 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::height, BIAS::Matrix3x3< T >::IsIdentity(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map(), BIAS::HomographyMapping< InputStorageType, OutputStorageType >::SetHomography(), and BIAS::PMDImageMetaData::width.
|
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.
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.
|
static |
Definition at line 161 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, and BIAS::Equal().
|
staticprotected |
Create a H-Matrix that converts the depth image to the 2D view.
Definition at line 358 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, BIAS::Equal(), BIAS::KMatrix::Invert(), BIAS::MatrixIdentity, BIAS::RMatrixBase::SetFromAxisAngle(), and BIAS::Matrix3x3< T >::Transpose().
|
static |
Definition at line 387 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::AspectRatio, BIAS::PMDImageMetaData::FocallengthX, BIAS::PMDImageMetaData::PrincipalX, BIAS::PMDImageMetaData::PrincipalY, and BIAS::Matrix3x3< T >::SetIdentity().
Referenced by FitDepthTo2DImageFree_(), and BIAS::VideoSource_DiskPMD::GrabSingle().
|
static |
use to limit the depth spread to a certain range around the
Definition at line 446 of file PMDImageProc.cpp.
References BIAS::Histogram1D< T >::AddData(), BIAS::Histogram1D< T >::GetBinCenterWithMaxEntries(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::Histogram1D< T >::SetHistogramBoundaries(), and BIAS::Histogram1D< T >::SetNumBins().
|
static |
Markes pixels in PMD-Image with a local variance > sigmaThresh.
Eleminates depth noise.
Definition at line 612 of file PMDImageProc.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::ReInit().
|
static |
Definition at line 410 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::AspectRatio, BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, BIAS::PMDImageMetaData::channels, BIAS::PMDImageMetaData::FocallengthX, BIAS::Quaternion< T >::GetAxisAngle(), BIAS::CoordinateTransform3D::GetC(), BIAS::CoordinateTransform3D::GetQ(), BIAS::PMDImageMetaData::height, BIAS::Vector3< T >::Normalize(), BIAS::PMDImageMetaData::PrincipalX, BIAS::PMDImageMetaData::PrincipalY, BIAS::PMDImageMetaData::UndistCoeff, and BIAS::PMDImageMetaData::width.
|
static |
Definition at line 398 of file PMDImageProc.cpp.
References BIAS::PMDImageMetaData::CameraCenter, BIAS::PMDImageMetaData::CameraRotation, BIAS::RMatrixBase::GetQuaternion(), BIAS::Pose::SetC(), BIAS::RMatrixBase::SetFromAxisAngle(), and BIAS::Pose::SetQ().
Referenced by FitDepthTo2DImageFree_(), and BIAS::VideoSource_DiskPMD::GrabSingle().
|
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().