covdet.h
Go to the documentation of this file.
00001 
00008 /*
00009 Copyright (C) 2013-14 Andrea Vedaldi.
00010 Copyright (C) 2012 Karel Lenc, Andrea Vedaldi and Michal Perdoch.
00011 All rights reserved.
00012 
00013 This file is part of the VLFeat library and is made available under
00014 the terms of the BSD license (see the COPYING file).
00015 */
00016 
00017 #ifndef VL_COVDET_H
00018 #define VL_COVDET_H
00019 
00020 #include "generic.h"
00021 #include "stringop.h"
00022 #include "scalespace.h"
00023 
00024 #include <stdio.h>
00025 
00026 /* ---------------------------------------------------------------- */
00027 /*                                                   Feature Frames */
00028 /* ---------------------------------------------------------------- */
00029 
00034 typedef enum _VlFrameType {
00035   VL_FRAMETYPE_DISC = 1,         
00036   VL_FRAMETYPE_ORIENTED_DISC,    
00037   VL_FRAMETYPE_ELLIPSE,          
00038   VL_FRAMETYPE_ORIENTED_ELLIPSE, 
00039   VL_FRAMETYPE_NUM
00040 } VlFrameType ;
00041 
00043 VL_EXPORT const char* vlFrameNames [VL_FRAMETYPE_NUM] ;
00044 
00046 VL_EXPORT VlEnumerator vlFrameTypes [VL_FRAMETYPE_NUM] ;
00047 
00049 typedef struct _VlFrameDisc
00050 {
00051   float x ;     
00052   float y ;     
00053   float sigma ; 
00054 } VlFrameDisc ;
00055 
00059 typedef struct _VlFrameOrientedDisc {
00060   float x ;     
00061   float y ;     
00062   float sigma ; 
00063   float angle ; 
00064 } VlFrameOrientedDisc ;
00065 
00067 typedef struct _VlFrameEllipse {
00068   float x ;     
00069   float y ;     
00070   float e11 ;   
00071   float e12 ;
00072   float e22 ;
00073 } VlFrameEllipse ;
00074 
00078 typedef struct _VlFrameOrientedEllipse {
00079   float x ;     
00080   float y ;     
00081   float a11 ;   
00082   float a12 ;
00083   float a21 ;
00084   float a22 ;
00085 } VlFrameOrientedEllipse;
00086 
00091 VL_INLINE vl_size
00092 vl_get_frame_size (VlFrameType frameType) {
00093   switch (frameType) {
00094     case VL_FRAMETYPE_DISC: return sizeof(VlFrameDisc);
00095     case VL_FRAMETYPE_ORIENTED_DISC: return sizeof(VlFrameOrientedDisc);
00096     case VL_FRAMETYPE_ELLIPSE: return sizeof(VlFrameEllipse);
00097     case VL_FRAMETYPE_ORIENTED_ELLIPSE: return sizeof(VlFrameOrientedEllipse);
00098     default:
00099       assert(0);
00100       break;
00101   }
00102   return 0;
00103 }
00104 
00114 VL_INLINE VlFrameType
00115 vl_get_frame_type (vl_bool affineAdaptation, vl_bool orientation)
00116 {
00117   if (affineAdaptation) {
00118     if (orientation) {
00119       return VL_FRAMETYPE_ORIENTED_ELLIPSE;
00120     } else {
00121       return VL_FRAMETYPE_ELLIPSE;
00122     }
00123   } else {
00124     if (orientation) {
00125       return VL_FRAMETYPE_ORIENTED_DISC;
00126     } else {
00127       return VL_FRAMETYPE_DISC;
00128     }
00129   }
00130 }
00131 
00132 /* ---------------------------------------------------------------- */
00133 /*                                       Covariant Feature Detector */
00134 /* ---------------------------------------------------------------- */
00135 
00137 typedef struct _VlCovDetFeature
00138 {
00139   VlFrameOrientedEllipse frame ; 
00140   float peakScore ; 
00141   float edgeScore ; 
00142   float orientationScore ; 
00143   float laplacianScaleScore ; 
00144 } VlCovDetFeature ;
00145 
00147 typedef struct _VlCovDetFeatureOrientation
00148 {
00149   double angle ;
00150   double score ;
00151 } VlCovDetFeatureOrientation ;
00152 
00154 typedef struct _VlCovDetFeatureLaplacianScale
00155 {
00156   double scale ;
00157   double score ;
00158 } VlCovDetFeatureLaplacianScale ;
00159 
00161 typedef enum _VlCovDetMethod
00162 {
00163   VL_COVDET_METHOD_DOG = 1,
00164   VL_COVDET_METHOD_HESSIAN,
00165   VL_COVDET_METHOD_HESSIAN_LAPLACE,
00166   VL_COVDET_METHOD_HARRIS_LAPLACE,
00167   VL_COVDET_METHOD_MULTISCALE_HESSIAN,
00168   VL_COVDET_METHOD_MULTISCALE_HARRIS,
00169   VL_COVDET_METHOD_NUM
00170 } VlCovDetMethod;
00171 
00173 VL_EXPORT VlEnumerator vlCovdetMethods [VL_COVDET_METHOD_NUM] ;
00174 
00175 #ifdef __DOXYGEN__
00176 
00178 struct _VlCovDet { }
00179 #endif
00180 
00183 typedef struct _VlCovDet VlCovDet ;
00184 
00187 VL_EXPORT VlCovDet * vl_covdet_new (VlCovDetMethod method) ;
00188 VL_EXPORT void vl_covdet_delete (VlCovDet * self) ;
00189 VL_EXPORT void vl_covdet_reset (VlCovDet * self) ;
00194 VL_EXPORT int vl_covdet_put_image (VlCovDet * self,
00195                                     float const * image,
00196                                     vl_size width, vl_size height) ;
00197 
00198 VL_EXPORT void vl_covdet_detect (VlCovDet * self) ;
00199 VL_EXPORT int vl_covdet_append_feature (VlCovDet * self, VlCovDetFeature const * feature) ;
00200 VL_EXPORT void vl_covdet_extract_orientations (VlCovDet * self) ;
00201 VL_EXPORT void vl_covdet_extract_laplacian_scales (VlCovDet * self) ;
00202 VL_EXPORT void vl_covdet_extract_affine_shape (VlCovDet * self) ;
00203 
00204 VL_EXPORT VlCovDetFeatureOrientation *
00205 vl_covdet_extract_orientations_for_frame (VlCovDet * self,
00206                                           vl_size *numOrientations,
00207                                           VlFrameOrientedEllipse frame) ;
00208 
00209 VL_EXPORT VlCovDetFeatureLaplacianScale *
00210 vl_covdet_extract_laplacian_scales_for_frame (VlCovDet * self,
00211                                               vl_size * numScales,
00212                                               VlFrameOrientedEllipse frame) ;
00213 VL_EXPORT int
00214 vl_covdet_extract_affine_shape_for_frame (VlCovDet * self,
00215                                           VlFrameOrientedEllipse * adapted,
00216                                           VlFrameOrientedEllipse frame) ;
00217 
00218 VL_EXPORT vl_bool
00219 vl_covdet_extract_patch_for_frame (VlCovDet * self, float * patch,
00220                                    vl_size resolution,
00221                                    double extent,
00222                                    double sigma,
00223                                    VlFrameOrientedEllipse frame) ;
00224 
00225 VL_EXPORT void
00226 vl_covdet_drop_features_outside (VlCovDet * self, double margin) ;
00231 VL_EXPORT vl_size vl_covdet_get_num_features (VlCovDet const * self) ;
00232 VL_EXPORT void * vl_covdet_get_features (VlCovDet * self) ;
00233 VL_EXPORT vl_index vl_covdet_get_first_octave (VlCovDet const * self) ;
00234 VL_EXPORT vl_size vl_covdet_get_octave_resolution (VlCovDet const * self) ;
00235 VL_EXPORT double vl_covdet_get_peak_threshold (VlCovDet const * self) ;
00236 VL_EXPORT double vl_covdet_get_edge_threshold (VlCovDet const * self) ;
00237 VL_EXPORT double vl_covdeg_get_laplacian_peak_threshold (VlCovDet const * self) ;
00238 VL_EXPORT vl_bool vl_covdet_get_transposed (VlCovDet const * self) ;
00239 VL_EXPORT VlScaleSpace *  vl_covdet_get_gss (VlCovDet const * self) ;
00240 VL_EXPORT VlScaleSpace *  vl_covdet_get_css (VlCovDet const * self) ;
00241 VL_EXPORT vl_bool vl_covdet_get_aa_accurate_smoothing (VlCovDet const * self) ;
00242 VL_EXPORT vl_size const * vl_covdet_get_laplacian_scales_statistics (VlCovDet const * self, vl_size * numScales) ;
00243 VL_EXPORT double vl_covdet_get_non_extrema_suppression_threshold (VlCovDet const * self) ;
00244 VL_EXPORT vl_size vl_covdet_get_num_non_extrema_suppressed (VlCovDet const * self) ;
00245 
00250 VL_EXPORT void vl_covdet_set_first_octave (VlCovDet * self, vl_index o) ;
00251 VL_EXPORT void vl_covdet_set_octave_resolution (VlCovDet * self, vl_size r) ;
00252 VL_EXPORT void vl_covdet_set_peak_threshold (VlCovDet * self, double peakThreshold) ;
00253 VL_EXPORT void vl_covdet_set_edge_threshold (VlCovDet * self, double edgeThreshold) ;
00254 VL_EXPORT void vl_covdet_set_laplacian_peak_threshold (VlCovDet * self, double peakThreshold) ;
00255 VL_EXPORT void vl_covdet_set_transposed (VlCovDet * self, vl_bool t) ;
00256 VL_EXPORT void vl_covdet_set_aa_accurate_smoothing (VlCovDet * self, vl_bool x) ;
00257 VL_EXPORT void vl_covdet_set_non_extrema_suppression_threshold (VlCovDet * self, double x) ;
00260 /* VL_COVDET_H */
00261 #endif


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