I have used a Raspberry Pi credit-card computer ($45), a camera module ($25), two picture frames, two light bulbs, some wire and tape to make a book page scanner that can non-destructively capture page images of a book without destroying the book to get individual leaves or even needing to open the book up more than 90 degrees. Here is how I made my piscanner:
Here is the Python code to run the camera to take successive page images as the book is placed on the glass and pages are manually turned:
from picamera import PiCamera from time import sleep import RPi.GPIO as GPIO # Import GPIO Module GPIO.setmode(GPIO.BCM) # Configures how I am describing pin numbering GPIO.setwarnings(False) # Disable Warnings pin = 22 # this goes to a relay that controls the lamps camera = PiCamera() camera.resolution = (2592, 1944) camera.framerate = 15 # camera.awb_mode = 'incandescent' i = 1 GPIO.setup(pin, GPIO.OUT) while i < 1000: GPIO.output(pin, True) # turn on lights camera.start_preview() sleep(5) # required for autoexposure to balance print("capturing image") # turn page after seeing this message camera.capture("/home/pi/Desktop/c/image{:03d}.png".format(i)) i += 1 camera.stop_preview() GPIO.output(pin, False) # turn off lights sleep(1)
Images are scanned at a resolution that is more than sufficient for the OCR that I use. (I scan with both Abbyy and tesseract and merge the OCR results). Here is a page image from the piscanner. Click on the image for the full-sized page image.