The first problem I decided to solve with regards to the OCR project was getting pictures of the cards. If this was to work as an automated process, it’s going to have to have some kind of structure to be built around, and some kind of lightweight computer which can take a picture and process it. For this purpose, I purchased a Raspberry Pi Zero 2 W and a Pi Camera Module 2, as well as a few other raspi peripherals that I haven’t gotten round to using yet.
I haven’t really looked into single-board computing before, though I know a number of people who have, so this, again, seemed like a good excuse to learn.
Setting it up was a small adventure of its own, but it wasn’t long before I had it up and running, originally hooked up to a keyboard and monitor so I could interface with it without needing to worry about setting up SSH/FTP. After a bit more tinkering and dependency installation, I even had the camera working via python!
from picamera2 import Picamera2
from libcamera import controls
import time
cam = Picamera2()
config = cam.create_still_configuration(main={"size": (1960, 1960)},display="main")
cam.configure(config)
cam.start()
cam.capture_file(f"test{time.time()}.jpg")
This captured an image of the central 1960×1960 view of the camera, which, at this time, was an embarassing and poorly framed selfie that I shaln’t share.
Now that I had something that could take a picture with the comparative push of a button, I wanted to build a structure on which it could stand, to have a reliable distance and framing for the images being taken. For most modern makers, this would be the domain of 3D printing, but I do not have a 3D printer, nor access to one. What I did have, was a cardboard box, a box cutter, and some sellotape.

This is, perhaps, the least impressive thing I’ve ever made, but it would do for now. The pi was sellotaped to the top, the camera to the underside of the top piece, and the card was placed between the legs at the bottom. With this, I was able to get consistent images of cards, even if the entire setup was literally held together by tape and hope.