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

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

[Octave-bug-tracker] [bug #56141] [octave forge] (image) bwmorph option


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #56141] [octave forge] (image) bwmorph option 'endpoints' not implemented
Date: Sat, 20 Apr 2019 18:35:04 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299

Follow-up Comment #6, bug #56141 (project octave):

ok, this method is a bit too simple.  was able to test against matlab and at
least two problems:

this one fails:


>> A = [0 0 0 0 0; 0 0 1 0 0; 0 1 1 1 0; 0 0 1 0 0; 0 0 0 0 0]
A =

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


>> bwout = bwmorph(A,'endpoints)

Matlab:

bwout =

  5×5 logical array

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


Octave:

bwout =

  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



the current method runs into problems if one pixel from a corner. 

Second, I looked at the test 'skel' image again on their help page, and it
looked like matlab puts an endpoint on the intersection between the two lines
at the bottom.  zooming in, it appears that that section has the following
form:


>> logical(A(195:201,141:148))
ans =
  7×8 logical array
   0   0   0   0   0   0   0   0
   1   1   0   0   0   0   1   1
   0   0   1   1   1   1   0   0
   0   0   0   1   1   0   0   0
   0   0   1   1   1   1   0   0
   0   1   0   0   0   0   1   0
   1   0   0   0   0   0   0   1

>> bwout = bwmorph(A(195:201,141:148),'endpoints')
bwout =
  7×8 logical array
   0   0   0   0   0   0   0   0
   1   0   0   0   0   0   0   1
   0   0   0   0   0   0   0   0
   0   0   0   1   1   0   0   0
   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0
   1   0   0   0   0   0   0   1



it appears that within the same image, it doesn't care if you go from 1 to 0
or 0 to 1, it considers both as endpoints within the same image if it is only
connected to one of the same type.  Odd, but for compatibility I'll see if I
can come up with an easy fix. 


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56141>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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