Basic Image AlgorithmS Library
2.8.0
|
smoothing with gaussian kernel using a threshold More...
#include <Filter/GaussThreshold.hh>
Public Types | |
enum | TBorderHandling { TBH_full, TBH_same, TBH_valid } |
enum for border calculation, same meanings as in matlab: More... | |
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
bool | CalculationInFloat () const |
decides if calculation is done in integer or floating point More... | |
virtual FilterNToN < InputStorageType, OutputStorageType > * | Clone () const |
void | CopyNonROIFromSource (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) const |
run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source. More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
virtual int | Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
sets gauss kernel if params changed and calls convolution or fast grey implementation if possible More... | |
int | Filter7x7GreyIgnoreBelowThreshold (const Image< InputStorageType > &src, Image< OutputStorageType > &dst, const double thresh) |
7x7 gauss filtering, values below threshold are ignored useful for depth map filtering More... | |
int | Filter7x7GreyOnlyBelowThreshold (const Image< InputStorageType > &src, Image< OutputStorageType > &dst, const double thresh) |
7x7 gauss filtering, values below threshold are ignored and only pixels below threshold are filed More... | |
virtual int | FilterFloat (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
do the convolution using floating point calculations More... | |
virtual int | FilterInt (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
do the convolution using integer arithmetics and shifts More... | |
GaussThreshold () | |
GaussThreshold (const GaussThreshold< InputStorageType, OutputStorageType > &other) | |
int | GetBorderHandling () const |
void | GetBorders (int &border_x, int &border_y) const |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
void | GetKernel (FilterMask &fm) const |
get the current filter mask More... | |
double | GetRatio () const |
double | GetRatio () |
double | GetSigma () const |
double | GetSigma () |
double | GetTreshold () const |
long int | Name2DebugLevel (const std::string &name) const |
looks up a debuglevel in the internal map, returns 0 if not found More... | |
long int | NewDebugLevel (const std::string &name) |
creates a new debuglevel More... | |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
void | PrintKernel () const |
prints the used filter mask, for debugging More... | |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
void | SetBorderHandling (const int bh) |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetHalfWinSize (const int hws, bool AdjustSigma=true) |
define the half win size of the kernel, if AdjustSigma is true sigma is computed according to the cut-off ratio, otherwise the ratio is adapted to the sigma More... | |
void | SetKernel (FilterMask &fm) |
set a new filter mask More... | |
void | SetNonROIToValue (Image< OutputStorageType > &dst, const std::vector< OutputStorageType > &t) const |
run over all pixel which do not belong to the roi and set them to some value (typically black) More... | |
void | SetRatio (const double ratio) |
void | SetSigma (const double si) |
void | SetTreshold (const double th) |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
~GaussThreshold () | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
void | _CalculateKernels (double Sigma, double Ratio) |
calculates the kernel More... | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
int | ConvFloatHori_ (const Image< InputStorageType > &src, Image< CONV_FLOAT > &dst) |
worker function for float separated (horizontal) convolution More... | |
int | ConvFloatMat_ (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
worker function for float matrix convolution More... | |
int | ConvFloatVert_ (const Image< CONV_FLOAT > &src, Image< OutputStorageType > &dst) |
worker function for float separated (vertical) convolution More... | |
int | ConvIntHori_ (const Image< InputStorageType > &src, Image< CONV_INT > &dst) |
worker function for int separated (horizontal) convolution More... | |
int | ConvIntMat_ (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
worker function for int matrix convolution More... | |
int | ConvIntVert_ (const Image< CONV_INT > &src, Image< OutputStorageType > &dst) |
worker function for int separated (vertical) convolution More... | |
void | GetBordersValid_ (int &border_x, int &border_y) const |
Protected Attributes | |
int | _FilterBorderHandling |
FilterMask | _fm |
the kernel data used for convolution More... | |
Gauss< InputStorageType, OutputStorageType > * | _GaussIO |
Gauss< OutputStorageType, OutputStorageType > * | _GaussOO |
to allow for iterated gauss convolution saving the intermediate image we need a different instance, this is caused by template concept More... | |
double | _GaussRatio |
minimum ratio of 1D kernel center and border, ignore smaller entries More... | |
double | _GaussSigma |
the parameter sigma of gaussian kernel More... | |
double | _LastRatio |
double | _LastSigma |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
double | _Threshold |
Image< CONV_FLOAT > | _tmpFloat |
temporary memory, needed for separable filters when float filtering More... | |
Image< CONV_INT > | _tmpInt |
temporary memory, needed for separable filters when integer filtering More... | |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
smoothing with gaussian kernel using a threshold
All pixel values below the trehshold are not concerned for smoothing the image.
Definition at line 42 of file GaussThreshold.hh.
|
inherited |
enum for border calculation, same meanings as in matlab:
Enumerator | |
---|---|
TBH_full | |
TBH_same | |
TBH_valid |
Definition at line 98 of file FilterBase.hh.
GaussThreshold::GaussThreshold | ( | ) |
Definition at line 40 of file GaussThreshold.cpp.
References BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_GaussIO, BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_GaussOO, BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_GaussRatio, BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_GaussSigma, BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_LastRatio, BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_LastSigma, and BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_Threshold.
GaussThreshold::GaussThreshold | ( | const GaussThreshold< InputStorageType, OutputStorageType > & | other | ) |
Definition at line 53 of file GaussThreshold.cpp.
References BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_Threshold.
GaussThreshold::~GaussThreshold | ( | ) |
Definition at line 63 of file GaussThreshold.cpp.
|
protected |
calculates the kernel
Definition at line 94 of file GaussThreshold.cpp.
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
|
inlineinherited |
decides if calculation is done in integer or floating point
Definition at line 103 of file Convolution.hh.
|
inlinevirtualinherited |
Implements BIAS::FilterNToN< InputStorageType, OutputStorageType >.
Reimplemented in BIAS::Gauss< InputStorageType, OutputStorageType >, BIAS::Gauss< float, float >, BIAS::Gauss< InputST, OutputST >, BIAS::Gauss< OutputStorageType, OutputStorageType >, BIAS::Gauss< StorageType, StorageType >, BIAS::Gauss< unsigned char, unsigned char >, BIAS::Binomial< InputStorageType, OutputStorageType >, BIAS::Mean< InputStorageType, OutputStorageType >, and BIAS::Mean< InputST, OutputST >.
Definition at line 88 of file Convolution.hh.
|
inlineprotectedinherited |
|
protectedinherited |
worker function for float separated (horizontal) convolution
Definition at line 290 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsInterleaved(), and BIAS::Vector< T >::Size().
|
protectedinherited |
worker function for float matrix convolution
Definition at line 228 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::Matrix< T >::GetCols(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::Matrix< T >::GetRows(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::IsInterleaved().
|
protectedinherited |
worker function for float separated (vertical) convolution
Definition at line 344 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsInterleaved(), and BIAS::Vector< T >::Size().
|
protectedinherited |
worker function for int separated (horizontal) convolution
Definition at line 115 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsInterleaved(), and BIAS::Vector< T >::Size().
|
protectedinherited |
worker function for int matrix convolution
Definition at line 50 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::Matrix< T >::GetCols(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::Matrix< T >::GetRows(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::IsInterleaved().
|
protectedinherited |
worker function for int separated (vertical) convolution
Definition at line 171 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::IsInterleaved(), and BIAS::Vector< T >::Size().
|
inherited |
run over all pixel which do not belong to the roi and set them to the value in the source image regardless of the roi of the source.
Both images must have same size.
Definition at line 135 of file FilterBase.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), and BIAS::ROI_Corners.
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
|
virtual |
sets gauss kernel if params changed and calls convolution or fast grey implementation if possible
Reimplemented from BIAS::Convolution< InputStorageType, OutputStorageType >.
Definition at line 73 of file GaussThreshold.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::Convolution< InputStorageType, OutputStorageType >::Filter(), BIAS::ImageBase::GetChannelCount(), and BIAS::ImageBase::GetStorageType().
int GaussThreshold::Filter7x7GreyIgnoreBelowThreshold | ( | const Image< InputStorageType > & | src, |
Image< OutputStorageType > & | dst, | ||
const double | thresh | ||
) |
7x7 gauss filtering, values below threshold are ignored useful for depth map filtering
Definition at line 164 of file GaussThreshold.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::IsInterleaved(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ROI::SetCorners(), and BIAS::ImageBase::ST_float.
int GaussThreshold::Filter7x7GreyOnlyBelowThreshold | ( | const Image< InputStorageType > & | src, |
Image< OutputStorageType > & | dst, | ||
const double | thresh | ||
) |
7x7 gauss filtering, values below threshold are ignored and only pixels below threshold are filed
Definition at line 334 of file GaussThreshold.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::ImageBase::IsInterleaved(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ROI::SetCorners(), and BIAS::ImageBase::ST_float.
|
virtualinherited |
do the convolution using floating point calculations
Implements BIAS::FilterNToN< InputStorageType, OutputStorageType >.
Reimplemented in BIAS::Gauss< InputStorageType, OutputStorageType >, BIAS::Gauss< float, float >, BIAS::Gauss< InputST, OutputST >, BIAS::Gauss< OutputStorageType, OutputStorageType >, BIAS::Gauss< StorageType, StorageType >, BIAS::Gauss< unsigned char, unsigned char >, BIAS::Mean< InputStorageType, OutputStorageType >, BIAS::Mean< InputST, OutputST >, and BIAS::Binomial< InputStorageType, OutputStorageType >.
Definition at line 502 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetROICorners(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsInterleaved(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ImageIO::Save(), BIAS::ROI::SetCorners(), and BIAS::ImageBase::ST_float.
Referenced by BIAS::Convolution< InputStorageType, OutputStorageType >::Filter(), and BIAS::Gauss< InputStorageType, OutputStorageType >::FilterFloat().
|
virtualinherited |
do the convolution using integer arithmetics and shifts
Implements BIAS::FilterNToN< InputStorageType, OutputStorageType >.
Reimplemented in BIAS::Gauss< InputStorageType, OutputStorageType >, BIAS::Gauss< float, float >, BIAS::Gauss< InputST, OutputST >, BIAS::Gauss< OutputStorageType, OutputStorageType >, BIAS::Gauss< StorageType, StorageType >, BIAS::Gauss< unsigned char, unsigned char >, BIAS::Binomial< InputStorageType, OutputStorageType >, BIAS::Mean< InputStorageType, OutputStorageType >, and BIAS::Mean< InputST, OutputST >.
Definition at line 444 of file Convolution.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetROICorners(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsInterleaved(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ImageIO::Save(), BIAS::ROI::SetCorners(), and BIAS::ImageBase::SetROICorners().
Referenced by BIAS::Convolution< InputStorageType, OutputStorageType >::Filter(), and BIAS::Gauss< InputStorageType, OutputStorageType >::FilterInt().
|
inlineinherited |
Definition at line 129 of file FilterBase.hh.
|
inherited |
Definition at line 61 of file FilterBase.cpp.
Referenced by BIAS::Rescale< InputStorageType, OutputStorageType >::GetBordersValid_().
|
inlineprotectedvirtualinherited |
Implements BIAS::FilterBase< InputStorageType, OutputStorageType >.
Reimplemented in BIAS::Mean< InputStorageType, OutputStorageType >, and BIAS::Mean< InputST, OutputST >.
Definition at line 143 of file Convolution.hh.
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inlineinherited |
get the current filter mask
Definition at line 92 of file Convolution.hh.
|
inline |
Definition at line 83 of file GaussThreshold.hh.
|
inline |
Definition at line 104 of file GaussThreshold.hh.
|
inline |
Definition at line 79 of file GaussThreshold.hh.
|
inline |
Definition at line 103 of file GaussThreshold.hh.
|
inline |
Definition at line 75 of file GaussThreshold.hh.
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
|
inherited |
prints the used filter mask, for debugging
Definition at line 583 of file Convolution.cpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 127 of file FilterBase.hh.
Referenced by BIAS::PMDImageProc::DenoiseDepthImage(), BIAS::CalibratedPyramid< StorageType >::Downsample_(), BIAS::PMDImageProc::FitDepthTo2DImage(), and BIAS::PMDImageProc::FitDepthTo2DImageFree_().
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
define the half win size of the kernel, if AdjustSigma is true sigma is computed according to the cut-off ratio, otherwise the ratio is adapted to the sigma
Definition at line 88 of file GaussThreshold.hh.
|
inlineinherited |
set a new filter mask
Definition at line 96 of file Convolution.hh.
|
inherited |
run over all pixel which do not belong to the roi and set them to some value (typically black)
Definition at line 84 of file FilterBase.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), and BIAS::ROI_Corners.
|
inline |
Definition at line 81 of file GaussThreshold.hh.
|
inline |
Definition at line 77 of file GaussThreshold.hh.
|
inline |
Definition at line 73 of file GaussThreshold.hh.
|
inlineinherited |
|
protectedinherited |
Definition at line 132 of file FilterBase.hh.
Referenced by BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase().
|
protectedinherited |
the kernel data used for convolution
Definition at line 107 of file Convolution.hh.
Referenced by BIAS::Convolution< InputStorageType, OutputStorageType >::Convolution().
|
protected |
Definition at line 129 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protected |
to allow for iterated gauss convolution saving the intermediate image we need a different instance, this is caused by template concept
Definition at line 128 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protected |
minimum ratio of 1D kernel center and border, ignore smaller entries
Definition at line 112 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protected |
the parameter sigma of gaussian kernel
Definition at line 104 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protected |
Definition at line 115 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protected |
Definition at line 115 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
Definition at line 117 of file GaussThreshold.hh.
Referenced by BIAS::GaussThreshold< InputStorageType, OutputStorageType >::GaussThreshold().
|
protectedinherited |
temporary memory, needed for separable filters when float filtering
Definition at line 114 of file Convolution.hh.
|
protectedinherited |
temporary memory, needed for separable filters when integer filtering
Definition at line 117 of file Convolution.hh.
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |