Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #229031

Re: color border in image, drop everything outside of it

Path csiph.com!weretis.net!feeder8.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: color border in image, drop everything outside of it
Date Tue, 24 Nov 2020 20:50:01 +0100
Message-ID <BeMu5-6Gi-3@gated-at.bofh.it> (permalink)
References <Bbdjb-7Ih-7@gated-at.bofh.it> <BbmFP-4Uy-9@gated-at.bofh.it> <BdN8R-3kG-1@gated-at.bofh.it> <BdOoh-469-3@gated-at.bofh.it> <BdP0Z-4yw-1@gated-at.bofh.it> <BecqB-1TO-3@gated-at.bofh.it> <BecAh-1YW-1@gated-at.bofh.it>
X-Mailbox-Line From debian-user-request@lists.debian.org Tue Nov 24 19:46:29 2020
Old-Return-Path <pdkcox@cox.net>
X-Amavis-Spam-Status No, score=-2.216 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, BODY_8BITS=1.5, HEADER_FROM_DIFFERENT_DOMAINS=0.249, LDO_WHITELIST=-5, LONGWORDS=2.035, RCVD_IN_DNSWL_NONE=-0.0001, WORD_WITHOUT_VOWELS=1] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate:hard: -5.5
Authentication-Results cox.net; auth=pass (PLAIN) smtp.auth=pdkcox@cox.net
X-Authority-Analysis v=2.4 cv=UpCmi88B c=1 sm=1 tr=0 ts=5fbd6304 a=kkeJ8LlWWq7dYbO4WG5cmA==:117 a=kkeJ8LlWWq7dYbO4WG5cmA==:17 a=xNf9USuDAAAA:8 a=KW-WbbpNvEddCpji7vIA:9 a=QEXdDO2ut3YA:10 a=znsX1DIM4VgA:10 a=0jV0BkGkILMA:10 a=h5VInT2kEsvbCrA4zs0A:9 a=SEwjQc04WA-l_NiBhQ7s:22
Reply-To debian-user@lists.debian.org
MIME-Version 1.0
Content-Type multipart/mixed; boundary="bp/iNruPH9dso1Pn"
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.10.1 (2018-07-13)
X-Cmae-Envelope MS4xfAsvxxfm8aman4oRNH7NF7TUaJ8jXxG+ewZl8jyQ9aWaXPjdJttB8fxZ0naxDsArKekQ7sCZMPU5FaXa9JRdBb/UwaeBFyJb07hTGb2XUgrzYQQ2U1Nd uDWa8dBmPBaacDH8kLTebY9A8ckZdI2T6TAbAlvnQNqMwp6wIJXDybUYgIbswjYIjweDHQVWSf3Wl6vVljyJSiRiT1BBJz4YI2SQfnyF5uGUATk0rBTUPkRF jD+F2a6ZBKvCIB2fqeEtIT/nYlUqRZIsCFslAmyfbvA=
X-Mailing-List <debian-user@lists.debian.org> archive/latest/769449
List-ID <debian-user.lists.debian.org>
List-URL <https://lists.debian.org/debian-user/>
List-Archive https://lists.debian.org/msgid-search/20201124194610.GD12503@axis.corp
Approved robomod@news.nic.it
Lines 134
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Tue, 24 Nov 2020 13:46:10 -0600
X-Original-Message-ID <20201124194610.GD12503@axis.corp>
X-Original-References <87a6vjfrcl.fsf@zoho.eu> <20201115093851.GB30998@tuxteam.de> <874kliywc6.fsf@zoho.eu> <20201122033435.GF21458@axis.corp> <873612xc2m.fsf@zoho.eu> <20201123051701.GB7786@axis.corp> <87d0047ijd.fsf@zoho.eu>
Xref csiph.com linux.debian.user:229031

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon 23 Nov 2020 at 06:23:50 (+0100), Emanuel Berg wrote:
> > I don't understand what you mean by "sensible" data.
> > Your example
> >
> >   .........
> >   ...sss...
> >   ..skkks..
> >   ..sssss..
> >   ....ss...
> >
> > is a completely convex blob. Are we to understand that as
> > a constraint? Or are re-entrant shaped loops allowed? What sort
> > of re-entrants?
> 
> I have described the intention using everyday language.
> 
> Then I described the algorithm that would accomplish this.
> 
> Finally, I provided this ascii art example.
> 
> If that still isn't enough, well, you know what they say, it ain't
> worth it explaining to someone who doesn't understand.

Fair enough, but I thought you were worth explaining it to, so here
goes with some ascii art. I started with a larger image than yours at
https://lists.debian.org/debian-user/2020/11/msg00496.html
but using the same notation, and I carried out your algorithm at
https://lists.debian.org/debian-user/2020/11/msg00494.html
but showing my working by leaving arrows as the scan passed.

The first pass is simple, with 'd' turning into →. In the second
pass, I've only shown ↓ where there was still a 'd' to be dropped,
so there aren't any ↓ marks down the lefthand side or along the
top, as those have already been dropped. (If you're unconvinced,
a 'trampling' version is attached.)

Similarly for the third and fourth passes. This last scan does
nothing of course because it either scans up over points already
dropped, or hits an 's' and stops.

