25 #include "CornerDetectorFoerstner.hh"
34 template <
class StorageType,
class CalculationType>
42 template <
class StorageType,
class CalculationType>
48 template <
class StorageType,
class CalculationType>
int
53 int tlx, tly, brx, bry;
54 this->_sgxx.GetROI()->GetCorners(tlx, tly, brx, bry);
57 const unsigned int width=Cornerness.
GetWidth();
58 const unsigned int height=Cornerness.
GetHeight();
61 CalculationType *psgxx=this->_sgxx.GetImageData(),
62 *psgyy=this->_sgyy.GetImageData(),
63 *psgxy=this->_sgxy.GetImageData();
64 CalculationType *ptr, *end, tmp;
72 unsigned offs = 2*width+2;
79 const double me=(double)this->_MinCornerness;
81 this->_FeatList.clear();
82 this->_FeatList.reserve(end-ptr);
86 const CalculationType xx = (CalculationType) *psgxx++;
87 const CalculationType xy = (CalculationType) *psgxy++;
88 const CalculationType yy = (CalculationType) *psgyy++;
91 tmp = xx*yy-xy*xy / (xx+yy);
96 if (tmp*(CalculationType)4.0/(xx+yy)>me){
99 fp.val=(tmp>(double)INT_MAX)?(INT_MAX):((
int)tmp);
100 this->_FeatList.push_back(fp);
120 #ifdef BUILD_IMAGE_INT
123 #ifdef BUILD_IMAGE_CHAR
126 #ifdef BUILD_IMAGE_SHORT
128 #ifdef BUILD_IMAGE_USHORT
130 #ifdef BUILD_IMAGE_INT
134 #ifdef BUILD_IMAGE_UINT
136 #ifdef BUILD_IMAGE_DOUBLE
int SetCorners(unsigned UpperLeftX, unsigned UpperLeftY, unsigned LowerRightX, unsigned LowerRightY)
Sets a rectangular region of interest.
unsigned int GetWidth() const
foerstner corner detector, detects grey value corners in images
virtual int _ComputeCornerness(Image< CalculationType > &im)
Computes the Foerstner cornerness criterion det/trace, points are accepted only if corner-ellipse is ...
ROI * GetROI()
Returns a pointer to the roi object.
unsigned int GetHeight() const
const StorageType * GetImageData() const
overloaded GetImageData() from ImageBase
base class for all gradient based corner detectors
~CornerDetectorFoerstner()