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