00001 // This is core/vil1/vil1_convolve_simple.h 00002 #ifndef vil1_convolve_simple_h_ 00003 #define vil1_convolve_simple_h_ 00004 //: 00005 // \file 00006 // \brief Simple convolution functions 00007 // \author awf@robots.ox.ac.uk 00008 00009 template <class T> class vil1_memory_image_of; 00010 00011 //: Convolution 00012 // This function assumes that the image types provide operator[] to 00013 // return a pointer (or something which behaves like one) to the y'th 00014 // raster. 00015 // 00016 // The given regions of the input images are convolved and placed at 00017 // the given position in the output image, according to the formula : 00018 // $\displaystyle OUT[y][x] = \sum_{x_1+x_2=x, y_1+y_2=y} IN_1[y_1][x_1] IN_2[y_2][x_2]$ 00019 // 00020 // The dummy parameter is just for dumb compilers that do not allow 00021 // the use of vil1_convolve_simple<...> to specify the accumulator type. 00022 // 00023 // - I1 : input image type 00024 // - I2 : input image type 00025 // - AC : accumulator pixel type 00026 // - O : output image type 00027 00028 template <class I1, class I2, class AC, class O> 00029 void vil1_convolve_simple(I1 const* const* in1, unsigned w1, unsigned h1, // input 1 00030 I2 const* const* in2, unsigned w2, unsigned h2, // input 2 00031 AC *, // dummy 00032 O * const* out); // output 00033 00034 //: Convolution 00035 // This function performs some bounds checks on the given memory images 00036 // and then dispatches the convolution itself to the above function. 00037 // 00038 // - I1 : input image type 00039 // - I2 : input image type 00040 // - AC : accumulator pixel type 00041 // - O : output image type 00042 // 00043 // $\displaystyle {\rm out}_{{\rm off}+k} = \sum_{i+j=k} a_{{\rm off}+i} b_{{\rm off}+j}$ 00044 00045 template <class I1, class I2, class AC, class O> 00046 void vil1_convolve_simple(// input 1 00047 vil1_memory_image_of<I1> const &IN1, // input 1 00048 int x1, int y1, unsigned w1, unsigned h1, 00049 vil1_memory_image_of<I2> const &IN2, // input 2 00050 int x2, int y2, unsigned w2, unsigned h2, 00051 AC *, //dummy 00052 vil1_memory_image_of<O> &OUT, // output 00053 int xo, int yo); 00054 00055 //: Convolution 00056 // Like the previous function, except without bounds checking and 00057 // specified regions. 00058 // 00059 // - I1 : input image type 00060 // - I2 : input image type 00061 // - AC : accumulator pixel type 00062 // - O : output image type 00063 // 00064 // $\displaystyle {\rm out}_{{\rm off}+k} = \sum_{i+j=k} a_{{\rm off}+i} b_{{\rm off}+j}$ 00065 00066 template <class I1, class I2, class AC, class O> 00067 void vil1_convolve_simple(vil1_memory_image_of<I1> const &input1, 00068 vil1_memory_image_of<I2> const &input2, 00069 AC *, // dummy 00070 vil1_memory_image_of<O> &output); 00071 00072 #endif // vil1_convolve_simple_h_
1.5.1