ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Ed L Cashin <ecashin@coe.uga.edu>
Cc: NTG-ConTeXt mailing list <ntg-context@ntg.nl>
Subject: Re: river detection
Date: 10 Jan 2001 11:58:12 -0500	[thread overview]
Message-ID: <m38zoj9wez.fsf@coe.uga.edu> (raw)
In-Reply-To: Hans Hagen's message of "Wed, 10 Jan 2001 09:27:03 +0100"

Hans Hagen <pragma@wxs.nl> writes:

> At 01:45 PM 1/9/01 -0500, Ed L Cashin wrote:
...
> >Would it be possible to use MP and TeX together in order to detect
> >rivers?  If so, it would be a computer typesetting first, according to
> >Thanh's thesis.  :)
> 
> I must say that my first thought was that you might had a point, but after
> half an hour metaposting [playing a bit with picture postprocessing, of
> which you can find an example in the metafun manual] i think that, given
> that there was a good method, it could as well be done in tex itself, since
> tex has as much knowlegde in this respect as metapost, i.e. the boundingbox. 

I'd call that good news!  TeX knows where all the whitespace is, and
that defines whether there are rivers or not.

> What i did was (1) converting text into pictures, (2) converting
> boundingboxes of chars into matrix points and (3) looking at the result.

But you could just do a TeX macro that expands to a kind of matrix
like this:

           (5, 6) (11, 15) (35, 40)
           (7, 9) (11, 15) (26, 30)
           (2, 4) (11, 14) (24, 26)

(there's a river at position eleven).

> Maybe some matrix guru could program an ananalyzer but my math is to weak
> for that. 

In the above example, it doesn't look too hard to look for whitespace
positions that overlap over more than, say, four lines, and have a
thickness of more than some arbitrary value.  Then one could calculate
badness.  

> I think [but thanh may disagree] that grayness is something perceptual and
> rivers are things recognized by our eyes and brain at a quite low level,
> not so much analytical. So, if there was a way that tex could send an
> paragraph shape in terms of boundingboxes to a file, and after that a
> separate process could feed that into a neural net [optionally converted to
> bitmaps so that the character shape could be taken into account], and the
> net could send back a badness value to tex, so that there could be an
> additional pass ... 

I don't know, in the example above would it be hard to write a TeX
macro that recognizes when the position ranges overlap?  (e.g., 11-15
overlaps with 11-15 in a four-unit wide overlap.  11-15 overlaps with
11-14 in a three-unit wide overlap.)

> I think that it's not that hard to extend tex with a spawned process in the
> paragraph builder and let it act upon the baddness. The main question is:
> how do we convince thanh to provide that hook, and after that, how do we
> trick ed in writing that analyzer. 

-- 
--Ed Cashin                     PGP public key:
  ecashin@coe.uga.edu           http://www.coe.uga.edu/~ecashin/pgp/


  reply	other threads:[~2001-01-10 16:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-09 18:45 Ed L Cashin
2001-01-10  8:27 ` Hans Hagen
2001-01-10 16:58   ` Ed L Cashin [this message]
2001-01-10 17:38     ` Hans Hagen
2001-01-10 18:59       ` Ed L Cashin
2001-01-11  7:56         ` Hans Hagen
2001-01-11 20:21           ` Ed L Cashin
2001-01-12 14:57   ` H. Ramm
2001-01-10 10:40 ` Frans Goddijn
2001-01-10 11:29   ` Dan Seracu
2001-01-10 11:58     ` Hans Hagen
2001-01-10 11:57   ` Hans Hagen
2001-01-10 13:14     ` Taco Hoekwater
2001-01-10 14:04       ` Hans Hagen
2001-01-10 21:07   ` H. Ramm
     [not found] <Hans Hagen's message of "Wed, 10 Jan 2001 18:38:13 +0100">

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38zoj9wez.fsf@coe.uga.edu \
    --to=ecashin@coe.uga.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).