PARP Research Group University of Murcia, Spain


examples/OpenCV/siftDetector/hess/sift.h

Go to the documentation of this file.
00001 
00020 #ifndef SIFT_H
00021 #define SIFT_H
00022 
00023 #include "cxcore.h"
00024 
00025 /******************************** Structures *********************************/
00026 
00027 
00028 
00030 struct detection_data
00031 {
00032   int r;
00033   int c;
00034   int octv;
00035   int intvl;
00036   double subintvl;
00037   double scl_octv;
00038 };
00039 
00040 struct feature;
00041 
00042 
00043 /******************************* Defs and macros *****************************/
00044 
00046 #define SIFT_INTVLS 3
00047 
00049 #define SIFT_SIGMA 1.6
00050 
00052 #define SIFT_CONTR_THR 0.04
00053 
00055 #define SIFT_CURV_THR 10
00056 
00058 #define SIFT_IMG_DBL 1
00059 
00061 #define SIFT_DESCR_WIDTH 4
00062 
00064 #define SIFT_DESCR_HIST_BINS 8
00065 
00066 /* assumed gaussian blur for input image */
00067 #define SIFT_INIT_SIGMA 0.5
00068 
00069 /* width of border in which to ignore keypoints */
00070 #define SIFT_IMG_BORDER 5
00071 
00072 /* maximum steps of keypoint interpolation before failure */
00073 #define SIFT_MAX_INTERP_STEPS 5
00074 
00075 /* default number of bins in histogram for orientation assignment */
00076 #define SIFT_ORI_HIST_BINS 36
00077 
00078 /* determines gaussian sigma for orientation assignment */
00079 #define SIFT_ORI_SIG_FCTR 1.5
00080 
00081 /* determines the radius of the region used in orientation assignment */
00082 #define SIFT_ORI_RADIUS 3.0 * SIFT_ORI_SIG_FCTR
00083 
00084 /* number of passes of orientation histogram smoothing */
00085 #define SIFT_ORI_SMOOTH_PASSES 2
00086 
00087 /* orientation magnitude relative to max that results in new feature */
00088 #define SIFT_ORI_PEAK_RATIO 0.8
00089 
00090 /* determines the size of a single descriptor orientation histogram */
00091 #define SIFT_DESCR_SCL_FCTR 3.0
00092 
00093 /* threshold on magnitude of elements of descriptor vector */
00094 #define SIFT_DESCR_MAG_THR 0.2
00095 
00096 /* factor used to convert floating-point descriptor to unsigned char */
00097 #define SIFT_INT_DESCR_FCTR 512.0
00098 
00099 /* returns a feature's detection data */
00100 #define feat_detection_data(f) ( (struct detection_data*)(f->feature_data) )
00101 
00102 
00103 /*************************** Function Prototypes *****************************/
00104 
00115 extern int sift_features( IplImage* img, struct feature** feat );
00116 
00117 
00118 
00144 extern int _sift_features( IplImage* img, struct feature** feat, int intvls,
00145                            double sigma, double contr_thr, int curv_thr,
00146                            int img_dbl, int descr_width, int descr_hist_bins );
00147 
00148 
00149 #endif



QVision framework. PARP research group, copyright 2007, 2008.