|
From: | Hartmut |
Subject: | [Octave-bug-tracker] [bug #51884] [octave forge] (image) bwmorph(blackNwhiteMatrix, "thicken", 1) returns negated result (+ strange behavior at border) |
Date: | Tue, 29 Aug 2017 14:16:40 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #2, bug #51884 (project octave): Here is the current source code (just type "edit bwmorph" to see it): case "thicken" ## This implementation also "thickens" the border. To avoid this, ## a simple solution could be to add a border of 1 to the reversed ## image. bw = bwmorph (! bw, "thin", n); loop_once = true; morph = @(x) bwmorph (x, "diag"); [...] if (loop_once && n > 1) n = 1; endif [...] while (i <= n) ## a for loop wouldn't work because n can be Inf bw2_tmp = morph (bw); if (isequal (bw, bw2_tmp)) ## if it doesn't change we don't need to process it further break endif bw = bw2_tmp; i++; endwhile Do you have a good suggestion how to improve this code (the "case thicken" section) with your current insight into the topic? Could you include your workaround into the code in a good way? (Or would you say that the problem is already in the "thin" subroutine?) _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51884> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |