Yes, can definitely calculate DPI, as long as you know how big the squares are. I haven't worked on that yet, since I don't know how to get OpenCV to save as a JPG with dpi information.
In the next post is the final program source code: you will need both OpenCV 2.2 and Qt. The program is not good enough for the end user, so for now it's strictly developers only. Or Tulon only
Here also is an 8x8 checkerboard for use with the program (which assumes an 8x8 checkerboard). Print it out (making it smaller if you need to), trim it so that there is about one square of whitespace around the checkerboard, and paste it onto something fairly flat (a pane of glass is ideal). Place the calibrator on top of the platen, not under the platen. Make sure the entire checkerboard is viewable in the camera AFTER you set the location, orientation, and zoom on a typical page in your book! Then take a picture of the checkerboard on the platen. You will probably want two checkerboards so that you can calibrate both sides at the same page.
After you take the checkerboard image, remove the checkerboards, not changing the location, orientation, or zoom of the camera, and continue taking page images. You can probably get away with many tens of pages before adding another checkerboard calibration image.
Usage: ./program <Directory of images>
The program will find all the .jpg/.jpeg images in the directory, sort them alphabetically, and go through them one by one. If it finds a checkerboard, it will use it for calibration. Note that images without checkerboards take a little while to search. If a checkerboard isn't found in an image, the previous calibration will be used, and the file will be output to "dekeyed <original filename>".