Building a megapixel digital camera from a flatbed scanner