AnantLabs / efficient-java-matrix-library

Automatically exported from code.google.com/p/efficient-java-matrix-library
0 stars 0 forks source link

support for 2d convolutions #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm requesting a new feature be added to EJML to perform 2d matrix convolutions 
similar to the octave function conv2.  For example, in octave, given a 'data' 
matrix and a 'feature' matrix, you'd execute the following:

    feature = flipud(fliplr(squeeze(feature)));
    convolved_data = conv2(data, feature, "valid");

The slow element-wise algorithm would be:

  convolved_data = zeros(size(data,1) - size(feature,1) + 1, size(data,2) - size(feature,2) + 1);

  for iy = size(convolved_data,2)
    for ix = 1:size(convolved_data,1)
      for fy = 1:size(feature,2)
        for fx = 1:size(feature,1)
          convolved_data(ix, iy) += data(ix+fx-1,iy+fy-1) * feature(fx, fy);
        endfor
      endfor
    endfor
  endfor

Original issue reported on code.google.com by cjbe...@gmail.com on 15 Sep 2012 at 4:26

GoogleCodeExporter commented 9 years ago
I'm going to think about this request a bit more.  The focus of EJML is on 
linear algebra.  2D convolutions fall under signal processing.  Having 2D 
convolution capability would be useful in a few applications where EJML is 
applied...

Original comment by peter.ab...@gmail.com on 17 Sep 2012 at 6:44

GoogleCodeExporter commented 9 years ago
Going to reject this feature request because it is outside of scope.  There is 
some convolution code in BoofCV, but it isn't general purpose yet.

Original comment by peter.ab...@gmail.com on 4 Dec 2012 at 3:55