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

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

[Octave-bug-tracker] [bug #50656] image package: bwerode does not return


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #50656] image package: bwerode does not return right size when there's more dimensions on conn
Date: Mon, 27 Mar 2017 17:31:40 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #1, bug #50656 (project octave):

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. 

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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