Mitch Richling Upgrades a Leica Microscope with Raspberry Pi-Powered On-Device Image Analysis
Mathematician, coder, and computer architect Mitch Richling has showcased a low-cost upgrade that turns a Leica S8 APO stereo microscope into an on-device image analyzer for electronics diagnostics and repair — by strapping a Raspberry Pi and an HQ Camera Module to the top.
"Microscope cameras with built in image analysis software are pretty cool. Simply connect the camera to your monitor & mouse, and you can do simple image processing and measurement without a computer," Richling explains. "These solutions are expensive for what you get, and the analysis software is pretty limited. So I thought, why not build my own? It's just a tiny computer and a camera in a compact case after all."
Richling's homebrew solution takes an otherwise off-the-shelf Leica S8 APO stereo microscope and adds a Raspberry Pi 4 Model B 8GB single-board computer, a heatsink case with two built-in fans, and a Raspberry Pi HQ Camera Module. The device runs Raspberry Pi OS, plus a shell script which ties into the raspistill tool for image capture.
Image analysis, meanwhile, takes place in ImageJ's Fiji, using a macro to add three new icons to the toolbar: Image capture, capture loading, and scale configuration. "This script contains hardwired settings for my specific microscope and lenses," Richling notes of the last icon, "and may require modification for your microscope."
A full parts list, along with source code for the macro and shell script, can be found on Richling's GitHub page.