octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #45568] imfilter incompatible to MATLAB for ev


From: Nick Jankowski
Subject: [Octave-bug-tracker] [bug #45568] imfilter incompatible to MATLAB for even filter width
Date: Mon, 20 Jul 2015 01:47:30 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0

Follow-up Comment #5, bug #45568 (project octave):

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);


debug> x
x =

   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0
   0   0   0   1   1   0   0   0   0
   0   0   0   1   1   0   0   0   0
   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0

debug> b
b =

   0   0   0   0
   0   1   1   0
   0   0   0   0
   0   0   0   0

debug> b(nr:-1:1,nc:-1:1)
ans =

   0   0   0   0
   0   0   0   0
   0   1   1   0
   0   0   0   0

debug> shape
shape = valid


Output in octave is:

debug> conv2 (x, b(nr:-1:1, nc:-1:1), shape)
ans =

   0   0   0   0   0   0
   0   0   0   0   0   0
   0   1   2   1   0   0
   0   1   2   1   0   0
   0   0   0   0   0   0
   0   0   0   0   0   0


same inputs into ML conv2 give:


>> x=zeros(9,9);x(4:5,4:5)=ones(2,2)

x =

     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     1     1     0     0     0     0
     0     0     0     1     1     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0

>> b = zeros(4,4);b([6,10])=1

b =

     0     0     0     0
     0     1     1     0
     0     0     0     0
     0     0     0     0

>> [nr,nc]=size(b)

nr =

     4


nc =

     4

>> shape='valid'

shape =

valid

>> conv2 (x, b(nr:-1:1, nc:-1:1), shape)

ans =

     0     0     0     0     0     0
     0     0     0     0     0     0
     0     1     2     1     0     0
     0     1     2     1     0     0
     0     0     0     0     0     0
     0     0     0     0     0     0


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

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45568>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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