From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/3773 Path: main.gmane.org!not-for-mail From: Ed L Cashin Newsgroups: gmane.comp.tex.context Subject: Re: river detection Date: 10 Jan 2001 11:58:12 -0500 Sender: owner-ntg-context@let.uu.nl Message-ID: References: <3.0.6.32.20010110092703.015d1670@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035394491 19979 80.91.224.250 (23 Oct 2002 17:34:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:34:51 +0000 (UTC) Cc: NTG-ConTeXt mailing list Original-To: Hans Hagen In-Reply-To: Hans Hagen's message of "Wed, 10 Jan 2001 09:27:03 +0100" Xref: main.gmane.org gmane.comp.tex.context:3773 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:3773 Hans Hagen 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/