TWAIN with Java question

I'm testing the Gnome 4.2 API and it works reasonable well, but, how can you tweak the parameters for better quality scans for b&w pages ?

I need to capture contracts (not for OCR, just the best snapshot I can get for database storage) in b&w.

I can get a fair job, but correction s/w for the HP ScanJet 5300c at the same 150dpi or 300dpi settings does a night and day better job at it than GNOME currently is (at least how I'm capturing currently).

I've tried setting the threshold, shadow, highlight, brighness, contrast, etc. but to no effect.

Here's the settings i've tried:

...

twain = new Twain();

// Turn off dialogs

twain.setSelectSource(false); // Pop up Select Source window - i.e. the scanner/camera on the PC

twain.setVisible(false); // Pop up Twain user interface.

twain.setPixelType(Twain.RGB);

twain.setThreshold(150);

twain.setShadow(100);

twain.setHighLight(100);

twain.setFeederEnabled(true);

twain.setAutoFeed(true);

twain.setAutoBrightness(true);

// twain.setBrightness(200);

// twain.setContrast(300);

// Quality settings

twain.setCurrentUnits(Twain.INCHES);

twain.setXResolution(dpi); // where dpi=100,150,300

twain.setYResolution(dpi);

// Default to the original size as scanned in.

twain.setXScaling(1.0);

twain.setYScaling(1.0);

twain.setExceptionMask(Twain.SETTHRESHOLD|Twain.SETHIGHLIGHT|Twain.SETSHADOW);

// Grab the image now

Image image = Toolkit.getDefaultToolkit().createImage(twain);

...

NOTE: At the end, I switch the Image to a JPEG (maximum quality) and storage this in the database. (Currently saving to the file system just to use tools to check the quality of the scan).

[1818 byte] By [sphicks] at [2007-9-26 2:49:53]
# 1
Hi , EVen I was trying to use the Gnome Twain package, but what di I need first on my machine, I dont have a scanner right now. Where do I get a driver for any TWAIN compliant scanner. I am not able to begin on this.Thanx,Rajeev
rajeevmsingh at 2007-6-29 10:36:07 > top of Java-index,Archived Forums,Java Programming...