Basic Image AlgorithmS Library
2.8.0
|
base class for all gradient based corner detectors More...
#include <FeatureDetector/CornerDetectorGradient.hh>
Public Types | |
enum | ECDType { CDT_Invalid, CDT_Susan, CDT_Harris, CDT_Foerstner, CDT_KLT, CDT_Laplace } |
the differnet types of corner detectors More... | |
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
CornerDetectorGradient () | |
virtual int | Cornerness (const Image< CalculationType > &gradx, const Image< CalculationType > &grady, Image< CalculationType > &cornerness) |
calculates the cornerness using the gradients gx and gy More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
virtual int | Detect (const Image< StorageType > &image, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality) |
purely virtual interface definition More... | |
virtual int | Detect (const Image< StorageType > &image, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality, std::vector< Matrix2x2< double > > *cov=NULL) |
detect corners in a grey image More... | |
virtual int | Detect (const Image< CalculationType > &gradx, const Image< CalculationType > &grady, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality, std::vector< Matrix2x2< double > > *cov=NULL) |
detect corners given the gradient images More... | |
virtual int | DetectFromCornerness (const Image< CalculationType > &cornerness, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality) |
detect corners avoiding double calculation of cornerness image More... | |
virtual int | DetectFromCornerness (const Image< CalculationType > &cornerness, const std::vector< Vector2< int > > ®ion, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality) |
detect corners avoiding double calculation of cornerness image More... | |
virtual const Image < CalculationType > & | GetCornernessImage () const |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
int | GetMaxNumFeatures () |
double | GetMinCornerness () |
rets minimum cornernes of detectable features (simple parameter access function - does nothing else) More... | |
int | GetMinDistance () const |
rets the min distance of features (simple parameter access function - does nothing else) More... | |
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 | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetMaxNumFeatures (const int maxnum) |
virtual void | SetMinCornerness (double min_cornerness) |
sets minimum cornernes of detectable features More... | |
void | SetMinDistance (int mindist) |
sets the min distance of features (simple parameter access function - does nothing else) More... | |
virtual void | SetStructureTensorHalfWinSize (int halfwinsize) |
void | SetSubpixelAccuracy (bool subpixel_accuracy) |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
virtual | ~CornerDetectorGradient () |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
void | _AllocInternalMem (const int width, const int height) |
allocates _Cornerness , _sgxx, _sgxy and _sgyy More... | |
int | _CalcCornerness (const Image< StorageType > &src, Image< CalculationType > &cornerness) |
calculates the cornerness using the src image More... | |
int | _CalcCornerness (const Image< CalculationType > &gradx, const Image< CalculationType > &grady, Image< CalculationType > &cornerness) |
calculates the cornerness using the gradients gx and gy More... | |
virtual int | _ComputeCornerness (Image< CalculationType > &Cornerness) |
the main function which should be overwritten in derived classes, no implementation in this class More... | |
void | _DeleteInternalMem () |
frees _Cornerness, _sgxx, _sgxy and _sgyy More... | |
int | _EnforceMinimumDistance (std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality) |
selects features sorted by quality from _FeatList such that they have a min distance as given in the param object More... | |
void | _ExtractLocalMaxima (const Image< CalculationType > &Cornerness) |
extracts the local maxima checking a 3x3 region into _FeatList More... | |
void | _FillFeatureMap (std::vector< HomgPoint2D > &p) |
fills feature map with every point from p which isnt at infinity More... | |
bool | _RefineCornerPosition (int col, int row, double &x, double &y, QUAL &SubPixelCornerness) |
fit quadratic surface around (row;col) to find the maximum cornerness subpixel position and save it in x;y More... | |
void | _RefineCorners (std::vector< HomgPoint2D > &pos, std::vector< QUAL > &quality) |
refines corner position and quality for all corners in list, internal Cornerness_ image must be valid More... | |
void | _ZeroFeatureMap () |
zeros the feature map More... | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel More... | |
void | GetCov_ (const std::vector< HomgPoint2D > &p, std::vector< Matrix2x2< double > > &cov, const double noise=5) const |
returns the inverse structure tensor, multiplied by noise^2 More... | |
Protected Attributes | |
Image< CalculationType > | _Cornerness |
resulting image which tells for each pixel how cornerlike it is More... | |
bool | _DoRefinement |
tells whether subpixel refinement should be done More... | |
std::vector< class Feat > | _FeatList |
temporary list of detected corners More... | |
bool ** | _FeatureMap |
array used to enforce a min distance / neighbor suppression More... | |
Gauss< StorageType, StorageType > | _gauss |
Gauss for pre-smoothing. More... | |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
int | _MaxNum |
maximum number of corners to return More... | |
double | _MinCornerness |
threshold to accept a feature More... | |
int | _MinDistance |
minimal distance between points More... | |
int | _NumberFeaturesSoFar |
initialized with the old features provided by user, then counted up and compared against _MaxNumFeatures from Base class More... | |
int | _NumTilesX |
int | _NumTilesY |
Image< CalculationType > | _sgxx |
internal structure tensor images More... | |
Image< CalculationType > | _sgxy |
Image< CalculationType > | _sgyy |
StructureTensor < CalculationType, CalculationType > | _st |
structure tensor computation object More... | |
std::map< std::string, long int > | _String2Debuglevel |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
base class for all gradient based corner detectors
provides functionality to compute the structure tensor | gxx gxy | | gyx gyy |
The function detect low pass filters the image, computes gradients and the structure tensor and then calls _ComputeCornerness on the structure tensor image. This function must be implemented in derived classes, it basically converts the 2x2 structure tensor to a scalar value which describes how much cornerlike the region around that pixel is, which is saved in the cornerness image. Values above a threshold are pushed into an internal list. Afterwards the EnforceMinimumDistance function is called to sort features by quality and add them to the final list. New points are accepted only if the have a minimum distance to all previously extracted points. In the detect function you may pass a non-empty vector of points, which are regarded as "existing corners" and none of the new points may lie withing the critical distance around the old ones. This gives the possibility to detect new features for a tracker, which has tracked some points (where no new features are desired) and lost some features.
Definition at line 87 of file CornerDetectorGradient.hh.
|
inherited |
the differnet types of corner detectors
Enumerator | |
---|---|
CDT_Invalid | |
CDT_Susan | |
CDT_Harris | |
CDT_Foerstner | |
CDT_KLT | |
CDT_Laplace |
Definition at line 57 of file CornerDetectorBase.hh.
CornerDetectorGradient::CornerDetectorGradient | ( | ) |
Definition at line 53 of file CornerDetectorGradient.cpp.
References BIAS::CornerDetectorGradient< StorageType, CalculationType >::_DoRefinement, BIAS::CornerDetectorGradient< StorageType, CalculationType >::_FeatureMap, BIAS::CornerDetectorGradient< StorageType, CalculationType >::_MinCornerness, and BIAS::CornerDetectorGradient< StorageType, CalculationType >::_MinDistance.
|
virtual |
Definition at line 64 of file CornerDetectorGradient.cpp.
|
protected |
allocates _Cornerness , _sgxx, _sgxy and _sgyy
Definition at line 627 of file CornerDetectorGradient.cpp.
|
protected |
calculates the cornerness using the src image
Definition at line 645 of file CornerDetectorGradient.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), and BIAS::ImageIO::Save().
|
protected |
calculates the cornerness using the gradients gx and gy
Definition at line 687 of file CornerDetectorGradient.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
protectedvirtual |
the main function which should be overwritten in derived classes, no implementation in this class
computes the cornerness from the structure tensor image Uses structure tensor sgxx, _sgxy, _sgyy as input
Reimplemented in BIAS::CornerDetectorHarris< StorageType, CalculationType >, BIAS::CornerDetectorKLT< StorageType, CalculationType >, BIAS::CornerDetectorFoerstner< StorageType, CalculationType >, and BIAS::LinearRegionDetector< StorageType, CalculationType >.
Definition at line 577 of file CornerDetectorGradient.cpp.
|
protected |
frees _Cornerness, _sgxx, _sgxy and _sgyy
Definition at line 615 of file CornerDetectorGradient.cpp.
|
protected |
selects features sorted by quality from _FeatList such that they have a min distance as given in the param object
assumes feature map is zeroed
Definition at line 373 of file CornerDetectorGradient.cpp.
References BIAS::TimeMeasure::GetRealTime(), BIAS::TimeMeasure::Reset(), BIAS::HomgPoint2D::Set(), BIAS::TimeMeasure::Start(), and BIAS::TimeMeasure::Stop().
|
protected |
extracts the local maxima checking a 3x3 region into _FeatList
Definition at line 708 of file CornerDetectorGradient.cpp.
References BIAS::ROI::GetCorners(), BIAS::ROI::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetROI(), BIAS::ROI::GetROIType(), BIAS::ROI::GetWidth(), BIAS::ROI::IsInROI(), BIAS::ROI_Corners, BIAS::ROI_Mask, BIAS::ROI_Points, and BIAS::ROI_Rows.
|
protected |
fills feature map with every point from p which isnt at infinity
Definition at line 585 of file CornerDetectorGradient.cpp.
|
protected |
fit quadratic surface around (row;col) to find the maximum cornerness subpixel position and save it in x;y
col | column in image where refinement should take place |
row | row in image where refinement should take place |
x | output, refined coordinate |
y | output, refined coordinate |
SubPixelCornerness | cornerness value at subpixel maximum |
Definition at line 469 of file CornerDetectorGradient.cpp.
|
inlineprotected |
refines corner position and quality for all corners in list, internal Cornerness_ image must be valid
pos | input/output of old/new position |
quality | holds new cornernesses afterwards |
Definition at line 255 of file CornerDetectorGradient.hh.
|
inlineprotected |
zeros the feature map
Definition at line 272 of file CornerDetectorGradient.hh.
|
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 |
|
inlineprotectedinherited |
|
virtual |
calculates the cornerness using the gradients gx and gy
Definition at line 274 of file CornerDetectorGradient.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), and BIAS::ImageBase::SamePixelAndChannelCount().
|
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 |
|
virtualinherited |
purely virtual interface definition
Reimplemented in BIAS::CornerDetectorSusan< StorageType >.
Definition at line 53 of file CornerDetectorBase.cpp.
|
virtual |
detect corners in a grey image
see documentation of BIAS::CornerDetectorGradient class for more info
image | grey value input image |
p | all points in p not lying at infinity (p[i][2]!=0) are assumed to be corners of very good quality, in the region around these points no new features are detected, leave empty if you just want to detect some features in the image In any case p is cleared and only new detected points are added before returning. Example: assume MaxNum=100, you pass a vector p with 40 points of which 12 have the third coordinate w=0. You will get back a vector of maximum size 72, it may be smaller if Distance and MinCornerness have too large values |
quality | after returning, for each point in p there is a quality in quality, no input requirements |
Definition at line 71 of file CornerDetectorGradient.cpp.
References BIAS::ImageConvert::ConvertST(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), and BIAS::ImageIO::Save().
|
virtual |
detect corners given the gradient images
see documentation of BIAS::CornerDetectorGradient class for more info
gradx | image containing gradient x component |
grady | image containing gradient y component |
p | all points in p not lying at infinity (p[i][2]!=0) are assumed to be corners of very good quality, in the region around these points no new features are detected, leave empty if you just want to detect some features in the image. In any case p is cleared and only new detected points are added before returning. Example: assume MaxNum=100, you pass a vector p with 40 points of which 12 have the third coordinate w=0. You will get back a vector of maximum size 72, it may be smaller if Distance and MinCornerness have too large values |
quality | after returning, for each point in p there is a quality in quality, no input requirements |
Definition at line 179 of file CornerDetectorGradient.cpp.
References BIAS::TimeMeasure::GetRealTime(), BIAS::TimeMeasure::Reset(), BIAS::ImageBase::SamePixelAndChannelCount(), BIAS::ImageIO::Save(), BIAS::TimeMeasure::Start(), and BIAS::TimeMeasure::Stop().
|
virtual |
detect corners avoiding double calculation of cornerness image
see documentation of BIAS::CornerDetectorGradient class for more info
cornerness | image with already computed cornerness |
p | all points in p not lying at infinity (p[i][2]!=0) are assumed to be corners of very good quality, in the region around these points no new features are detected, leave empty if you just want to detect some features in the image In any case p is cleared and only new detected points are added before returning. Example: assume MaxNum=100, you pass a vector p with 40 points of which 12 have the third coordinate w=0. You will get back a vector of maximum size 72, it may be smaller if Distance and MinCornerness have too large values |
quality | after returning, for each point in p there is a quality in quality, no input requirements |
Definition at line 301 of file CornerDetectorGradient.cpp.
|
virtual |
detect corners avoiding double calculation of cornerness image
Definition at line 321 of file CornerDetectorGradient.cpp.
References BIAS::Image< StorageType >::GetImageDataArray().
|
inlinevirtual |
Definition at line 201 of file CornerDetectorGradient.hh.
|
protected |
returns the inverse structure tensor, multiplied by noise^2
Definition at line 137 of file CornerDetectorGradient.cpp.
References BIAS::Matrix2x2< T >::Invert().
|
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 |
Definition at line 73 of file CornerDetectorBase.hh.
|
inline |
rets minimum cornernes of detectable features (simple parameter access function - does nothing else)
Definition at line 186 of file CornerDetectorGradient.hh.
|
inline |
rets the min distance of features (simple parameter access function - does nothing else)
Definition at line 174 of file CornerDetectorGradient.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 |
|
inlineinherited |
|
inlineinherited |
|
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 |
|
inlineinherited |
Definition at line 70 of file CornerDetectorBase.hh.
|
inlinevirtual |
sets minimum cornernes of detectable features
Definition at line 191 of file CornerDetectorGradient.hh.
|
inline |
sets the min distance of features (simple parameter access function - does nothing else)
Definition at line 180 of file CornerDetectorGradient.hh.
|
inlinevirtual |
Definition at line 198 of file CornerDetectorGradient.hh.
|
inline |
Definition at line 195 of file CornerDetectorGradient.hh.
|
inlineinherited |
|
protected |
resulting image which tells for each pixel how cornerlike it is
Definition at line 293 of file CornerDetectorGradient.hh.
|
protected |
tells whether subpixel refinement should be done
Definition at line 311 of file CornerDetectorGradient.hh.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::CornerDetectorGradient().
|
protected |
temporary list of detected corners
Definition at line 299 of file CornerDetectorGradient.hh.
|
protected |
array used to enforce a min distance / neighbor suppression
Definition at line 296 of file CornerDetectorGradient.hh.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::CornerDetectorGradient().
|
protected |
Gauss for pre-smoothing.
Definition at line 302 of file CornerDetectorGradient.hh.
|
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 |
maximum number of corners to return
Definition at line 81 of file CornerDetectorBase.hh.
Referenced by BIAS::CornerDetectorSusan< StorageType >::CornerDetectorSusan().
|
protected |
threshold to accept a feature
Definition at line 310 of file CornerDetectorGradient.hh.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::CornerDetectorGradient().
|
protected |
minimal distance between points
Definition at line 309 of file CornerDetectorGradient.hh.
Referenced by BIAS::CornerDetectorGradient< StorageType, CalculationType >::CornerDetectorGradient().
|
protected |
initialized with the old features provided by user, then counted up and compared against _MaxNumFeatures from Base class
Definition at line 306 of file CornerDetectorGradient.hh.
|
protectedinherited |
Definition at line 78 of file CornerDetectorBase.hh.
|
protectedinherited |
Definition at line 78 of file CornerDetectorBase.hh.
|
protected |
internal structure tensor images
Definition at line 290 of file CornerDetectorGradient.hh.
|
protected |
Definition at line 290 of file CornerDetectorGradient.hh.
|
protected |
Definition at line 290 of file CornerDetectorGradient.hh.
|
protected |
structure tensor computation object
Definition at line 287 of file CornerDetectorGradient.hh.
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |