LiveRuler is a professional-grade microscope calibration suite designed by Precisometer. It automates the tedious process of calculating the pixel-to-micron scale (µm/px) for optical microscopy and material science imaging.
By combining traditional computer vision with frequency-domain analysis, LiveRuler provides robust, sub-pixel accuracy that resists lighting noise and sample tilt.
- 🎯 Automated Alignment: Uses Hough Transform and FFT power maximization to automatically detect and correct sample rotation.
- 🔬 Precise Calibration Engine: Employs Autocorrelation (ACF) for stable period detection, significantly reducing errors from harmonics.
- 📊 Power Spectrum Visualization: Real-time FFT preview allows users to visually verify the detected frequency peaks.
- 🧪 Dual Mode Support: Pre-configured profiles for 10µm Stage Micrometers and 100µm Grids.
- 🌐 Live Web Version: Available at aliazadbakht.github.io/LiveRuler—runs entirely in the browser via WebAssembly (PyScript).
- 📅 History Tracking: Built-in persistence to track calibration records across sessions.
LiveRuler doesn't just "count pixels." It uses a multi-stage signal processing pipeline to ensure consistency:
- Orientation Estimation: A global scan using
Cannyedges andHoughLinesprovides a rough tilt angle. - Rotation Refinement: The image is iteratively rotated in 0.1° increments to maximize the density of the FFT power spectrum peaks.
- Artifact Removal: High-pass filtering suppresses uneven illumination and surface reflections.
- Autocorrelation Analysis: Unlike raw FFT which can be sensitive to noise, autocorrelation identifies the fundamental physical spacing of your ruler markings, making it immune to DC bias and local defects.
For laboratory environments requiring local image storage.
-
Clone & Prepare:
git clone https://github.com/Precisometer/LiveRuler.git cd LiveRuler -
Install Dependencies:
pip install -r requirements.txt
-
Launch:
python app.py
The dashboard will automatically open at
http://127.0.0.1:5001.
- Backend Logic: OpenCV, NumPy, SciPy, Matplotlib
- Web Interface: Vanilla JS, Glassmorphism CSS, HTML5
- Server: Flask (Desktop) / PyScript (Web)
Precisometer specializes in high-accuracy measurement solutions for microscopy and micro-fabrication. We bridge the gap between academic research and industrial reliability.
Released under the MIT License • Built with ❤️ by Precisometer
