Book Scanner and Viewer

Here are some tools I made for scanning and viewing books. The scanner I use is a Fujitsu fi-5015C, bought used for about $70, with some missing parts. For the automatic page detection to work, you need to paint the background of your scanner black. I used a sharpie.

bkscangui is a GUI frontend to the scanimage program which is part of the SANE package. SANE isn't very reliable, it frequently stalls the scanner for no reason or simply can't find it but it's the only thing available under Linux. (Actually, I found that this happens if you have a bad USB cable. It's not a problem with SANE.) In any case, SANE still sucks. If you stop a scanning process in the middle when SANE didn't expect it, the only way to recover your connection to the scanner is via scanner reset.

This program cuts the scanned images to remove the areas which are not part of the page and also rotates the image so that the page is shown straight. The de-rotation algorithm works pretty well most of the time but isn't foolproof. You'll occasionally need to scan some pages without rotation. Here is an example image where it fails. Most of the time, it fails because your choice of threshold didn't work very well for the paper. Try testing different thresholds in the image parameter setting window so that when you threshold the image, the program cuts the image exactly on the left and right corners.

The output format for this program is a .far archive. This is a dumb format I made myself for this program. Each archive starts with some C code which can extract the contents, so it's safe.

ipakviewer is the associated viewer. This package contains the source code for both Linux and Android.

PakVie Android application is the resulting APK for android.

The old package contains both the viewer and the encoder. The encoder is command line only, doesn't cut or rotate the pages and outputs an indexed .tar file. Scanning and encoding works by using several shell scripts and entails some manual checking and other busywork. I just put it here for archival purposes.