Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.programming Subject: Re: Simplifying wiggly paths Date: Sun, 11 Dec 2022 23:49:31 +0000 Organization: A noiseless patient Spider Lines: 26 Message-ID: <87h6y15wms.fsf@bsb.me.uk> References: <87a3b9f7-19e0-4988-b1cf-63da65ad9cefn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="64eb1f70972bcdcb521e3c869dba0194"; logging-data="2152267"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180T5a/Sndl7uaMw8Cd3YTrhTGYnxRA97M=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:5+fyLomUysJcejSpQFbd90xtY7s= sha1:3uugQjCYUGTMfb8NODa52WfBMWc= X-BSB-Auth: 1.173293c1615c9d02fd9b.20221211234931GMT.87h6y15wms.fsf@bsb.me.uk Xref: csiph.com comp.programming:16062 Malcolm McLean writes: > I'm working on a problem where a user enters a degraded, wiggly curve > (it's actually created by tracing software from what might have been > once a rectangle, for example, but has been physically printed, then > scanned, and so on, so that there are plenty of stray pixels picked up > by the tracing software). > > So basically what I want to do is sample the curve at a fairly low > resolution, then re-fit it, to get rid of the noise. However I want to > retain the genuine sharp corners. So in the rectangle case, the > desired output wouldn't be a mathematical rectangle, but it would be > four clean almost straight curves, connected by four corners of almost > ninety degreees. > > The curve tends to go back on itself. It's like a coastline. It's easy > to pick out the real curve from the noise by eye, but harder to do it > automatically. How is this going? I can't help, but I was hoping so see some interesting discussion as it seems both challenging and likely to have been solved before (though possibly with constraints that don't match your circumstances). -- Ben.