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. |
|
Perform a convolution of an image and a window.
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 } |
|
Perform a convolution of an image and a window.
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 } |