As you can see, there are several 'd's left at the end of all four
scans, which your algorithm misses because the 's' loop stopped
the scan from reaching them.

    Original                     Scanned

ddddddddddddddddddddddddd    →→→→→→→→→→→→→→→→→→→→→→→→→
ddddddddddddddddddddddddd    →→→→→→→→→→→→→→→→→→→→→→→→→
ddddsssssssssssssssssdddd    →→→→sssssssssssssssss↓↓↓↓
ddddskkkkkkkkkkkkkkksdddd    →→→→skkkkkkkkkkkkkkks↓↓↓↓
ddddskkkkkkkkkkkkkkksdddd    →→→→skkkkkkkkkkkkkkks↓↓↓↓
ddddskkkkkkkssssskkksdddd    →→→→skkkkkkkssssskkks↓↓↓↓
ddddskkkkkkksddddskksdddd    →→→→skkkkkkksddddskks↓↓↓↓
ddddskkkkkkksdddddsssdddd    →→→→skkkkkkksdddddsss↓↓↓↓
ddddskkkkkkksdddddddddddd    →→→→skkkkkkks←←←←←←←←↓↓↓↓
ddddskkkkkkksdddddddddddd    →→→→skkkkkkks←←←←←←←←↓↓↓↓
ddddskkkkkkksdddddddddddd    →→→→skkkkkkks←←←←←←←←↓↓↓↓
ddddskkkkkkksdddddddddddd    →→→→skkkkkkks←←←←←←←←↓↓↓↓
ddddskkkkkkksdddddddddddd    →→→→skkkkkkks←←←←←←←←↓↓↓↓
dddddskkkkkkksddddddddddd    →→→→→skkkkkkks←←←←←←←↓↓↓↓
ddddddskkkkkkksdddddddddd    →→→→→→skkkkkkks←←←←←←↓↓↓↓
dddddddskkkkkkksddddddddd    →→→→→→→skkkkkkks←←←←←↓↓↓↓
ddddddskkkkkkkkksdddddddd    →→→→→→skkkkkkkkks←←←←↓↓↓↓
dddddskkkkkkkkkkksddddddd    →→→→→skkkkkkkkkkks←←←↓↓↓↓
ddddskkkkkkkkkkkkksdddddd    →→→→skkkkkkkkkkkkks←←↓↓↓↓
ddddssssssssssssssssddddd    →→→→ssssssssssssssss←↓↓↓↓
ddddddddddddddddddddddddd    →→→→→→→→→→→→→→→→→→→→→→→→→
ddddddddddddddddddddddddd    →→→→→→→→→→→→→→→→→→→→→→→→→

    Achieved                     Desired

.........................    .........................
.........................    .........................
....sssssssssssssssss....    ....sssssssssssssssss....
....skkkkkkkkkkkkkkks....    ....skkkkkkkkkkkkkkks....
....skkkkkkkkkkkkkkks....    ....skkkkkkkkkkkkkkks....
....skkkkkkkssssskkks....    ....skkkkkkkssssskkks....
....skkkkkkksddddskks....    ....skkkkkkks....skks....
....skkkkkkksdddddsss....    ....skkkkkkks.....sss....
....skkkkkkks............    ....skkkkkkks............
....skkkkkkks............    ....skkkkkkks............
....skkkkkkks............    ....skkkkkkks............
....skkkkkkks............    ....skkkkkkks............
....skkkkkkks............    ....skkkkkkks............
.....skkkkkkks...........    .....skkkkkkks...........
......skkkkkkks..........    ......skkkkkkks..........
.......skkkkkkks.........    .......skkkkkkks.........
......skkkkkkkkks........    ......skkkkkkkkks........
.....skkkkkkkkkkks.......    .....skkkkkkkkkkks.......
....skkkkkkkkkkkkks......    ....skkkkkkkkkkkkks......
....ssssssssssssssss.....    ....ssssssssssssssss.....
.........................    .........................
.........................    .........................

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-15 00:40 +0100
  Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 10:00 +0100
    Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-15 10:10 +0100
      Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 11:10 +0100
        Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 11:30 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:30 +0100
  Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 10:40 +0100
    Re: color border in image, drop everything outside of it The Wanderer <wanderer@fastmail.fm> - 2020-11-15 11:30 +0100
      Re: color border in image, drop everything outside of it Jeremy Ardley <jeremy@ardley.org> - 2020-11-15 12:00 +0100
      Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 12:10 +0100
        Re: color border in image, drop everything outside of it The Wanderer <wanderer@fastmail.fm> - 2020-11-15 12:50 +0100
          Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 13:30 +0100
      Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 12:10 +0100
        Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 12:50 +0100
      Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:20 +0100
    Re: color border in image, drop everything outside of it mick crane <mick.crane@gmail.com> - 2020-11-15 11:40 +0100
    Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:20 +0100
      Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-22 04:40 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 05:20 +0100
          Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-23 06:20 +0100
            Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-23 06:30 +0100
              Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-24 20:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-24 22:40 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-24 22:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 01:30 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 09:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 12:30 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 12:40 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 12:50 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 14:10 +0100
      Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-22 10:10 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 10:30 +0100

csiph-web