oln::convol::slow Namespace Reference

Convolution algorithms. More...


Functions

template<class DestValue, class I, class Win> mute< I, DestValue >::ret convolve (const abstract::image< I > &input, const abstract::w_window< Win > &win)
 Perform a convolution of an image and a window.

template<class DestValue, class I, class Info, class Win> mute< I, DestValue >::ret convolve (const abstract::image< I > &input, const mlc::array2d< Info, Win > &arr)
 Perform a convolution of an image and a window.


Detailed Description

Convolution algorithms.

Function Documentation

template<class DestValue, class I, class Info, class Win>
mute<I, DestValue>::ret convolve const abstract::image< I > &  input,
const mlc::array2d< Info, Win > &  arr
 

Perform a convolution of an image and a window.

Parameters:
DestValue Data type of the output image you want.
I Exact type of the input image.
Info Informations about the array.
Win Data type of the array.
  • input The image to process.
  • arr The array to convolve with.

Todo:
FIXME: don't use array1d, ..., arraynd.

Definition at line 97 of file convolution.hh.

00099       {
00100         return convolve<DestValue>(input, static_cast< w_window2d<Win> >(arr));
00101         // FIXME: Should be abstract::w_window<T_arr>.  Adjust #include once done.
00102       }

template<class DestValue, class I, class Win>
mute<I, DestValue>::ret convolve const abstract::image< I > &  input,
const abstract::w_window< Win > &  win
 

Perform a convolution of an image and a window.

Parameters:
DestValue Data type of the output image you want.
I Exact type of the input image.
Win Exact type of the window.
  • input The image to process.
  • win The window to convolve with.

Todo:
FIXME: we must always specify DestValue.

Definition at line 62 of file convolution.hh.

References oln::abstract::image< Exact >::border_adapt_copy(), oln::abstract::struct_elt< Exact >::card(), oln::abstract::struct_elt< Exact >::delta(), oln::abstract::struct_elt< Exact >::dp(), oln::abstract::image< Exact >::size(), and oln::abstract::w_window< Exact >::w().

00064       {
00065         mlc::eq<I::dim, Win::dim>::ensure();
00066 
00067         typename mute<I, DestValue>::ret output(input.size());
00068         input.border_adapt_copy(win.delta());
00069         oln_iter_type(I) p_im(input);
00070         for_all(p_im)
00071           {
00072             DestValue sum = ntg_zero_val(DestValue);
00073             for (unsigned i = 0; i < win.card(); ++i)
00074               sum += static_cast<DestValue> (win.w(i)) *
00075                      static_cast<DestValue> (input[p_im - win.dp(i)]);
00076             output[p_im] = sum;
00077           }
00078 
00079         return output;
00080       }


Generated on Thu Apr 15 20:16:12 2004 for Olena by doxygen 1.3.6-20040222