Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Lets say you have two filters <code>F1</code> and <code>F2</code>, and an image <code>I</code>. If you pass your image through the two filters, you would get a response that was defined as</p> <pre><code>X = ((I * F1) * F2) </code></pre> <p>Where here I am using <code>*</code> to represent <a href="https://en.wikipedia.org/wiki/Convolution" rel="nofollow noreferrer">convolution</a>.</p> <p>By the associative rule of convolution, this is the same as.</p> <pre><code>X = (I * (F1 * F2)) </code></pre> <p>using commutativity, we can say that </p> <pre><code>X = (I * (F2 * F1)) = ((I * F2) * F1) </code></pre> <p>Of course, this is in the nice continuous domain of math, doing these things on a machine means there will be rounding errors and some data may be lost. You also should think about if your filters are <a href="https://en.wikipedia.org/wiki/Finite_impulse_response" rel="nofollow noreferrer">FIR</a>, otherwise the whole concept of thinking about digital filtering as convolution sorta starts to break down as your filter can't really behave the way you wanted it to.</p> <hr> <p><strong>EDIT</strong></p> <p>The discrete convolution is defined as</p> <p><img src="https://i.stack.imgur.com/qTGZD.png" alt="conv2 uses a straightforward formal implementation of the two-dimensional convolution equation in spatial form"></p> <p>so adding zeros at the edges of you data doesn't change anything in a mathematical sense.</p> <p>As some people have pointed out, you will get different answers numerically, but this is expected whenever we deal with computing actual data. These variations should be small and limited to the low energy components of the output of the convolution (i.e: the edges).</p> <p>It is also important to consider how the convolution operation is working. Convolving two sets of data of length <code>X</code> and length <code>Y</code> will result in an answer that is <code>X+Y-1</code> in length. There is some behind the scenes magic going on for programs like MATLAB and Mathematica to give you an answer that is of length <code>X</code> or <code>Y</code>.</p> <p>So in regards to @belisarius' post, it would seem we are really saying the same thing.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload