imfilter gives very different result. Is that right?

Discussion in 'MATLAB' started by Jackson Shen, Oct 2, 2009.

  1. Jackson Shen

    Jackson Shen Guest

    A = single(rand(100,100));
    ans =
    2.3428860

    Is that right?

    Why is it given such big error if using:
    E1 = imfilter(A, B, 'same','corr');

    I am confused.
     
    Jackson Shen, Oct 2, 2009
    #1
    1. Advertisements

  2. Jackson Shen

    Rune Allnor Guest

    The first step towards untagling the confusion
    would be to qualify why you expect the two to be
    equal. SO: Why do you think the two should give
    the same result?

    Rune
     
    Rune Allnor, Oct 2, 2009
    #2
    1. Advertisements

  3. Jackson Shen

    Jackson Shen Guest

    Thank you, Rune,

    I am not expecting they will give the same answers. One is using the conventional way -- convolution. The other is using the “svd” method. However, what I am expecting is that they should be similar in the value. When I tested it using the following code, it gives the average absolute different = 0.45633

    ans =

    0.456333520825892
     
    Jackson Shen, Oct 2, 2009
    #3
  4. Jackson Shen

    Steve Eddins Guest

    Correlation is not the same operation as convolution. They will produce
    the same results only when the filter is symmetric through the origin
    (center element). I don't understand your reference to svd.
     
    Steve Eddins, Oct 2, 2009
    #4
  5. Jackson Shen

    Jackson Shen Guest

    Thank you Steve!
     
    Jackson Shen, Oct 2, 2009
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.