[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #46774] im2col produces different results comp
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #46774] im2col produces different results compared with Matlab |
Date: |
Sun, 07 Feb 2016 23:11:29 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.6.0 |
Follow-up Comment #2, bug #46774 (project octave):
Just curious, did you found these bug by accident or do you have code that
relies on these Matlab corner cases?
In short, I fixed issue (2) for Matlab compatibility. However, I will not
change (1) and (3) since they are required to support images of N dimensions.
Either Matlab does not support images with higher number of dimensions or
there's a bug on their code. If you have an account with Mathworks, could you
fill a bug report with them?
== (1) Multidimensional arrays. ==
Octave's im2col handles N dimensional input. Matlab does not throw an error
but its output is obviously incorrect. I'm guessing that either Matlab's
im2col is not meant to use with arrays with more than 2 dimensions, or it has
a bug.
Can you please fill a bug report against Matlab? I have seen this happening
before, so my guess is that somewhere in their code they do "[rows, cols] =
size (image)" and then actually use it, forgetting that columns becomes the
cumulative product of all other dimensions.
== (2) Block size exceeds input array size ==
The fix for this was just removing that input check and to automatically
becomes Matlab compatible. Unfortunately, there is a bug in Octave which
prevents automatic broadcasting with dimensions of length zero
https://savannah.gnu.org/bugs/?47085 so I had to regress back to use bsxfun.
Anyway, It is fixed here
http://hg.code.sf.net/p/octave/image/rev/0fc684589226
== (3) Block size exceeds input array size in dimension greater than 2 with
'distinct' option ==
If it is not possible to make complete blocks of the image, then it is treated
as if padded with zeros. This seems to be the same for Matlab. I don't know
why Matlab does not do the same for the other dimensions but considering the
other bugs you're reporting, I'm guessing it's really not coded to support
more dimensions.
Note that Octave does support more dimensions which Matlab does not at all and
fixing this would impact on that.
x = repmat (magic (3), [1 1 2])
im2col (x, [1 2 2], "distinct")
im2col (x, [1 2 3], "distinct")
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46774>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #46774] im2col produces different results compared with Matlab,
Carnë Draug <=