Sun 07 Feb 2016 11:11:28 PM UTC, comment #2:
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.
|