Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

Two newcomer problems

Discussion about Steve DeVore's Book Scan Wizard, a power-user package to automate scan processing.
DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Two newcomer problems

Post by DanE » 12 Nov 2013, 19:08

Hi all,

Problem 1
Running the web start ends up with a dialog that says:
Unable to launch the application
Book Scan Wizard
Steve Devore
http://bookscanwizard.sourceforge.net

After much tinkering I was able to get the local jar to run.

Problem 2
I have a set of tiffs of a book that was scanned flat so each tiff has two facing pages.
I can't figure out how to use crop to extract the left half and the right half of each image into separate pages for the purpose of assembling the output book.

It seems like someone must have encountered this before. How is it done?

Thanks

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

Re: Two newcomer problems

Post by steve1066d » 12 Nov 2013, 22:44

For your first problem... It does appear that the Webstart version is broken. Oracle has tightened security and it must not like something I'm doing. I'll take a look and try to fix it.

For your second issue, if you have both the left & right images on the same scanned page, use the

LoadLRImages = .

If that points to a directory that has a L & R subdirectories, they will be used for the left and right pages. However, if instead points to a directory that has files in it, it will use the same image for both the left & right images, which can be cropped separately.

Hope that helps, and let me know if you have any other questions.
Steve Devore
BookScanWizard, a flexible book post-processor.

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: Two newcomer problems

Post by DanE » 13 Nov 2013, 01:00

Thanks, I will give it a go.

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: Two newcomer problems

Post by DanE » 13 Nov 2013, 02:17

Hi,

The cropping and LR stuff seems to be working visually. The left and right crops are within the page area that shows on the display ...but...
When I submit I get the following and the PDF is corrupted (According to Acrobat). I presume there is something else that I am supposed to do or something that I didn't understand. Any suggestions for the next step?

Thanks,
Dan

java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Crop The rectangular crop area must not be outside the image. for 1600,17, 3128,2478
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at net.sourceforge.bookscanwizard.BSW$4.run(BSW.java:453)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Crop The rectangular crop area must not be outside the image. for 1600,17, 3128,2478
at net.sourceforge.bookscanwizard.op.Crop.performOperation(Crop.java:84)
at net.sourceforge.bookscanwizard.Operation.performOperations(Operation.java:355)
at net.sourceforge.bookscanwizard.BSW.processFile(BSW.java:504)
at net.sourceforge.bookscanwizard.BSW.access$500(BSW.java:72)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:394)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:391)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
... 1 more
Caused by: java.lang.IllegalArgumentException: Crop The rectangular crop area must not be outside the image.
at javax.media.jai.JAI.createNS(JAI.java:1091)
at javax.media.jai.JAI.create(JAI.java:977)
at javax.media.jai.JAI.create(JAI.java:1399)
at net.sourceforge.bookscanwizard.op.Crop.performOperation(Crop.java:82)
... 10 more
ScaleToDPI source dpi matches destination dpi. Skipping this step
^[[Bthumbnail failed


The script is:
# Book Scan Wizard Script
# http://bookscanwizard.sourceforge.net
# /Users/essin/BookScanWork

# *** Load Files ***
# the source directory
LoadLRImages = source

# Override source DPI
SetSourceDPI = 300

# The Destination directory
SetDestination = pdf

# *** Page Rotations ***
Pages = left
Pages = right

# *** Remove Pages ***
# *** Perspective ***
# *** Crops ***
Pages = left
Crop = 26,20, 1516,2400
Pages = right
Crop = 1600,20, 3128,2400
# *** Filters ***
Color = gray

#Change to a binary (black & white) image, with a clipping point of 60%
Color=bw 60

# *** Scaling ***
Pages = all
# Rescale the image to match the final DPI
ScaleToDPI=300

# This will ensure the left and right pages are exactly the same size.
ScaleToFirst=

# *** Output ***
Pages=all
CreatePDF = BookScanWork.pdf

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: Two newcomer problems

Post by DanE » 13 Nov 2013, 05:46

I've spent the last several hours trying various possibilities to get things to work.
The jpegs have the issues described above. Complaints about cropping being out of bounds, even if no crop has been applied.
TIFFS and PNGS complain about color setting mismatches of various sorts, about which I know so little that I can reason about them.
jpeg2000s say Coordinate out of bounds and generate the following and leave a tiny, corrupted pdf:
CreatePDF Creating /Users/essin/BookScanWork/pdf/BookScanWork.pdf
could not read using JAI.. tring ImageIO..
java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at net.sourceforge.bookscanwizard.BSW$4.run(BSW.java:453)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.IntegerInterleavedRaster.getDataElements(IntegerInterleavedRaster.java:264)
at java.awt.image.BufferedImage.getData(BufferedImage.java:1428)
at javax.media.jai.RenderedImageAdapter.getData(RenderedImageAdapter.java:166)
at javax.media.jai.GeometricOpImage.computeTile(GeometricOpImage.java:676)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:912)
at javax.media.jai.OpImage.getTile(OpImage.java:1139)
at javax.media.jai.PlanarImage.copyData(PlanarImage.java:2356)
at javax.media.jai.RenderedOp.copyData(RenderedOp.java:2310)
at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2538)
at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2559)
at net.sourceforge.bookscanwizard.util.Utils.renderedToBuffered(Utils.java:38)
at net.sourceforge.bookscanwizard.op.CreatePDF.performOperation(CreatePDF.java:95)
at net.sourceforge.bookscanwizard.Operation.performOperations(Operation.java:355)
at net.sourceforge.bookscanwizard.BSW.processFile(BSW.java:504)
at net.sourceforge.bookscanwizard.BSW.access$500(BSW.java:72)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:394)
at net.sourceforge.bookscanwizard.BSW$ProcessImages$1.call(BSW.java:391)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
... 1 more
ImageRequest null
ImageRequest null


I'm really at a loss as to how to sort this out. The previews of the pages look fine on the screen, the sequence of pages is correct and the image files (all generated by Acrobat Save as...) have used the default settings. I kind of hoped that by supplying input in the default formats, and by trying to minimize the number of custom processing tweaks, that things would simply work. They don't and there really isn't much to go on when it comes to figuring out why.

Anything you could tell me that might help to get this working would be greatly appreciated.

As an aside - I have been able to get the facing pages separated and recombined into a pdf using only the facilities in Acrobat but it would be so much better if BSW would work. Acrobat isn't really equipped to handle perspective, barrel distortion and some of the other issues I anticipate when I begin to use the DIY scanner.

It's now 2 AM. I've been at this for 7 hours straight and it's time to call it quits for the day.
Thanks,
Dan

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

Re: Two newcomer problems

Post by steve1066d » 13 Nov 2013, 10:30

I'm sorry for your frustration, but I really appreciate the report.

The issue appears to be that BSW doesn't create PDF files of bitonal images correctly. I'll try to look into fixing that. I maybe be able to do that this evening (CST).

For now, you could create a similar effect by leaving it as grayscale, and using this Levels command:

Levels = 59 60

Also, the way you have it, the conversion to bitonal only happens on the right side pages, because that was what the previous Page operation set it to.

Here's an updated version of your config

Code: Select all

# Book Scan Wizard Script
# http://bookscanwizard.sourceforge.net
# /Users/essin/BookScanWork
# *** Load Files ***
# the source directory
LoadLRImages = source

# The Destination directory
SetDestination = pdf

# *** Remove Pages ***

# *** Perspective ***

# *** Crops ***
Pages = left
Crop = 26,20, 1516,2400
Pages = right
Crop = 1600,20, 3128,2400

# *** Filters ***
Pages = all
Color = gray
Levels = 59 60

#Change to a binary (black & white) image, with a clipping point of 60%
#Color=bw 60

# *** Scaling ***
Pages = all
# Overrides the destination DPI to 300  (does not scale the image)
SetDestinationDPI = 300

# This will ensure the left and right pages are exactly the same size.
ScaleToFirst=

# *** Output ***
Pages=all
CreatePDF = BookScanWork.pdf
Steve Devore
BookScanWizard, a flexible book post-processor.

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

Re: Two newcomer problems

Post by steve1066d » 13 Nov 2013, 20:57

I fixed the problem with saving Bitonal images. Try downloading the new version (2.0 beta4): http://sourceforge.net/projects/booksca ... t/download

There's still a problem with the Webstart version.. I'll try to work on that in a couple of days as well.
Steve Devore
BookScanWizard, a flexible book post-processor.

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: Two newcomer problems

Post by DanE » 15 Nov 2013, 00:59

Hi Rob,
I downloaded the new version and used the script you provided. It was necessary to adjust the R crop to:
Pages = right
Crop = 1600,20, 3126,2400

because there was a java exception that 3128 was out of bounds.

I provided a set of jpg files for input. The process went of without complaints and produced a very nice pdf that looks like the original - each pdf page contains two facing pages. I ran the same script on jpeg2000 files and it generated a slew of error messages and a corrupted pdf. The messages either one or the other of the following:
could not read using JAI.. tring ImageIO..
ImageRequest null

There were a whole bunch of each, probably one for each of the 44 image files.

I presume that the file type dropdown on the initial screen refers to the kind of output you wish and not the kind of input file you are providing?

What's the next step?

Thanks,
Dan

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

Re: Two newcomer problems

Post by steve1066d » 15 Nov 2013, 01:12

Dan,

I've never tried using jpeg2000 as source images. I just did a quick look and it looks like it doesn't work (they do work as an output format, however).

I'll see if there's a way that I can support that.

I'm curious what you are using that you have source files in jpeg2000 format.
Steve Devore
BookScanWizard, a flexible book post-processor.

DanE
Posts: 30
Joined: 17 Oct 2013, 03:09
Number of books owned: 0
Country: US

Re: Two newcomer problems

Post by DanE » 15 Nov 2013, 10:06

Hi Rob,

I'm in the ptocess of assembling Dan's Boo Scanner Kit, but in the meantime I jave a couple of pdfs that were scanned with two facing pages per pdf page and I'm trying to split these to make them easier to read on the iPad. I'm using acrobat to "save as..." and yje umage options are jpg, jpf *jpef2000) and png. I've tried all 3 as as source files to BSW.

Dan

Post Reply