r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Graham
8-Apr-2008
[7593]
I've got this application which does some http stuff ( posting images 
) and then waits for user input.  But after processing a bunch of 
images, VID becomes sluggish .. any suggestions as to what might 
be causing this?
Dockimbel
8-Apr-2008
[7594]
Memory overhead that triggers a lot of disk swapping ?
Henrik
9-Apr-2008
[7595]
loading images should be done into the same place, rather than just 
load them for immediate saving, e,g.


foreach source sources [write/binary target read/binary source] ; 
REBOL eats your memory for breakfast :-)

img: make binary! 1000000

foreach source sources [insert clear img read/binary source write/binary 
img] ; Should be better
Graham
9-Apr-2008
[7596]
Hmm...  I was setting the image to none afterward to release memory 
but perhaps it was not enough
Ashley
9-Apr-2008
[7597]
recycle?
Gabriele
10-Apr-2008
[7598]
henrik, unless there's a bug, that should not really be better. using 
read-io and write-io with a buffer may be better.
[unknown: 5]
10-Apr-2008
[7599]
Gabriele can you give us a brief understanding of what read-io and 
write-io are for or when to use them as I know there was a lot of 
communications from RT early on about shying away from using them.
Henrik
10-Apr-2008
[7600x2]
Gabriele, I've seen it, but I'll make a test script to see if I'm 
right.
well, now of course it doesn't work. :-) oh well.
james_nak
10-Apr-2008
[7602]
It's not my imagination that request-file/title {something} {button} 
- the button text never shows up (at least not in windows). It complains 
if it is not there but I don't think I've ever gotten it to work.
Gabriele
11-Apr-2008
[7603]
Paul, indeed read-io and write-io are no more necessary. however, 
if reusing the same memory buffer is the intent, then they're the 
only way to do that. it may be better to just copy a small part of 
the file at a time and let the GC do its job instead.
[unknown: 5]
11-Apr-2008
[7604x2]
That is very good to know Gabriele.  Thanks.
So read-io is no better than copy/part correct?
Ingo
14-Apr-2008
[7606]
I remember, that it is possible to use fonts, other than the rebol 
supplied ones, but can't remember _how_ (and haven't been able to 
find anything so far.

Is it possible to even use uninstalled fonts? (Truetype, Opentype, 
Type 2)?
Graham
14-Apr-2008
[7607x3]
yes
you just have to specifiy the path in the font definition
http://www.compkarori.com/vanilla/display/AGG
Ingo
14-Apr-2008
[7610]
Ahh, I was sure, that it would work! Thank you!
Graham
14-Apr-2008
[7611x2]
Doesn't work on all distros though ...
works on debian based distros and puppy linux that I've tested.
Ingo
14-Apr-2008
[7613]
I'm on Ubuntu, and it works for me.
Graham
14-Apr-2008
[7614]
Ubuntu is a debian based distro :)
Graham
18-Apr-2008
[7615]
Any view users here?  I'm looking for a routine that will trim the 
whitespace from an image, and will also trim junk from an image. 
I'm taking a rectangular piece of some scanned text, and if I cut 
partly thru the text above, or thru the top of the text below, I 
wish to remove those parts just keeping the word I'm interested in 
....
Henrik
18-Apr-2008
[7616]
I've been looking for something similar.
Graham
18-Apr-2008
[7617x4]
I don't really need to trim the whitespace ... just the junk
Perhaps I can just inch along the top and move down until I reach 
all whitespace across the image to reach my border.
Invert the image and then do it again ....
Henrik, are you doing some image processing too?
Henrik
18-Apr-2008
[7621]
I was thinking about an automatic cropping tool, but I'm not sure 
how to do that.
Anton
18-Apr-2008
[7622x10]
I made a very simple auto-crop function, remember ?
I can probably modify it to perform the above function...
http://anton.wildit.net.au/rebol/gfx/auto-crop.r
http://anton.wildit.net.au/rebol/gfx/demo-auto-crop.r
(that's the function from September 2007)
A possible algorithm for the new junk cropper could be:

1) advance inwards from each edge until there is a full white line 
parallel to the edge.

2) if a white line was found for each edge, then advance inwards 
again, this time searching for a non-full white line, (eg. with a 
few pixels from the desired text in it). Step back a line and you 
have your crop region.
What should I call the function that does this?
auto-trim-bitmap-text
 ?
Hmm, I like "crop" better than "trim"
auto-crop-impure-border
 ?
I think "auto-crop-bitmap-text" is the winner, for now.
Ooh. The algorithm above is too simple. The edge cases are harder 
to manage.
Graham, should the function be fully automatic or can there be user 
selection involved ? eg. we could divide the image into regions and 
let the user click the regions which are junk.
Graham, can the image be assumed to be grayscale ?
Graham
18-Apr-2008
[7632x4]
Anton, I'd like fully automatic, and yes, grayscale.
I think the algorithm can assume that if the line advances more than 
a 1/3 of the way across the depth.. there is no junk.
I personally don't need the horizontal edges cropped as it's usually 
vertical displacement that's a problem with faxes
I remembered your auto-crop function but didn't recall where it was 
.. you shift websites so often!
Anton
19-Apr-2008
[7636x2]
You should just load-thru useful looking rebol urls when you see 
them here, then you can just scan your public cache.
Are there likely to be horizontal black lines (eg. borders) which 
should be considered junk ?
Graham
19-Apr-2008
[7638]
Not in my case and I think you might then come up against the problem 
of deciding what is a border and what is a character.
Anton
19-Apr-2008
[7639x3]
Yes, I would grade the scan line according to ratio of  black : white 
 pixels on the line. Text is probably between 20-85% black pixels, 
and borders could perhaps be detected at > 95% black. Anyway, if 
you don't need it, that's much easier :)
I have something that's starting to work.

If we can preprocess the greyscale images so that they're bitonal 
(black and white), and denoised, then my algorithm has a chance.
http://anton.wildit.net.au/rebol/gfx/auto-crop-bitmap-text.r
http://anton.wildit.net.au/rebol/gfx/demo-auto-crop-bitmap-text.r
Graham
19-Apr-2008
[7642]
I'll give it a twirl