Go to the documentation of this file.00001
00010 #ifndef QUICKHARRISDETECTOR_HPP_
00011 #define QUICKHARRISDETECTOR_HPP_
00012
00013 #include "image/Image.hpp"
00014 #include "image/roi.hpp"
00015
00016 #include "rtslam/featurePoint.hpp"
00017
00018
00019
00020
00021
00022
00023
00024
00025 #define GAUSSIAN_MASK_APPROX 0
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define FILTER_VIRTUAL_POINTS 0
00035
00036
00037 namespace jafar{
00038 namespace rtslam{
00039
00058 class QuickHarrisDetector {
00059 public:
00060 QuickHarrisDetector(int convolutionBoxSize = 5, float threshold = 15.0, float edge = 2.0
00061 #if GAUSSIAN_MASK_APPROX
00062 , int convolutionGaussianApproxCoeffsNumber = 3
00063 #endif
00064 );
00065 ~QuickHarrisDetector();
00066 virtual bool detectIn(image::Image const& image, feat_img_pnt_ptr_t featPtr, const image::ConvexRoi * roiPtr = 0 );
00067 private:
00068 void quickDerivatives(const image::Image & image, image::ConvexRoi & roi);
00069 bool quickConvolutionWithBestPoint(const image::ConvexRoi & roi, int pixMax[2], float & scoreMax);
00070
00071 void writeHarrisImagesAsPPM(image::ConvexRoi & roi);
00072
00073 private:
00074 int m_derivationSize, m_convolutionSize;
00075 float m_threshold;
00076 float m_edge;
00077 struct HQuickData {
00078 int im_x, im_y, im_xx, im_xy, im_yy, im_conv_xx, im_conv_xy, im_conv_yy;
00079 int int_xx, int_xy, int_yy;
00080 double im_high_curv, im_low_curv;
00081 };
00082 HQuickData* m_quickData;
00083
00084 private:
00085 double normCoeff;
00086 int m_nConvCoeffs;
00087 int shift_conv;
00088 int *shift_convs;
00089 int *convCoeffs;
00090 int nConvCoeffs;
00091 bool nConvCoeffsCenter;
00092
00093 HQuickData** int_upLeft;
00094 HQuickData** int_upRight;
00095 HQuickData** int_downLeft;
00096 HQuickData** int_downRight;
00097 };
00098 }
00099 }
00100
00101
00102
00103
00104 #endif