00001
00002 #ifndef vil_gauss_reduce_h_
00003 #define vil_gauss_reduce_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <vil/vil_image_view.h>
00017 #include <vxl_config.h>
00018
00019
00020
00021
00022
00023 template<class T>
00024 void vil_gauss_reduce(const vil_image_view<T>& src,
00025 vil_image_view<T>& dest,
00026 vil_image_view<T>& work_im);
00027
00028
00029
00030
00031
00032 template<class T>
00033 void vil_gauss_reduce_2_3(const vil_image_view<T>& src_im,
00034 vil_image_view<T>& dest_im,
00035 vil_image_view<T>& work_im);
00036
00037
00038
00039
00040 template<class T>
00041 void vil_gauss_reduce_121(const vil_image_view<T>& src,
00042 vil_image_view<T>& dest);
00043
00044
00045 class vil_gauss_reduce_params
00046 {
00047 double scale_step_;
00048 double filt2_, filt1_, filt0_;
00049 double filt_edge2_, filt_edge1_, filt_edge0_;
00050 double filt_pen_edge2_, filt_pen_edge1_,
00051 filt_pen_edge0_, filt_pen_edge_n1_;
00052 public:
00053 explicit vil_gauss_reduce_params(double scale_step);
00054
00055 double scale_step() const {return scale_step_;}
00056
00057
00058
00059 double filt2() const { return filt2_;}
00060
00061
00062 double filt1() const { return filt1_;}
00063
00064
00065 double filt0() const { return filt0_;}
00066
00067
00068
00069
00070 double filt_edge2() const { return filt_edge2_;}
00071
00072
00073
00074 double filt_edge1() const { return filt_edge1_;}
00075
00076
00077
00078 double filt_edge0() const { return filt_edge0_;}
00079
00080
00081
00082
00083 double filt_pen_edge2() const { return filt_pen_edge2_;}
00084
00085
00086
00087 double filt_pen_edge1() const { return filt_pen_edge1_;}
00088
00089
00090
00091 double filt_pen_edge0() const { return filt_pen_edge0_;}
00092
00093
00094
00095 double filt_pen_edge_n1() const { return filt_pen_edge_n1_;}
00096 };
00097
00098
00099
00100
00101 template <class T>
00102 void vil_gauss_reduce_general(const vil_image_view<T>& src_im,
00103 vil_image_view<T>& dest_im,
00104 vil_image_view<T>& worka,
00105 vil_image_view<T>& workb,
00106 const vil_gauss_reduce_params& params);
00107
00108
00109
00110
00111 template <class T>
00112 inline void vil_gauss_reduce_general(const vil_image_view<T>& src_im,
00113 vil_image_view<T>& dest_im,
00114 const vil_gauss_reduce_params& params)
00115 {
00116 vil_image_view<T> tempA, tempB;
00117 vil_gauss_reduce_general(src_im, dest_im, tempA, tempB, params);
00118 }
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 template <class T>
00131 void vil_gauss_reduce_1plane(const T* src_im,
00132 unsigned src_nx, unsigned src_ny,
00133 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00134 T* dest_im,
00135 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 VCL_DEFINE_SPECIALIZATION
00147 void vil_gauss_reduce_1plane(const vxl_byte* src_im,
00148 unsigned src_nx, unsigned src_ny,
00149 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00150 vxl_byte* dest_im,
00151 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163 VCL_DEFINE_SPECIALIZATION
00164 void vil_gauss_reduce_1plane(const float* src_im,
00165 unsigned src_nx, unsigned src_ny,
00166 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00167 float* dest_im,
00168 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180 VCL_DEFINE_SPECIALIZATION
00181 void vil_gauss_reduce_1plane(const int* src_im,
00182 unsigned src_nx, unsigned src_ny,
00183 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00184 int* dest_im,
00185 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00186
00187 VCL_DEFINE_SPECIALIZATION
00188 void vil_gauss_reduce_1plane(const double* src_im,
00189 unsigned src_nx, unsigned src_ny,
00190 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00191 double* dest_im,
00192 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205 VCL_DEFINE_SPECIALIZATION
00206 void vil_gauss_reduce_1plane(const vxl_int_16* src_im,
00207 unsigned src_nx, unsigned src_ny,
00208 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00209 vxl_int_16* dest_im,
00210 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00211
00212
00213
00214 template <class T>
00215 void vil_gauss_reduce_121_1plane(const T* src_im,
00216 unsigned src_nx, unsigned src_ny,
00217 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00218 T* dest_im,
00219 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00220
00221
00222
00223 VCL_DEFINE_SPECIALIZATION
00224 void vil_gauss_reduce_121_1plane(const vxl_byte* src_im,
00225 unsigned src_nx, unsigned src_ny,
00226 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00227 vxl_byte* dest_im,
00228 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00229
00230
00231
00232 VCL_DEFINE_SPECIALIZATION
00233 void vil_gauss_reduce_121_1plane(const float* src_im,
00234 unsigned src_nx, unsigned src_ny,
00235 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00236 float* dest_im,
00237 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00238
00239
00240
00241 VCL_DEFINE_SPECIALIZATION
00242 void vil_gauss_reduce_121_1plane(const int* src_im,
00243 unsigned src_nx, unsigned src_ny,
00244 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00245 int* dest_im,
00246 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00247 VCL_DEFINE_SPECIALIZATION
00248 void vil_gauss_reduce_121_1plane(const double* src_im,
00249 unsigned src_nx, unsigned src_ny,
00250 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00251 double* dest_im,
00252 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00253
00254
00255
00256
00257
00258 VCL_DEFINE_SPECIALIZATION
00259 void vil_gauss_reduce_121_1plane(const vxl_int_16* src_im,
00260 unsigned src_nx, unsigned src_ny,
00261 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00262 vxl_int_16* dest_im,
00263 vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00264
00265
00266
00267
00268
00269 template <class T>
00270 void vil_gauss_reduce_2_3_1plane(const T* src_im,
00271 unsigned src_ni, unsigned src_nj,
00272 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00273 T* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00274
00275
00276
00277
00278
00279
00280 VCL_DEFINE_SPECIALIZATION
00281 void vil_gauss_reduce_2_3_1plane(const vxl_byte* src_im,
00282 unsigned src_ni, unsigned src_nj,
00283 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00284 vxl_byte* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00285
00286
00287
00288
00289
00290
00291 VCL_DEFINE_SPECIALIZATION
00292 void vil_gauss_reduce_2_3_1plane(const int* src_im,
00293 unsigned src_ni, unsigned src_nj,
00294 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00295 int* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00296
00297
00298
00299
00300
00301
00302 VCL_DEFINE_SPECIALIZATION
00303 void vil_gauss_reduce_2_3_1plane(const vxl_int_16* src_im,
00304 unsigned src_ni, unsigned src_nj,
00305 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00306 vxl_int_16* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00307
00308
00309
00310
00311
00312
00313 VCL_DEFINE_SPECIALIZATION
00314 void vil_gauss_reduce_2_3_1plane(const float* src_im,
00315 unsigned src_ni, unsigned src_nj,
00316 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00317 float* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00318
00319
00320
00321
00322
00323
00324 VCL_DEFINE_SPECIALIZATION
00325 void vil_gauss_reduce_2_3_1plane(const double* src_im,
00326 unsigned src_ni, unsigned src_nj,
00327 vcl_ptrdiff_t s_x_step, vcl_ptrdiff_t s_y_step,
00328 double* dest_im, vcl_ptrdiff_t d_x_step, vcl_ptrdiff_t d_y_step);
00329
00330 #endif // vil_gauss_reduce_h_