bugGNU Octave - Bugs: bug #45568, image package: imfilter...

 
 

bug #45568: image package: imfilter incompatible to MATLAB for even filter width

Submitted by:  Felix <fefe>
Submitted on:  Fri 17 Jul 2015 01:01:42 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 07 Dec 2015 04:58:26 PM UTC, comment #7:

Seems good to me and passes the tests. I have pushed it http://hg.code.sf.net/p/octave/image/rev/a25350dffab4

Thank you for fixing this.

Carnë Draug <carandraug>
Project Member
Fri 04 Dec 2015 10:30:43 PM UTC, comment #6:

Could you try the attached PATCH and see if it

  • fixes this issue
  • maybe has some unwanted side effects?

(file #35642)

Hartmut <hardy>
Mon 20 Jul 2015 01:47:30 AM UTC, comment #5:

yes, sorry, didn't dig farther after seeing the conv2 in imfilter. so, with the same imfilter call, within filter2, here's the input to conv2 in Octave 4.0.0, heading into the following line of code (after [nr,nc]=size(b))

y = conv2 (x, b(nr:-1:1, nc:-1:1), shape);

Output in octave is:

same inputs into ML conv2 give:

So, we get the same answer from MLs conv2 as Octave's conv2.

Nicholas Jankowski <nrjank>
Sun 19 Jul 2015 11:26:39 PM UTC, comment #4:

I also found that the function called filter2. But when I checked filter2 at my system (3.81), it called "conv2" but with the filter being "flipped". So if we could rule out conv2 behaving differently, then it would be enough to see how signal and filter is being treated up until the point of calling conv2.

ImageGfield <imagegfield>
Sun 19 Jul 2015 07:20:21 PM UTC, comment #3:

equivalent ML output from filter2 matches Octave filter2 output. So the error seems to be in what works its way to filter2.

Nicholas Jankowski <nrjank>
Sun 19 Jul 2015 07:15:30 PM UTC, comment #2:

just doing a quick check on Felix's original code, it doesn't pass through the conv2 loop at line 121, it goes through filter2 code on line 117. (at least, setting a breakpoint at 121, it never hit it, but it calls 117

stopping at 117 here are the input parameters to filter two and the output of that function call, which is the returned value from imfilter. (I'll see if I can compare with ML soon)

Nicholas Jankowski <nrjank>
Fri 17 Jul 2015 06:35:07 PM UTC, comment #1:

Ok. Seems that imfilter, filter2 et.c. calls conv2 in the end.

I don't have Matlab so I can't check for conv2.
Can you check if the same inconsistency of functionality is true for conv2?

ImageGfield <imagegfield>
Fri 17 Jul 2015 01:01:42 PM UTC, original submission:

There is a difference in the results of MATLAB and Octave for the imfilter() function when used with even filter-sizes.

Used versions:
Octave 4.0.0
image-2.4.0

Example Code:

Matlab-Result:

Octave-Result:

Felix <fefe>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #35642:  imfilter_padding_pos.patch added by hardy (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hardy (Updated the item)
  • -unavailable- added by nrjank (Posted a comment)
  • -unavailable- added by imagegfield (Posted a comment)
  • -unavailable- added by fefe (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Dec 2015 04:58:26 PM UTCcarandraugStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release4.0.0=>other
      Operating SystemMicrosoft Windows=>Any
      Summaryimfilter incompatible to MATLAB for even filter width=>image package: imfilter incompatible to MATLAB for even filter width
    Fri 04 Dec 2015 10:30:43 PM UTChardyAttached File-=>Added imfilter_padding_pos.patch, #35642

    Back to the top


    Powered by Savane 3.1-cleanup1