mser.h
Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
00008 All rights reserved.
00009 
00010 This file is part of the VLFeat library and is made available under
00011 the terms of the BSD license (see the COPYING file).
00012 */
00013 
00014 #ifndef VL_MSER
00015 #define VL_MSER
00016 
00017 #include "generic.h"
00018 
00024 typedef vl_uint8 vl_mser_pix ;
00025 
00030 #define VL_MSER_PIX_MAXVAL 256
00031 
00039 typedef struct _VlMserFilt VlMserFilt ;
00040 
00042 typedef struct _VlMserStats VlMserStats ;
00043 
00045 struct _VlMserStats
00046 {
00047   int num_extremal ;      
00048   int num_unstable ;      
00049   int num_abs_unstable ;  
00050   int num_too_big ;       
00051   int num_too_small ;     
00052   int num_duplicates ;    
00053 } ;
00054 
00058 VL_EXPORT VlMserFilt*      vl_mser_new     (int ndims, int const* dims) ;
00059 VL_EXPORT void             vl_mser_delete  (VlMserFilt *f) ;
00065 VL_EXPORT void             vl_mser_process (VlMserFilt *f,
00066                                             vl_mser_pix const *im) ;
00067 VL_EXPORT void             vl_mser_ell_fit (VlMserFilt *f) ;
00073 VL_INLINE vl_uint          vl_mser_get_regions_num  (VlMserFilt const *f) ;
00074 VL_INLINE vl_uint const*   vl_mser_get_regions      (VlMserFilt const *f) ;
00075 VL_INLINE float const*     vl_mser_get_ell          (VlMserFilt const *f) ;
00076 VL_INLINE vl_uint          vl_mser_get_ell_num      (VlMserFilt const *f) ;
00077 VL_INLINE vl_uint          vl_mser_get_ell_dof      (VlMserFilt const *f) ;
00078 VL_INLINE VlMserStats const*  vl_mser_get_stats     (VlMserFilt const *f) ;
00084 VL_INLINE vl_mser_pix  vl_mser_get_delta          (VlMserFilt const *f) ;
00085 VL_INLINE double       vl_mser_get_min_area       (VlMserFilt const *f) ;
00086 VL_INLINE double       vl_mser_get_max_area       (VlMserFilt const *f) ;
00087 VL_INLINE double       vl_mser_get_max_variation  (VlMserFilt const *f) ;
00088 VL_INLINE double       vl_mser_get_min_diversity  (VlMserFilt const *f) ;
00094 VL_INLINE void  vl_mser_set_delta           (VlMserFilt *f, vl_mser_pix x) ;
00095 VL_INLINE void  vl_mser_set_min_area        (VlMserFilt *f, double      x) ;
00096 VL_INLINE void  vl_mser_set_max_area        (VlMserFilt *f, double      x) ;
00097 VL_INLINE void  vl_mser_set_max_variation   (VlMserFilt *f, double      x) ;
00098 VL_INLINE void  vl_mser_set_min_diversity   (VlMserFilt *f, double      x) ;
00101 /* ====================================================================
00102  *                                                   INLINE DEFINITIONS
00103  * ================================================================== */
00104 
00113 typedef float vl_mser_acc ;
00114 
00116 #ifdef VL_COMPILER_MSC
00117 #define VL_MSER_VOID_NODE ((1ui64<<32) - 1)
00118 #else
00119 #define VL_MSER_VOID_NODE ((1ULL<<32) - 1)
00120 #endif
00121 
00122 /* ----------------------------------------------------------------- */
00147 struct _VlMserReg
00148 {
00149   vl_uint parent ;   
00150   vl_uint shortcut ; 
00151   vl_uint height ;   
00152   vl_uint area ;     
00153 } ;
00154 
00156 typedef struct _VlMserReg VlMserReg ;
00157 
00158 /* ----------------------------------------------------------------- */
00184 struct _VlMserExtrReg
00185 {
00186   int          parent ;     
00187   int          index ;      
00188   vl_mser_pix  value ;      
00189   vl_uint      shortcut ;   
00190   vl_uint      area ;       
00191   float        variation ;  
00192   vl_uint      max_stable ; 
00193 } ;
00194 
00197 typedef struct _VlMserExtrReg VlMserExtrReg ;
00198 
00199 /* ----------------------------------------------------------------- */
00204 struct _VlMserFilt
00205 {
00206 
00209   int                ndims ;   
00210   int               *dims ;    
00211   int                nel ;     
00212   int               *subs ;    
00213   int               *dsubs ;   
00214   int               *strides ; 
00216 
00217   vl_uint           *perm ;    
00218   vl_uint           *joins ;   
00219   int                njoins ;  
00223   VlMserReg         *r ;       
00224   VlMserExtrReg     *er ;      
00225   vl_uint           *mer ;     
00226   int                ner ;     
00227   int                nmer ;    
00228   int                rer ;     
00229   int                rmer ;    
00231 
00234   float             *acc ;     
00235   float             *ell ;     
00236   int                rell ;    
00237   int                nell ;    
00238   int                dof ;     
00241 
00244   vl_bool   verbose ;          
00245   int       delta ;            
00246   double    max_area ;         
00247   double    min_area ;         
00248   double    max_variation ;    
00249   double    min_diversity ;    
00251 
00252   VlMserStats stats ;          
00253 } ;
00254 
00255 /* ----------------------------------------------------------------- */
00260 VL_INLINE vl_mser_pix
00261 vl_mser_get_delta (VlMserFilt const *f)
00262 {
00263   return f-> delta ;
00264 }
00265 
00270 VL_INLINE void
00271 vl_mser_set_delta (VlMserFilt *f, vl_mser_pix x)
00272 {
00273   f-> delta = x ;
00274 }
00275 
00276 /* ----------------------------------------------------------------- */
00281 VL_INLINE double
00282 vl_mser_get_min_diversity (VlMserFilt const *f)
00283 {
00284   return f-> min_diversity ;
00285 }
00286 
00291 VL_INLINE void
00292 vl_mser_set_min_diversity (VlMserFilt *f, double x)
00293 {
00294   f-> min_diversity = x ;
00295 }
00296 
00297 /* ----------------------------------------------------------------- */
00302 VL_INLINE VlMserStats const*
00303 vl_mser_get_stats (VlMserFilt const *f)
00304 {
00305   return & f-> stats ;
00306 }
00307 
00308 /* ----------------------------------------------------------------- */
00313 VL_INLINE double
00314 vl_mser_get_max_area (VlMserFilt const *f)
00315 {
00316   return f-> max_area ;
00317 }
00318 
00323 VL_INLINE void
00324 vl_mser_set_max_area (VlMserFilt *f, double x)
00325 {
00326   f-> max_area = x ;
00327 }
00328 
00329 /* ----------------------------------------------------------------- */
00334 VL_INLINE double
00335 vl_mser_get_min_area (VlMserFilt const *f)
00336 {
00337   return f-> min_area ;
00338 }
00339 
00344 VL_INLINE void
00345 vl_mser_set_min_area (VlMserFilt *f, double x)
00346 {
00347   f-> min_area = x ;
00348 }
00349 
00350 /* ----------------------------------------------------------------- */
00355 VL_INLINE double
00356 vl_mser_get_max_variation (VlMserFilt const *f)
00357 {
00358   return f-> max_variation ;
00359 }
00360 
00365 VL_INLINE void
00366 vl_mser_set_max_variation (VlMserFilt *f, double x)
00367 {
00368   f-> max_variation = x ;
00369 }
00370 
00371 /* ----------------------------------------------------------------- */
00376 VL_INLINE vl_uint const *
00377 vl_mser_get_regions (VlMserFilt const* f)
00378 {
00379   return f-> mer ;
00380 }
00381 
00386 VL_INLINE vl_uint
00387 vl_mser_get_regions_num (VlMserFilt const* f)
00388 {
00389   return f-> nmer ;
00390 }
00391 
00392 /* ----------------------------------------------------------------- */
00397 VL_INLINE float const *
00398 vl_mser_get_ell (VlMserFilt const* f)
00399 {
00400   return f-> ell ;
00401 }
00402 
00407 VL_INLINE vl_uint
00408 vl_mser_get_ell_dof (VlMserFilt const* f)
00409 {
00410   return f-> dof ;
00411 }
00412 
00417 VL_INLINE vl_uint
00418 vl_mser_get_ell_num (VlMserFilt const* f)
00419 {
00420   return f-> nell ;
00421 }
00422 
00423 /* VL_MSER */
00424 #endif


libvlfeat
Author(s): Andrea Vedaldi
autogenerated on Thu Jun 6 2019 20:25:51