There are many challenges with my DIY bookscanner. I plan to document them sometime... The biggest modification was to replace the plexi glass with the top part of a scanner, because the plexi was very much scratched after a few books. Spreading the light with a semi-transparent cover near to the lamp was also necessary.
Most annoying of all problems was the barrel distortion of the camera. This made the whole equipment no competition to the flatbed scans of old books that are already scanned, that I also plan to scan to improve quality.
ImageMagick can remove barrel distortion, but I failed to work out the magic numbers that the operation requires. PhotoShop supports only high-end cameras, while my bookscanner uses a compact Canon SX150IS camera (with CHDK support).
Then PTLens come to the rescue.
Move your mouse over the image to see correction (or see the image below). PTLens supports my (and many other) cameras out of the box and does a wonderful job.
PTLens is a commercial software and runs on Windows, but it runs well in Wine on my Ubuntu 13.10.