quickshift.h
Go to the documentation of this file.00001 00007 /* AUTORIGHTS 00008 Copyright 2007 (c) Andrea Vedaldi and Brian Fulkerson 00009 00010 This file is part of VLFeat, available in the terms of the GNU 00011 General Public License version 2. 00012 */ 00013 00014 #ifndef VL_QUICKSHIFT_H 00015 #define VL_QUICKSHIFT_H 00016 00017 #include "generic.h" 00018 #include "mathop.h" 00019 00021 typedef double vl_qs_type ; 00022 00024 #define VL_QS_INF VL_INFINITY_D /* Change to _F for float math */ 00025 00032 typedef struct _VlQS 00033 { 00034 vl_qs_type *image ; 00035 int height; 00036 int width; 00037 int channels; 00039 vl_bool medoid; 00040 vl_qs_type sigma; 00041 vl_qs_type tau; 00042 00043 int *parents ; 00044 vl_qs_type *dists ; 00045 vl_qs_type *density ; 00046 } VlQS ; 00047 00051 VL_EXPORT 00052 VlQS* vl_quickshift_new (vl_qs_type const * im, int height, int width, 00053 int channels); 00054 00055 VL_EXPORT 00056 void vl_quickshift_delete (VlQS *q) ; 00063 VL_EXPORT 00064 void vl_quickshift_process (VlQS *q) ; 00065 00071 VL_INLINE vl_qs_type vl_quickshift_get_max_dist (VlQS const *q) ; 00072 VL_INLINE vl_qs_type vl_quickshift_get_kernel_size (VlQS const *q) ; 00073 VL_INLINE vl_bool vl_quickshift_get_medoid (VlQS const *q) ; 00074 00075 VL_INLINE int * vl_quickshift_get_parents (VlQS const *q) ; 00076 VL_INLINE vl_qs_type * vl_quickshift_get_dists (VlQS const *q) ; 00077 VL_INLINE vl_qs_type * vl_quickshift_get_density (VlQS const *q) ; 00083 VL_INLINE void vl_quickshift_set_max_dist (VlQS *f, vl_qs_type tau) ; 00084 VL_INLINE void vl_quickshift_set_kernel_size (VlQS *f, vl_qs_type sigma) ; 00085 VL_INLINE void vl_quickshift_set_medoid (VlQS *f, vl_bool medoid) ; 00088 /* ------------------------------------------------------------------- 00089 * Inline functions implementation 00090 * ---------------------------------------------------------------- */ 00091 00099 VL_INLINE vl_qs_type 00100 vl_quickshift_get_max_dist (VlQS const *q) 00101 { 00102 return q->tau ; 00103 } 00104 00112 VL_INLINE vl_qs_type 00113 vl_quickshift_get_kernel_size (VlQS const *q) 00114 { 00115 return q->sigma ; 00116 } 00117 00124 VL_INLINE vl_bool 00125 vl_quickshift_get_medoid (VlQS const *q) 00126 { 00127 return q->medoid ; 00128 } 00129 00138 VL_INLINE int * 00139 vl_quickshift_get_parents (VlQS const *q) 00140 { 00141 return q->parents ; 00142 } 00143 00151 VL_INLINE vl_qs_type * 00152 vl_quickshift_get_dists (VlQS const *q) 00153 { 00154 return q->dists ; 00155 } 00156 00163 VL_INLINE vl_qs_type * 00164 vl_quickshift_get_density (VlQS const *q) 00165 { 00166 return q->density ; 00167 } 00168 00176 VL_INLINE void 00177 vl_quickshift_set_kernel_size (VlQS *q, vl_qs_type sigma) 00178 { 00179 q -> sigma = sigma ; 00180 } 00181 00189 VL_INLINE void 00190 vl_quickshift_set_max_dist (VlQS *q, vl_qs_type tau) 00191 { 00192 q -> tau = tau ; 00193 } 00194 00202 VL_INLINE void 00203 vl_quickshift_set_medoid (VlQS *q, vl_bool medoid) 00204 { 00205 q -> medoid = medoid ; 00206 } 00207 00208 00209 #endif