title: how to perform fast convolution small patches in matlab
body: <p>I have a large number of 2D image patches and a set of 2D filters. The sizes of them are same. I want to get the filter response (1x1) of an image patch (dxd) when I apply a 2D filter of size dxd.</p>
  
  <p>What is the fast way to do it?</p>
  
  <p>The image patches are stored as a 3D matrix. Size of the patches as well as the filters are 15x15. I tried conv in matlab but seems it is slow. (about 20-30 seconds for 5000 patches). </p>
  
  <p>Can't I do it via some matrix multiplications? Cant I just convert each patch and each filter as a one D vector and do a multiplication?</p>