26 #ifndef __CornerDetectorGradient_hh__
27 #define __CornerDetectorGradient_hh__
29 #include "CornerDetectorBase.hh"
30 #include <Filter/StructureTensor.hh>
31 #include <Filter/Gauss.hh>
32 #include <Base/Math/Matrix2x2.hh>
42 class BIASFeatureDetector_EXPORT Feat {
50 Feat& operator=(
const Feat& f)
51 { x=f.x; y=f.y; val=f.val;
return *
this; }
56 inline std::ostream&
operator<<(std::ostream & os,
const Feat& f)
57 { os <<
"("<<f.x<<
", "<<f.y<<
") = "<<f.val;
return os; }
86 template <
class StorageType,
class CalculationType>
110 std::vector<HomgPoint2D>& p,
111 std::vector<QUAL>& quality,
132 std::vector<HomgPoint2D>& p,
133 std::vector<QUAL>& quality,
153 std::vector<HomgPoint2D>& p,
154 std::vector<QUAL>& quality);
161 std::vector<HomgPoint2D> &p,
162 std::vector<QUAL> &quality);
175 {
return _MinDistance; }
181 { _MinDistance = mindist; }
187 {
return _MinCornerness; }
192 { _MinCornerness = min_cornerness; }
196 { _DoRefinement = subpixel_accuracy; }
199 { _st.SetHalfWinSize(halfwinsize); }
202 {
return _Cornerness; }
236 int _EnforceMinimumDistance(std::vector<HomgPoint2D>& p,
237 std::vector<QUAL>& quality);
247 bool _RefineCornerPosition(
int col,
int row,
248 double &x,
double &y, QUAL &SubPixelCornerness);
256 std::vector<QUAL>& quality) {
257 BIASASSERT(pos.size()==quality.size());
258 std::vector<QUAL>::iterator itq = quality.begin();
259 for (std::vector<HomgPoint2D>::iterator itp=pos.begin();
260 itp!=pos.end(); itp++, itq++)
261 _RefineCornerPosition((
int)rint((*itp)[0]), (int)rint((*itp)[1]),
262 (*itp)[0], (*itp)[1], *itq);
266 void _DeleteInternalMem();
269 void _AllocInternalMem(
const int width,
const int height);
273 { memset((
void*)_FeatureMap[0], 0,
274 sizeof(
bool)*_Cornerness.GetWidth()*_Cornerness.GetHeight());
275 _NumberFeaturesSoFar = 0;};
278 void _FillFeatureMap(std::vector<HomgPoint2D>& p);
282 void GetCov_(
const std::vector<HomgPoint2D>& p,
284 const double noise = 5)
const;
319 template class BIASFeatureDetector_EXPORT std::vector<class BIAS::Feat>;
323 #endif // __CornerDetectorGradient_hh__
void SetMinDistance(int mindist)
sets the min distance of features (simple parameter access function - does nothing else) ...
int _MinDistance
minimal distance between points
void SetSubpixelAccuracy(bool subpixel_accuracy)
int GetMinDistance() const
rets the min distance of features (simple parameter access function - does nothing else) ...
Image< CalculationType > _Cornerness
resulting image which tells for each pixel how cornerlike it is
virtual const Image< CalculationType > & GetCornernessImage() const
bool _DoRefinement
tells whether subpixel refinement should be done
virtual void SetStructureTensorHalfWinSize(int halfwinsize)
double GetMinCornerness()
rets minimum cornernes of detectable features (simple parameter access function - does nothing else) ...
double _MinCornerness
threshold to accept a feature
virtual void SetMinCornerness(double min_cornerness)
sets minimum cornernes of detectable features
bool ** _FeatureMap
array used to enforce a min distance / neighbor suppression
std::vector< class Feat > _FeatList
temporary list of detected corners
void _ZeroFeatureMap()
zeros the feature map
The image template class for specific storage types.
Gauss< StorageType, StorageType > _gauss
Gauss for pre-smoothing.
bool operator<(const BIAS::Polynom &p1, const BIAS::Polynom &p2)
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
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...
int _NumberFeaturesSoFar
initialized with the old features provided by user, then counted up and compared against _MaxNumFeatu...
StructureTensor< CalculationType, CalculationType > _st
structure tensor computation object
purly virtual interface defining class for corner detectors
base class for all gradient based corner detectors
Image< CalculationType > _sgyy