bugGNU Octave - Bugs: bug #50656, [octave forge] (image) bwerode...

 
 

bug #50656: [octave forge] (image) bwerode does not return right size when there's more dimensions on conn

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Mon 27 Mar 2017 05:11:51 PM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  other Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Sun 02 Apr 2017 06:21:26 AM UTC, comment #2: 

Running

imerode (true (5), ones (3, 3, 3))
imerode (true (5), ones (3, 3, 3))
imerode (true (5), ones (3, 3, 3))
imerode (true (5), ones (3, 3, 3))
imerode (true (5), ones (3, 3, 3))

every run has a different result. How could it be?

Avinoam Kalma <avinoam>
Project Member
Mon 27 Mar 2017 09:31:40 PM UTC, comment #1: 

I'm getting different output. On octave 4.2.1 with image 2.6.1:

>> imerode (true (3), ones (3, 3, 3))
ans =

  0
  0
  0

>> imerode (true (5), ones (3, 3, 3))
ans =

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

on matlab 2016b:

>> imerode (true(3),ones(3, 3,3))
ans =
  3×3 logical array
   1   1   1
   1   1   1
   1   1   1

>> imerode (true (5), ones (3, 3, 3))
ans =
  5×5 logical array
   1   1   1   1   1
   1   1   1   1   1
   1   1   1   1   1
   1   1   1   1   1
   1   1   1   1   1

So that's at least a compatibility concern.

and then with the test:

>> bw = false (5);
>> bw(1:4,2:4) = true
bw =
  5×5 logical array
   0   1   1   1   0
   0   1   1   1   0
   0   1   1   1   0
   0   1   1   1   0
   0   0   0   0   0
>> bwperim (bw, conndef (6))
Not enough input arguments.
Error in conndef (line 38)
type = validatestring(type, {'minimal', 'maximal'},...

it seems like octave's conndef supports non-compatible syntax. I.e., matlab only likes the third version of:

 -- Loadable Function: conndef (CONN)
-- Loadable Function: conndef (MASK)
-- Loadable Function: conndef (NDIMS, TYPE)

best I can tell from the help, conndef(6) should be the same as conndef(3,'minimal'), so:

>> bw = false (5);
>> bw(1:4,2:4) = true
bw =
  5×5 logical array
   0   1   1   1   0
   0   1   1   1   0
   0   1   1   1   0
   0   1   1   1   0
   0   0   0   0   0
>> bwperim (bw, conndef (3,'minimal'))

runs without problem and produces a small image of what appears to be a black U overtop of white pixels.  Saw the same error for octave.

Nicholas Jankowski <nrjank>
Mon 27 Mar 2017 05:11:51 PM UTC, original submission:  

Not sure at the moment if this is a single bug or multiple bugs.  These are probably inherited from the strel class and some of optimisations we do, so they probably also affect other functions


imerode (true (3), ones (3, 3, 3))
ans =

  1
  1
  0

imerode (true (5), ones (3, 3, 3))
ans =

  0  0  0
  0  0  0
  0  0  0
  0  0  0
  0  0  0


## This should not give an out of memory, should use very small intermediary arrays
## May be a separate bug
%!test
%! bw = false (5);
%! bw(1:4,2:4) = true
%! assert (bwperim (bw, conndef (6)), bw)

The error comes from:

imerode (true (5), conndef(6))
error: out of memory or dimension too large for Octave's index type


Carnë Draug <carandraug>
Project Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by carandraug (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-12 jwe Summaryimage package: bwerode does not return right size when there's more dimensions on conn => [octave forge] (image) bwerode does not return right size when there's more dimensions on conn

    Back to the top


    Powered by Savane 3.5