Login  Register

Re: TPainter inflation routines

Posted by Andreas.Raab on Sep 15, 2006; 5:02pm
URL: https://forum.world.st/TPainter-inflation-routines-tp129412p129415.html

David Faught wrote:
> 1.  To better see what was going on in the Form>>#traceOutlines
> method, I inserted a few lines like "outer asMorph openInWorld."  The
> morphs that came out were on the order of 2 to 3 times bigger on the
> screen than the original appeared in the viewport.  Why is that?

To avoid 1 pixel shapes which are problematic.

> 2.  In the Form>>#traceOutline:do: method, in order to find a starting
> point for edge tracing, there is a line that finds the smallest
> enclosing rectangle for a form followed by a search of the first
> returned line of that rectangle for the first non-background pixel.
> There is some extra work being done here somewhere because the
> smallest enclosing rectangle does not appear to be used anywhere else,
> and all that really needs to be searched for is the first upper left
> non-background pixel.  The bottom right of the smallest enclosing
> rectangle is of no concern here, right?  Am I missing something here?

Your observation is correct. There is no particular need for the right
and bottom border. You could probably do even random sampling to find a
starting point.

> 3.  The literature in this area that I have come across talks about 2
> main methods of extracting polygons from an image, edge tracking which
> is done here, and marching squares.  Was marching squares ever tried
> for TPainter, or is it generally regarded as inferior for some reason?

We never tried marching squares. It would be interesting to see what the
tradeoffs are compared to the current version. If it deals more robustly
with 1px shapes that alone might be worth it. Give it a try!

Cheers,
   - Andreas