25 #include "CornerDetectorKLT.hh"
26 #include <Base/Image/ImageConvert.hh>
28 #include <Base/Image/ImageIO.hh>
33 #include <Base/Debug/TimeMeasure.hh>
46 template <
class StorageType,
class CalculationType>
54 template <
class StorageType,
class CalculationType>
65 template <
class StorageType,
class CalculationType>
71 BIASASSERT(this->_sgxx.NotBiggerPixelAndSameChannelCount(this->_Cornerness));
74 int tlx, tly, brx, bry;
75 this->_sgxx.GetROI()->GetCorners(tlx, tly, brx, bry);
83 register double gxx, gyy, gxy, ev;
85 register CalculationType **isgxx=this->_sgxx.GetImageDataArray();
86 register CalculationType **isgxy=this->_sgxy.GetImageDataArray();
87 register CalculationType **isgyy=this->_sgyy.GetImageDataArray();
90 for (y=miny; y<maxy; y++){
91 for (x=minx; x<maxx; x++){
92 gxx=(double)(isgxx[y][x]);
93 gyy=(double)isgyy[y][x];
94 gxy=(double)isgxy[y][x];
95 ev=((gxx+gyy- sqrt((gxx - gyy)*(gxx - gyy)+4.0*gxy*gxy))/2.0);
97 ime[y][x] = (CalculationType)(ev);
100 this->_ExtractLocalMaxima(mineig);
103 if (this->DebugLevelIsSet(D_CD_WRITE_DEBUG_IM)){
119 #ifdef BUILD_IMAGE_INT
122 #ifdef BUILD_IMAGE_CHAR
125 #ifdef BUILD_IMAGE_SHORT
127 #ifdef BUILD_IMAGE_USHORT
129 #ifdef BUILD_IMAGE_INT
133 #ifdef BUILD_IMAGE_UINT
135 #ifdef BUILD_IMAGE_DOUBLE
int SetCorners(unsigned UpperLeftX, unsigned UpperLeftY, unsigned LowerRightX, unsigned LowerRightY)
Sets a rectangular region of interest.
virtual int _ComputeCornerness(Image< CalculationType > &mineig)
Computes the smaller eigenvalue of the structure tensor A and stores it in _Cornerness.
ROI * GetROI()
Returns a pointer to the roi object.
Computes the cornerness as the smaller eigenvalue of the structure tensor matrix. ...
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
bool NotBiggerPixelAndSameChannelCount(const ImageBase &Image) const
checks if data area has bigger or the same "size" as Image of other type
base class for all gradient based corner detectors
virtual ~CornerDetectorKLT()
const StorageType ** GetImageDataArray() const
overloaded GetImageDataArray() from ImageBase