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

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

[Octave-bug-tracker] [bug #46774] im2col produces different results comp


From: Luis Mendo
Subject: [Octave-bug-tracker] [bug #46774] im2col produces different results compared with Matlab
Date: Tue, 29 Dec 2015 12:24:50 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?46774>

                 Summary: im2col produces different results compared with
Matlab
                 Project: GNU Octave
            Submitted by: lmendo
            Submitted on: mar 29 dic 2015 12:24:49 GMT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Luis Mendo
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

Some of these are admittedly corner cases, but the output is different.

(1) Multidimensional arrays. Example code:


x = cat(3, magic(3), -magic(3));
im2col(x, [1 2])


Octave output:

ans =
   8   3   4   1   5   9  -8  -3  -4  -1  -5  -9
   1   5   9   6   7   2  -1  -5  -9  -6  -7  -2


Matlab output:

ans =
     8     3     4     1     5     9     6     7     2    -8    -3    -4    -1
   -5    -9
     1     5     9     6     7     2    -8    -3    -4    -1    -5    -9    -6
   -7    -2


My interpretation is that Matlab collapses all dimensions beyond the first.
Specifically, this reproduces Matlab's output in Octave (and in Matlab):


im2col(reshape(x, size(x,1), []), [1 2])



(2) Block size exceeds input array size. Example code:


x = 1:8;
im2col(x, [2 1])


Octave output: gives error:


error: im2col: no dimension of A can be greater than BLOCK_SIZE in sliding


Matlab output:


ans =
   Empty matrix: 2-by-0



(3) Block size exceeds input array size in dimension greater than 2 with
'distinct' option. Example code:


x = magic(3);
im2col(x, [1 2 4], 'distinct')


Octave output:


ans =

   8   3   4   6   7   2
   1   5   9   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


Matlab output: gives error:


In an assignment  A(:) = B, the number of elements in A and B must be the
same.
Error in im2col (line 70)
            x(:) = aa(i*block(1)+rows,j*block(2)+cols); 






    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Mensaje enviado vía/por Savannah
  http://savannah.gnu.org/




reply via email to

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