00001
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef VL_SIFT_H
00014 #define VL_SIFT_H
00015
00016 #include <stdio.h>
00017 #include "generic.h"
00018
00020 typedef float vl_sift_pix ;
00021
00029 typedef struct _VlSiftKeypoint
00030 {
00031 int o ;
00033 int ix ;
00034 int iy ;
00035 int is ;
00037 float x ;
00038 float y ;
00039 float s ;
00040 float sigma ;
00041 } VlSiftKeypoint ;
00042
00049 typedef struct _VlSiftFilt
00050 {
00051 double sigman ;
00052 double sigma0 ;
00053 double sigmak ;
00054 double dsigma0 ;
00056 int width ;
00057 int height ;
00058 int O ;
00059 int S ;
00060 int o_min ;
00061 int s_min ;
00062 int s_max ;
00063 int o_cur ;
00065 vl_sift_pix *temp ;
00066 vl_sift_pix *octave ;
00067 vl_sift_pix *dog ;
00068 int octave_width ;
00069 int octave_height ;
00071 VlSiftKeypoint* keys ;
00072 int nkeys ;
00073 int keys_res ;
00075 double peak_thresh ;
00076 double edge_thresh ;
00077 double norm_thresh ;
00078 double magnif ;
00079 double windowSize ;
00081 vl_sift_pix *grad ;
00082 int grad_o ;
00084 } VlSiftFilt ;
00085
00089 VL_EXPORT
00090 VlSiftFilt* vl_sift_new (int width, int height,
00091 int noctaves, int nlevels,
00092 int o_min) ;
00093 VL_EXPORT
00094 void vl_sift_delete (VlSiftFilt *f) ;
00101 VL_EXPORT
00102 int vl_sift_process_first_octave (VlSiftFilt *f,
00103 vl_sift_pix const *im) ;
00104
00105 VL_EXPORT
00106 int vl_sift_process_next_octave (VlSiftFilt *f) ;
00107
00108 VL_EXPORT
00109 void vl_sift_detect (VlSiftFilt *f) ;
00110
00111 VL_EXPORT
00112 int vl_sift_calc_keypoint_orientations (VlSiftFilt *f,
00113 double angles [4],
00114 VlSiftKeypoint const*k);
00115 VL_EXPORT
00116 void vl_sift_calc_keypoint_descriptor (VlSiftFilt *f,
00117 vl_sift_pix *descr,
00118 VlSiftKeypoint const* k,
00119 double angle) ;
00120
00121 VL_EXPORT
00122 void vl_sift_calc_raw_descriptor (VlSiftFilt const *f,
00123 vl_sift_pix const* image,
00124 vl_sift_pix *descr,
00125 int widht, int height,
00126 double x, double y,
00127 double s, double angle0) ;
00128
00129 VL_EXPORT
00130 void vl_sift_keypoint_init (VlSiftFilt const *f,
00131 VlSiftKeypoint *k,
00132 double x,
00133 double y,
00134 double sigma) ;
00140 VL_INLINE int vl_sift_get_octave_index (VlSiftFilt const *f) ;
00141 VL_INLINE int vl_sift_get_noctaves (VlSiftFilt const *f) ;
00142 VL_INLINE int vl_sift_get_octave_first (VlSiftFilt const *f) ;
00143 VL_INLINE int vl_sift_get_octave_width (VlSiftFilt const *f) ;
00144 VL_INLINE int vl_sift_get_octave_height (VlSiftFilt const *f) ;
00145 VL_INLINE int vl_sift_get_nlevels (VlSiftFilt const *f) ;
00146 VL_INLINE int vl_sift_get_nkeypoints (VlSiftFilt const *f) ;
00147 VL_INLINE double vl_sift_get_peak_thresh (VlSiftFilt const *f) ;
00148 VL_INLINE double vl_sift_get_edge_thresh (VlSiftFilt const *f) ;
00149 VL_INLINE double vl_sift_get_norm_thresh (VlSiftFilt const *f) ;
00150 VL_INLINE double vl_sift_get_magnif (VlSiftFilt const *f) ;
00151 VL_INLINE double vl_sift_get_window_size (VlSiftFilt const *f) ;
00152
00153 VL_INLINE vl_sift_pix *vl_sift_get_octave (VlSiftFilt const *f, int s) ;
00154 VL_INLINE VlSiftKeypoint const *vl_sift_get_keypoints (VlSiftFilt const *f) ;
00160 VL_INLINE void vl_sift_set_peak_thresh (VlSiftFilt *f, double t) ;
00161 VL_INLINE void vl_sift_set_edge_thresh (VlSiftFilt *f, double t) ;
00162 VL_INLINE void vl_sift_set_norm_thresh (VlSiftFilt *f, double t) ;
00163 VL_INLINE void vl_sift_set_magnif (VlSiftFilt *f, double m) ;
00164 VL_INLINE void vl_sift_set_window_size (VlSiftFilt *f, double m) ;
00167
00168
00169
00170
00177 VL_INLINE int
00178 vl_sift_get_octave_index (VlSiftFilt const *f)
00179 {
00180 return f-> o_cur ;
00181 }
00182
00189 VL_INLINE int
00190 vl_sift_get_noctaves (VlSiftFilt const *f)
00191 {
00192 return f-> O ;
00193 }
00194
00201 VL_INLINE int
00202 vl_sift_get_octave_first (VlSiftFilt const *f)
00203 {
00204 return f-> o_min ;
00205 }
00206
00213 VL_INLINE int
00214 vl_sift_get_octave_width (VlSiftFilt const *f)
00215 {
00216 return f-> octave_width ;
00217 }
00218
00225 VL_INLINE int
00226 vl_sift_get_octave_height (VlSiftFilt const *f)
00227 {
00228 return f-> octave_height ;
00229 }
00230
00243 VL_INLINE vl_sift_pix *
00244 vl_sift_get_octave (VlSiftFilt const *f, int s)
00245 {
00246 int w = vl_sift_get_octave_width (f) ;
00247 int h = vl_sift_get_octave_height (f) ;
00248 return f->octave + w * h * (s - f->s_min) ;
00249 }
00250
00257 VL_INLINE int
00258 vl_sift_get_nlevels (VlSiftFilt const *f)
00259 {
00260 return f-> S ;
00261 }
00262
00269 VL_INLINE int
00270 vl_sift_get_nkeypoints (VlSiftFilt const *f)
00271 {
00272 return f-> nkeys ;
00273 }
00274
00281 VL_INLINE VlSiftKeypoint const *
00282 vl_sift_get_keypoints (VlSiftFilt const *f)
00283 {
00284 return f-> keys ;
00285 }
00286
00293 VL_INLINE double
00294 vl_sift_get_peak_thresh (VlSiftFilt const *f)
00295 {
00296 return f -> peak_thresh ;
00297 }
00298
00305 VL_INLINE double
00306 vl_sift_get_edge_thresh (VlSiftFilt const *f)
00307 {
00308 return f -> edge_thresh ;
00309 }
00310
00317 VL_INLINE double
00318 vl_sift_get_norm_thresh (VlSiftFilt const *f)
00319 {
00320 return f -> norm_thresh ;
00321 }
00322
00329 VL_INLINE double
00330 vl_sift_get_magnif (VlSiftFilt const *f)
00331 {
00332 return f -> magnif ;
00333 }
00334
00341 VL_INLINE double
00342 vl_sift_get_window_size (VlSiftFilt const *f)
00343 {
00344 return f -> windowSize ;
00345 }
00346
00347
00348
00355 VL_INLINE void
00356 vl_sift_set_peak_thresh (VlSiftFilt *f, double t)
00357 {
00358 f -> peak_thresh = t ;
00359 }
00360
00367 VL_INLINE void
00368 vl_sift_set_edge_thresh (VlSiftFilt *f, double t)
00369 {
00370 f -> edge_thresh = t ;
00371 }
00372
00379 VL_INLINE void
00380 vl_sift_set_norm_thresh (VlSiftFilt *f, double t)
00381 {
00382 f -> norm_thresh = t ;
00383 }
00384
00391 VL_INLINE void
00392 vl_sift_set_magnif (VlSiftFilt *f, double m)
00393 {
00394 f -> magnif = m ;
00395 }
00396
00403 VL_INLINE void
00404 vl_sift_set_window_size (VlSiftFilt *f, double x)
00405 {
00406 f -> windowSize = x ;
00407 }
00408
00409
00410 #endif