X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,b639181160774d8d X-Google-Attributes: gidf996b,public X-Google-ArrivalTime: 2001-10-04 11:54:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!newsfeeds.funet.fi!newsfeed1.funet.fi!news.cc.tut.fi!uutiset.saunalahti.fi!not-for-mail From: Ilmari Karonen Newsgroups: alt.ascii-art Subject: Re: Repairing wrapped lines (was: Re: Nokia 8210) Date: 4 Oct 2001 18:53:58 GMT Organization: (dis)Order of the Holy Spoon (or whatever) Lines: 39 Message-ID: <1002220684.5186@itz.pp.sci.fi> References: <2GNs7.25353$Lc6.1427451@news1.cableinet.net> <9pamf7$h3u3l$4@ID-39741.news.dfncis.de> <3BB8EE51.38A2D080@rz.uni-karlsruhe.de> <9pg27j$i9jph$2@ID-39741.news.dfncis.de> <3BBC3C2A.77DCA130@rz.uni-karlsruhe.de> Reply-To: Ilmari Karonen NNTP-Posting-Host: simpukka.saunalahti.fi X-Trace: tron.sci.fi 1002221638 3168 195.74.0.20 (4 Oct 2001 18:53:58 GMT) X-Complaints-To: newsmaster@saunalahti.fi NNTP-Posting-Date: 4 Oct 2001 18:53:58 GMT User-Agent: postit.pl 0.05 Xref: archiver1.google.com alt.ascii-art:8338 In article <3BBC3C2A.77DCA130@rz.uni-karlsruhe.de>, Markus Gebhard wrote: > >1) How many lines belong together? Usually it is sometimes 1, and then >2,3,4... with decreasing propability. I think it would be ok to have an >algorithm that can handle 1,2 and 3. It occurs to me that this step might not be too hard -- we can simply do it the way a human would detect linewrapping. * A wrapped image will look "interlaced" -- line N will resemble N+2 (or N+3, etc.) more than it resembles line N+1. * An image that has been needlessly unwrapped will contain two (or more) similar pictures side by side -- some of these may be distorted because of loss of spaces, but that shouldn't matter too much. So a basic approach might be to compute some sort of histogram checksum for each line -- the goal is to derive a number which will change more or less continuously in an unwrapped image, but will jump sharply in a wrapped image. Then try to unwrap lines until the jumps are minimized. Considering the first and possibly second derivates of the values might also help, since one would expect those to change continuously too. I think this could work pretty well for solid-style images. I guess I should try coding a prototype to test... >2) How many space characters have to be added between the pieces? Well, if the first step has already been successful, this step doesn't have to be perfect -- once the image has the right number of lines, adding spaces as necessary is much easier for a human. -- . _, .. j u s t. h o w l.i n g i n .t h e n.i g h t .. ._, . , )'' . /\_ . ' ,/\ . , ``( , _\__/ |__.'\._______,--;_'_`-.___,.______,/_,_`.__,-.__'__,/`-._,_| \____ ,_f_)\. Ilmari Karonen iltzu@sci.fi http://www.sci.fi/~iltzu/ /(_|_,.