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

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

[Octave-bug-tracker] [bug #51884] [octave forge] (image) bwmorph(blackNw


From: anonymous
Subject: [Octave-bug-tracker] [bug #51884] [octave forge] (image) bwmorph(blackNwhiteMatrix, "thicken", 1) returns negated result (+ strange behavior at border)
Date: Wed, 30 Aug 2017 05:51:37 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0

Follow-up Comment #3, bug #51884 (project octave):


## here is my suggestion for an improvement of the "thicken" case

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.

      ## 30-Aug-2017 MeJ:: going for a >>bwmorph(bw, 'thicken',
n)<< with "add border workaround"
      max_dim = max( size(bw) );
      add_border = 2 * ( min([ ceil(max_dim/2), n ]) );
      bw_framed = false(size(bw,1)+(2*add_border),size(bw,2)+(2*add_border));
      lb1 = (add_border+1); ub1 = (size(bw,1)+add_border); 
      lb2 = (add_border+1); ub2 = (size(bw,2)+add_border);
      bw_framed(lb1:ub1,lb2:ub2) = bw;
      bw = ! bwmorph (! bw_framed, "thin", n);
      loop_once = true;
      morph = @(x) bwmorph (x, "diag");
      post_morph = @(x) x(lb1:ub1,lb2:ub2);

      ## --------- original code fragement (as of octave forge package image
2.6.1)
      ##   bw = bwmorph (! bw, "thin", n);
      ##   loop_once = true;
      ##   morph = @(x) bwmorph (x, "diag");



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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