Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef VL_SIFT_H
00015 #define VL_SIFT_H
00016
00017 #include <stdio.h>
00018 #include "generic.h"
00019
00021 typedef float vl_sift_pix ;
00022
00030 typedef struct _VlSiftKeypoint
00031 {
00032 int o ;
00034 int ix ;
00035 int iy ;
00036 int is ;
00038 float x ;
00039 float y ;
00040 float s ;
00041 float sigma ;
00042 } VlSiftKeypoint ;
00043
00050 typedef struct _VlSiftFilt
00051 {
00052 double sigman ;
00053 double sigma0 ;
00054 double sigmak ;
00055 double dsigma0 ;
00057 int width ;
00058 int height ;
00059 int O ;
00060 int S ;
00061 int o_min ;
00062 int s_min ;
00063 int s_max ;
00064 int o_cur ;
00066 vl_sift_pix *temp ;
00067 vl_sift_pix *octave ;
00068 vl_sift_pix *dog ;
00069 int octave_width ;
00070 int octave_height ;
00072 vl_sift_pix *gaussFilter ;
00073 double gaussFilterSigma ;
00074 vl_size gaussFilterWidth ;
00076 VlSiftKeypoint* keys ;
00077 int nkeys ;
00078 int keys_res ;
00080 double peak_thresh ;
00081 double edge_thresh ;
00082 double norm_thresh ;
00083 double magnif ;
00084 double windowSize ;
00086 vl_sift_pix *grad ;
00087 int grad_o ;
00089 } VlSiftFilt ;
00090
00094 VL_EXPORT
00095 VlSiftFilt* vl_sift_new (int width, int height,
00096 int noctaves, int nlevels,
00097 int o_min) ;
00098 VL_EXPORT
00099 void vl_sift_delete (VlSiftFilt *f) ;
00106 VL_EXPORT
00107 int vl_sift_process_first_octave (VlSiftFilt *f,
00108 vl_sift_pix const *im) ;
00109
00110 VL_EXPORT
00111 int vl_sift_process_next_octave (VlSiftFilt *f) ;
00112
00113 VL_EXPORT
00114 void vl_sift_detect (VlSiftFilt *f) ;
00115
00116 VL_EXPORT
00117 int vl_sift_calc_keypoint_orientations (VlSiftFilt *f,
00118 double angles [4],
00119 VlSiftKeypoint const*k);
00120 VL_EXPORT
00121 void vl_sift_calc_keypoint_descriptor (VlSiftFilt *f,
00122 vl_sift_pix *descr,
00123 VlSiftKeypoint const* k,
00124 double angle) ;
00125
00126 VL_EXPORT
00127 void vl_sift_calc_raw_descriptor (VlSiftFilt const *f,
00128 vl_sift_pix const* image,
00129 vl_sift_pix *descr,
00130 int widht, int height,
00131 double x, double y,
00132 double s, double angle0) ;
00133
00134 VL_EXPORT
00135 void vl_sift_keypoint_init (VlSiftFilt const *f,
00136 VlSiftKeypoint *k,
00137 double x,
00138 double y,
00139 double sigma) ;
00145 VL_INLINE int vl_sift_get_octave_index (VlSiftFilt const *f) ;
00146 VL_INLINE int vl_sift_get_noctaves (VlSiftFilt const *f) ;
00147 VL_INLINE int vl_sift_get_octave_first (VlSiftFilt const *f) ;
00148 VL_INLINE int vl_sift_get_octave_width (VlSiftFilt const *f) ;
00149 VL_INLINE int vl_sift_get_octave_height (VlSiftFilt const *f) ;
00150 VL_INLINE int vl_sift_get_nlevels (VlSiftFilt const *f) ;
00151 VL_INLINE int vl_sift_get_nkeypoints (VlSiftFilt const *f) ;
00152 VL_INLINE double vl_sift_get_peak_thresh (VlSiftFilt const *f) ;
00153 VL_INLINE double vl_sift_get_edge_thresh (VlSiftFilt const *f) ;
00154 VL_INLINE double vl_sift_get_norm_thresh (VlSiftFilt const *f) ;
00155 VL_INLINE double vl_sift_get_magnif (VlSiftFilt const *f) ;
00156 VL_INLINE double vl_sift_get_window_size (VlSiftFilt const *f) ;
00157
00158 VL_INLINE vl_sift_pix *vl_sift_get_octave (VlSiftFilt const *f, int s) ;
00159 VL_INLINE VlSiftKeypoint const *vl_sift_get_keypoints (VlSiftFilt const *f) ;
00165 VL_INLINE void vl_sift_set_peak_thresh (VlSiftFilt *f, double t) ;
00166 VL_INLINE void vl_sift_set_edge_thresh (VlSiftFilt *f, double t) ;
00167 VL_INLINE void vl_sift_set_norm_thresh (VlSiftFilt *f, double t) ;
00168 VL_INLINE void vl_sift_set_magnif (VlSiftFilt *f, double m) ;
00169 VL_INLINE void vl_sift_set_window_size (VlSiftFilt *f, double m) ;
00172
00173
00174
00175
00182 VL_INLINE int
00183 vl_sift_get_octave_index (VlSiftFilt const *f)
00184 {
00185 return f-> o_cur ;
00186 }
00187
00194 VL_INLINE int
00195 vl_sift_get_noctaves (VlSiftFilt const *f)
00196 {
00197 return f-> O ;
00198 }
00199
00206 VL_INLINE int
00207 vl_sift_get_octave_first (VlSiftFilt const *f)
00208 {
00209 return f-> o_min ;
00210 }
00211
00218 VL_INLINE int
00219 vl_sift_get_octave_width (VlSiftFilt const *f)
00220 {
00221 return f-> octave_width ;
00222 }
00223
00230 VL_INLINE int
00231 vl_sift_get_octave_height (VlSiftFilt const *f)
00232 {
00233 return f-> octave_height ;
00234 }
00235
00248 VL_INLINE vl_sift_pix *
00249 vl_sift_get_octave (VlSiftFilt const *f, int s)
00250 {
00251 int w = vl_sift_get_octave_width (f) ;
00252 int h = vl_sift_get_octave_height (f) ;
00253 return f->octave + w * h * (s - f->s_min) ;
00254 }
00255
00262 VL_INLINE int
00263 vl_sift_get_nlevels (VlSiftFilt const *f)
00264 {
00265 return f-> S ;
00266 }
00267
00274 VL_INLINE int
00275 vl_sift_get_nkeypoints (VlSiftFilt const *f)
00276 {
00277 return f-> nkeys ;
00278 }
00279
00286 VL_INLINE VlSiftKeypoint const *
00287 vl_sift_get_keypoints (VlSiftFilt const *f)
00288 {
00289 return f-> keys ;
00290 }
00291
00298 VL_INLINE double
00299 vl_sift_get_peak_thresh (VlSiftFilt const *f)
00300 {
00301 return f -> peak_thresh ;
00302 }
00303
00310 VL_INLINE double
00311 vl_sift_get_edge_thresh (VlSiftFilt const *f)
00312 {
00313 return f -> edge_thresh ;
00314 }
00315
00322 VL_INLINE double
00323 vl_sift_get_norm_thresh (VlSiftFilt const *f)
00324 {
00325 return f -> norm_thresh ;
00326 }
00327
00334 VL_INLINE double
00335 vl_sift_get_magnif (VlSiftFilt const *f)
00336 {
00337 return f -> magnif ;
00338 }
00339
00346 VL_INLINE double
00347 vl_sift_get_window_size (VlSiftFilt const *f)
00348 {
00349 return f -> windowSize ;
00350 }
00351
00352
00353
00360 VL_INLINE void
00361 vl_sift_set_peak_thresh (VlSiftFilt *f, double t)
00362 {
00363 f -> peak_thresh = t ;
00364 }
00365
00372 VL_INLINE void
00373 vl_sift_set_edge_thresh (VlSiftFilt *f, double t)
00374 {
00375 f -> edge_thresh = t ;
00376 }
00377
00384 VL_INLINE void
00385 vl_sift_set_norm_thresh (VlSiftFilt *f, double t)
00386 {
00387 f -> norm_thresh = t ;
00388 }
00389
00396 VL_INLINE void
00397 vl_sift_set_magnif (VlSiftFilt *f, double m)
00398 {
00399 f -> magnif = m ;
00400 }
00401
00411 VL_INLINE void
00412 vl_sift_set_window_size (VlSiftFilt *f, double x)
00413 {
00414 f -> windowSize = x ;
00415 }
00416
00417
00418 #endif