octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The conv2 mess


From: Michael D Godfrey
Subject: Re: The conv2 mess
Date: Fri, 20 Apr 2012 22:17:04 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 04/20/2012 09:28 PM, Jordi Gutiérrez Hermoso wrote:
Can anyone understand wtf is going on in liboctave/oct-convn.cc ? Specifically,

    - wtf is an inner or an outer convolution?

    - wtf are the variables passed to convolve_nd? What is "acd" and
      "bcd"?

    - htf is an n-dimensional convolution computed recursively? I
      understand the 2d case is a base case, but how are the
      higher-dimensional cases done?

    - wtf is part of this written as Fortran functions? Is 6 Fortran
      copy-pasted files better than one C++ template?

    - wtf was this rewritten completely, and if it was, why does it
      still have Andy Adler's copyright statement, if it has none
      of his code in place, except one cargo-culted Shape enum?

    - Even with the attached patch, wtf are A and B only approximately
      equal?

      x = rand(100);
      y = ones(5);
      A = conv2(x,y)(5:end-4,5:end-4);
      B = conv2(x,y,"valid");

This code's wpm is too high:

    http://www.osnews.com/images/comics/wtfm.jpg

So htf do we fix this?

- Jordi G. H.
I will not try to answer Jordi's reasonable questions, but I notice that the
help descriptions of conv2 and convn in Octave and Matlab are very
similar, and remind me of days long gone by.  However, the URL below
shows that at least conv2 can be done in a more modern way.  The use of this
code is not made explicit, but it is on OpenCV:
http://blog.timmlinder.com/2011/07/opencv-equivalent-to-matlabs-conv2-function/

Michael


reply via email to

[Prev in Thread] Current Thread [Next in Thread]