I'm currently an undergraduate math student, and had similar frustration, but I reached a different solution. I built a cheap chalkboard in my room (hardboard panel that I painted with chalkboard paint – $15 total since I used a trash-picked board). For scanning, I mounted a Raspberry Pi with a camera, and did some basic OpenCV image processing to extract the image. All told, it took a weekend to build and set up, and I have used it every day since.
This same setup could easily be mounted at a different angle for scanning papers laid flat on a desk, and would work with nearly no modification.
The image processing pipeline for me was:
- Gaussian blur
- Brightness/color thresholding
- Finding and simplifying the contours
- Computing the convex hull for each contour (in case the board is partially occluded)
- Using a heuristic to pick the contour most likely to be the chalkboard
- Extracting corners from the contour and doing a "getPerspectiveTransform" followed by "warpPerspective"
- Sharpen the image (subtract Gaussian blurred version)
- Return the image via Flask server so I can pull scans onto my phone or computer over LAN
The same pipeline is reused for a live feed (MJPEG) that I can split-screen with my webcam (via OBS) for collaboratively working on homework problems via video call. The live stream is accessed via a different Flask route that calls many of the same helper functions.
The code is not yet publicly released, but was very straightforward to write; each of the steps mentioned above is pretty much one OpenCV function call. Here is a sample scan and a demo video:
Thanks. This is very nice. I will do some experiments with my phone camera at the angle I indicate and might take help from you for OpenCV (been 10 years since I used it in undergrad).
This same setup could easily be mounted at a different angle for scanning papers laid flat on a desk, and would work with nearly no modification.
The image processing pipeline for me was:
The same pipeline is reused for a live feed (MJPEG) that I can split-screen with my webcam (via OBS) for collaboratively working on homework problems via video call. The live stream is accessed via a different Flask route that calls many of the same helper functions.The code is not yet publicly released, but was very straightforward to write; each of the steps mentioned above is pretty much one OpenCV function call. Here is a sample scan and a demo video:
https://www.dropbox.com/s/h21ke7cnlwjs9wi/2021-03-24_01-37-1...
https://youtu.be/l66G8d-CrnU
My email can be found on my website (linked via my HN profile) if you want to discuss!