00001 #ifndef IMAGE_CONV_H 00002 #define IMAGE_CONV_H 00003 00004 #include "image.h" 00005 #include "multi_array_conv.h" 00006 00007 namespace mimas { 00008 00023 template< typename T, typename TPtr, typename UPtr > 00024 inline image< T > correlate( const const_image_ref< T, TPtr > &x, 00025 const const_image_ref< T, UPtr > &y ) 00026 { 00027 image< T > retVal; retVal.init( x.getWidth(), x.getHeight() ); 00028 boost::multi_array_ref< T, 2 > 00029 dr( retVal.rawData(), 00030 boost::extents[ retVal.getHeight() ][ retVal.getWidth() ] ); 00031 boost::const_multi_array_ref< T, 2 > 00032 dx( x.rawData(), boost::extents[ x.getHeight() ][ x.getWidth() ] ), 00033 dy( y.rawData(), boost::extents[ y.getHeight() ][ y.getWidth() ] ); 00034 dr = correlate( dx, dy ); 00035 return retVal; 00036 } 00037 00038 #ifdef HAVE_LIBLAPACK 00039 00040 template< typename T, typename TPtr, typename UPtr > 00041 image< T > correlate_separable( const const_image_ref< T, TPtr > &x, 00042 const const_image_ref< T, UPtr > &f ) 00043 { 00044 return image< T >( correlate_separable< T >( x.rawData(), f.rawData() ) ); 00045 } 00046 00047 #endif 00048 00049 } 00050 00051 #endif