Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
quickHarrisDetector.hpp
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  * STATUS: in progress, do not use for now
00021  * Approximate a gaussian mask with integral images, in order to
00022  * improve precision (getting points closer to the real corner).
00023  * Disabled for now because it hasn't proved to be really more efficient.
00024  */
00025 #define GAUSSIAN_MASK_APPROX 0
00026 
00027 
00028 /*
00029  * STATUS: in progress, do not use for now
00030  * Try to detect virtual corners (created by a depth discontinuity).
00031  * It does not eliminate them yet, we're just trying to find a good criteria,
00032  * the current one tries to quickly count the gradient peaks around the point.
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; // integral image for quick detector.
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 /* QUICKHARRISDETECTOR_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:27 for Jafar by doxygen 1.7.6.1
LAAS-CNRS