Basic Image AlgorithmS Library
2.8.0
|
simple gradient calculation gx(x,y) = I(x+1,y) - I(x-1,y) gy(x,y) = I(x,y+1) - I(x,y-1) More...
#include <Filter/GradientSimple.hh>
Public Types | |
enum | EVecLengthType { VLT_L1, VLT_L2, VLT_max } |
algorithm used to calculate the absolute length of the 2D vector More... | |
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) |
virtual FilterNTo2N < 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 > &grad) |
returns a 2 channel image containing gx and gy More... | |
virtual int | Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &gx, Image< OutputStorageType > &gy) |
dstX.GetChannelCount()==src.GetCHannelCount() More... | |
virtual int | Filter (const Image< InputStorageType > &src, Image< OutputStorageType > &gx, Image< OutputStorageType > &gy, Image< OutputStorageType > &absg) |
virtual int | FilterFloat (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
virtual int | FilterFloat (const Image< InputStorageType > &src, Image< OutputStorageType > &dst1, Image< OutputStorageType > &dst2) |
virtual int | FilterInt (const Image< InputStorageType > &src, Image< OutputStorageType > &dst) |
virtual int | FilterInt (const Image< InputStorageType > &src, Image< OutputStorageType > &dst1, Image< OutputStorageType > &dst2) |
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 |
GradientSimple (bool BuildPCM=false) | |
GradientSimple (const GradientSimple< InputStorageType, OutputStorageType > &other) | |
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 | PolarTransform (Image< OutputStorageType > &gx, Image< OutputStorageType > &gy, Image< float > &magnitude, Image< float > &phase) |
template<> | |
void | PolarTransform (Image< char > &gx, Image< char > &gy, Image< float > &magnitude, Image< float > &phase) |
void | PrintDebugLevel (std::ostream &os=std::cout) const |
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 | 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 | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
void | UseDirectNeighbors (bool UseDirectNeighbors) |
if true, we use a filter of [1 -1] otherwise [1 0 -1] More... | |
int | VecLen (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length) |
decides which vector length to use from *_VecLenthType More... | |
int | VecLenL1 (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length) |
length = | fabs(gx) + fabs(gy) | destination absg must be initialized More... | |
int | VecLenL2 (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length) |
length = sqrt(gx*gx+gy*gy) destination absg must be initialized More... | |
int | VecLenMax (const Image< OutputStorageType > &gx, const Image< OutputStorageType > &gy, Image< OutputStorageType > &length) |
length = max(fabs(gx),fabs(gy)) destination absg must be initialized More... | |
virtual | ~GradientSimple () |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
void | BuildPolarCoordinateMap_ () |
set up pRadius and pAngle for polar coordinate transformation More... | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
int | DirectNeighborsGreyValidFloat_ (const Image< InputStorageType > &src, Image< OutputStorageType > &gWE, Image< OutputStorageType > &gNS) |
loop unrolled fast float version [1 -1] More... | |
int | DirectNeighborsGreyValidInt_ (const Image< InputStorageType > &src, Image< OutputStorageType > &gWE, Image< OutputStorageType > &gNS) |
loop unrolled fast int version [1 -1] More... | |
virtual void | GetBordersValid_ (int &border_x, int &border_y) const |
void | InitKernel_ () |
sets the sobel kernel for the convolution object More... | |
int | SimpleGreyValidFloat_ (const Image< InputStorageType > &src, Image< OutputStorageType > &gWE, Image< OutputStorageType > &gNS) |
loop unrolled fast float version for [1 0 -1] More... | |
int | SimpleGreyValidInt_ (const Image< InputStorageType > &src, Image< OutputStorageType > &gWE, Image< OutputStorageType > &gNS) |
loop unrolled fast int version [1 0 -1] More... | |
Protected Attributes | |
Convolution< InputStorageType, OutputStorageType > | _Conv |
computation object to execute the convolution More... | |
int | _FilterBorderHandling |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::map< std::string, long int > | _String2Debuglevel |
int | _VecLengthType |
of type Gradient<InputStorageType, OutputStorageType>::EVecLengthType More... | |
float ** | pAngle_ |
float ** | pRadius_ |
polar coordinate transformation for char values More... | |
bool | useDirectNeighbors_ |
if true, we use a filter of [-1 1] otherwise [-1 0 1] More... | |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
simple gradient calculation gx(x,y) = I(x+1,y) - I(x-1,y) gy(x,y) = I(x,y+1) - I(x,y-1)
weights (not filter mask, ->reflection!) are
The main interface Filter dispatches: If there is a fast version, it is called, otherwise Filter calls the generic convolution.
Definition at line 52 of file GradientSimple.hh.
|
inherited |
algorithm used to calculate the absolute length of the 2D vector
Enumerator | |
---|---|
VLT_L1 | |
VLT_L2 | |
VLT_max |
Definition at line 52 of file FilterNTo2N.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.
BIAS::GradientSimple< InputStorageType, OutputStorageType >::GradientSimple | ( | bool | BuildPCM = false | ) |
Definition at line 64 of file GradientSimple.cpp.
References BIAS::GradientSimple< InputStorageType, OutputStorageType >::BuildPolarCoordinateMap_(), and BIAS::GradientSimple< InputStorageType, OutputStorageType >::InitKernel_().
BIAS::GradientSimple< InputStorageType, OutputStorageType >::GradientSimple | ( | const GradientSimple< InputStorageType, OutputStorageType > & | other | ) |
Definition at line 74 of file GradientSimple.cpp.
References BIAS::GradientSimple< InputStorageType, OutputStorageType >::InitKernel_().
|
virtual |
Definition at line 83 of file GradientSimple.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 |
|
protected |
set up pRadius and pAngle for polar coordinate transformation
Definition at line 420 of file GradientSimple.cpp.
Referenced by BIAS::GradientSimple< InputStorageType, OutputStorageType >::GradientSimple().
|
inlinevirtual |
Implements BIAS::FilterNTo2N< InputStorageType, OutputStorageType >.
Definition at line 74 of file GradientSimple.hh.
|
inlineprotectedinherited |
|
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 |
|
protected |
loop unrolled fast float version [1 -1]
Definition at line 294 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::SamePixelAndChannelCount(), and BIAS::ROI::SetCorners().
|
protected |
loop unrolled fast int version [1 -1]
Definition at line 351 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::SamePixelAndChannelCount(), and BIAS::ROI::SetCorners().
|
virtual |
returns a 2 channel image containing gx and gy
Reimplemented from BIAS::FilterNTo2N< InputStorageType, OutputStorageType >.
Definition at line 104 of file GradientSimple.cpp.
References BIAS::Image< StorageType >::AppendChannel().
Referenced by BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::Disp2Depth().
|
virtual |
dstX.GetChannelCount()==src.GetCHannelCount()
Reimplemented from BIAS::FilterNTo2N< InputStorageType, OutputStorageType >.
Definition at line 115 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::Image< StorageType >::Release(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
virtual |
Definition at line 151 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
virtualinherited |
Definition at line 74 of file FilterNTo2N.cpp.
|
virtualinherited |
Definition at line 100 of file FilterNTo2N.cpp.
|
virtualinherited |
Definition at line 66 of file FilterNTo2N.cpp.
|
virtualinherited |
Definition at line 91 of file FilterNTo2N.cpp.
|
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_().
|
protectedvirtual |
Implements BIAS::FilterBase< InputStorageType, OutputStorageType >.
Definition at line 504 of file GradientSimple.cpp.
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
protected |
sets the sobel kernel for the convolution object
Definition at line 41 of file GradientSimple.cpp.
References BIAS::FilterMask::CreateFloatFilter().
Referenced by BIAS::GradientSimple< InputStorageType, OutputStorageType >::GradientSimple().
|
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().
void BIAS::GradientSimple< InputStorageType, OutputStorageType >::PolarTransform | ( | Image< OutputStorageType > & | gx, |
Image< OutputStorageType > & | gy, | ||
Image< float > & | magnitude, | ||
Image< float > & | phase | ||
) |
Definition at line 471 of file GradientSimple.cpp.
References BIAS::ROI::GetCorners(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetPixelCount(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), BIAS::ImageBase::SamePixelAndChannelCount(), and BIAS::ROI::SetCorners().
void BIAS::GradientSimple< unsigned char, char >::PolarTransform | ( | Image< char > & | gx, |
Image< char > & | gy, | ||
Image< float > & | magnitude, | ||
Image< float > & | phase | ||
) |
Definition at line 448 of file GradientSimple.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetPixelCount(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
inlineinherited |
|
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 |
|
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.
|
inlineinherited |
|
protected |
loop unrolled fast float version for [1 0 -1]
Definition at line 174 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::SamePixelAndChannelCount(), and BIAS::ROI::SetCorners().
|
protected |
loop unrolled fast int version [1 0 -1]
Definition at line 232 of file GradientSimple.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetROI(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::SamePixelAndChannelCount(), and BIAS::ROI::SetCorners().
|
inline |
if true, we use a filter of [1 -1] otherwise [1 0 -1]
If true we get a better spatial resolution of gradients, however, the result is shifted by 0.5;0.5 pixels. Take care of noise in your input data.
Definition at line 89 of file GradientSimple.hh.
|
inherited |
decides which vector length to use from *_VecLenthType
Definition at line 114 of file FilterNTo2N.cpp.
|
inherited |
length = | fabs(gx) + fabs(gy) | destination absg must be initialized
Definition at line 140 of file FilterNTo2N.cpp.
References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().
|
inherited |
length = sqrt(gx*gx+gy*gy) destination absg must be initialized
Definition at line 172 of file FilterNTo2N.cpp.
References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().
|
inherited |
length = max(fabs(gx),fabs(gy)) destination absg must be initialized
Definition at line 205 of file FilterNTo2N.cpp.
References BIAS::ROI::GetCorners(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), and BIAS::ROI::SetCorners().
|
protected |
computation object to execute the convolution
Definition at line 106 of file GradientSimple.hh.
|
protectedinherited |
Definition at line 132 of file FilterBase.hh.
Referenced by BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase().
|
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=().
|
protectedinherited |
of type Gradient<InputStorageType, OutputStorageType>::EVecLengthType
Definition at line 107 of file FilterNTo2N.hh.
Referenced by BIAS::FilterNTo2N< InputStorageType, OutputStorageType >::FilterNTo2N().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
|
protected |
Definition at line 131 of file GradientSimple.hh.
|
protected |
polar coordinate transformation for char values
Definition at line 131 of file GradientSimple.hh.
|
protected |
if true, we use a filter of [-1 1] otherwise [-1 0 1]
Definition at line 134 of file GradientSimple.hh.