SlideBench is an open-source device and software application for measuring the focal length of lenses and lens systems. It was developed as a Bachelor of Science in Physics degree project at the Physics Department of the National University of Colombia, within the Applied Optics Group led by Professor Yobani Mejía Barbosa.
The measurement method is based on the scientific article:
Y. Mejía, "Improvement in the measurement of focal length using spot patterns and spherical aberration", Applied Optics, vol. 52, no. 23, pp. 5577–5584, 2013. https://opg.optica.org/ao/abstract.cfm?uri=ao-52-23-5577
SlideBench measures the effective focal length of a lens or system of lenses using a novel optical method based on spot patterns. It can also determine whether a lens is achromatic by computing the focal length independently for red, green and blue light using optical filters.
The device consists of a motorized screen that moves along an optical axis, a USB camera that captures images of the spot pattern at different positions, and an Arduino that controls the motor and LED light source. The SlideBench software controls the entire measurement process automatically, processes the captured images, and computes the focal length with its associated uncertainty.
To use SlideBench you will need the following hardware:
- Laptop or desktop computer running Windows (Mac and Linux support coming soon)
- Arduino Uno — microcontroller that controls the motor and LED
- Stepper motor NEMA 17 — moves the screen along the optical axis
- Motor driver DRV8825 — drives the stepper motor from the Arduino
- Servomotor — controls the optical filter wheel
- LED light source — illuminates the spot pattern screen
- USB camera — captures images of the spot pattern
- A circuit diagram of the device is available in the repository
The Arduino sketch that controls the motor, LED and filter wheel is available
in the arduino/ folder of this repository.
If you are using a device that has been used before: The Arduino is likely already flashed with the correct sketch and no action is required — just connect it to your computer and launch the application.
If you are setting up a new device: You will need to flash the Arduino sketch before using the device for the first time. To do so:
- Download and install the Arduino IDE
- Open the sketch file from the
arduino/folder - Connect your Arduino Uno via USB
- Select the correct port in the Arduino IDE
- Click Upload
No Python installation required.
- Download
SlideBench.exefrom the Releases page - Place it in a folder of your choice
- Connect the Arduino and camera to your computer
- Double click
SlideBench.exeto launch the application - The
media/anddata/folders will be created automatically next to the exe on first run
Note: Windows may show a SmartScreen warning the first time you run the exe. Click "More info" → "Run anyway" to proceed. This is normal for unsigned executables.
If you want to explore, modify or contribute to the code, follow these steps:
1. Clone the repository
git clone https://github.com/revitss/slidebench.git
cd slidebench2. Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Mac/Linux3. Install dependencies
pip install -r requirements.txt4. Run the application
cd program
python main.pySlideBench manages two folders automatically — you do not need to create them manually.
This folder is where captured images and recorded videos are saved. When you launch SlideBench for the first time, it will create this folder automatically next to the executable. If the folder already exists from a previous session, the application will detect it and continue saving files there normally.
This folder stores the reference data and measurement results. It is created automatically next to the executable on first launch.
Inside data/ lives the reference/ subfolder, which contains the reference file
(reference_y0.npy) and the reference images for each filter. This reference data is
essential for the focal length measurement — it represents the spot pattern distances
captured without lens and is used as the baseline for all calculations.
First time using the app:
You must capture a reference measurement before running any automatic measurement.
To do so, click Capture Reference in the Automatic Mode window, and the reference
file will be saved automatically in data/reference/. From that point on, the application
will read it automatically every time you run a measurement.
If you already have a reference file:
Simply place the reference_y0.npy file and the reference images inside the
data/reference/ folder next to the executable, and the application will detect
and read them automatically — no need to capture a new reference.
SlideBench has two main interfaces:
The main window is divided into three sections:
- Device Control (left) — controls for manual motor movement, absolute positioning, speed, LED intensity and optical filter selection. Also contains the button to open the Automatic Mode window.
- Camera Controls (center) — buttons to activate the live camera feed, capture images, record video, select a save folder, and run a quick distance measurement on the spot pattern.
- Live Camera View (right) — displays the live camera feed and the last captured photo.
Screenshots coming soon.
The automatic measurement window allows you to run a full focal length measurement automatically. You enter the two screen positions (z₁ and z₂ in mm), select the calculation mode that matches your optical setup, capture a reference image before if is needed, and start the measurement. Results are displayed for each filter (white, red, green, blue) and can be saved to an Excel file.
Screenshots coming soon.
The application is divided into the following modules inside the program/ folder:
| File | Description |
|---|---|
main.py |
Entry point — launches the application |
main_gui.py |
Main GUI window — connection dialog and main interface |
automatic_gui.py |
Automatic measurement window |
camera_functions.py |
Camera control, image capture, video recording |
controller.py |
Motor, LED and filter control commands |
communication.py |
Arduino serial communication |
focal_measurements.py |
Image processing and focal length computation |
utils.py |
Path utilities and mm/steps conversion |
The program/resources/ folder contains images and configuration files used by the GUI.
If you use SlideBench in your research or academic work, please cite both the original method and this software:
Original method:
Y. Mejía, "Improvement in the measurement of focal length using spot patterns and spherical aberration", Applied Optics, vol. 52, no. 23, pp. 5577–5584, 2013. DOI: 10.1364/AO.52.005577
This software:
Kevin Perez and Y. Mejía Barbosa, SlideBench — Focal Length Measurement Software, National University of Colombia, Physics Department, Applied Optics Group, 2025. Available at: https://github.com/revitss/slidebench-app
- Yobani Mejía Barbosa — Professor and researcher, Applied Optics Group, Physics Department, National University of Colombia. Author of the focal length measurement method.
- Kevin Perez — Developer of the SlideBench device and software, as part of a Bachelor of Science in Physics degree project at the National University of Colombia.
This project does not currently have a license. Please contact the authors before using this software for commercial purposes.
For questions or collaborations, please contact the Applied Optics Group at the Physics Department of the National University of Colombia.
- Yobani Mejía Barbosa — ymejiab@unal.edu.co