A Python-based inspection tool for IDS uEye XS cameras, designed for production-line visual testing of devices such as 7-segment LCDs or mechanical indicators.
It allows the operator to define a Region of Interest (ROI), capture a reference set of images, and automatically detect differences in live video to give a PASS/FAIL result.
You can find my code here: GitHub
Features
- Live camera preview from IDS uEye XS
- Interactive ROI selection with mouse drag
- Automatic reference capture (10× frames)
- CLAHE preprocessing for improved contrast in low-light
- Basic image alignment to reduce ROI shift issues
- Pixel-difference based detection with configurable sensitivity
- Clear PASS/FAIL status in the GUI
- Easy reset for next test cycle
This project began due to a need to identify problems within screen segments, specifically whether segments were illuminating at the desired intensity or more dimly. We have an existing stock of the camera I used for the project, so I was asked to investigate the feasibility of this. You can see in the following image that when numerical segments change, the software marks it as FAIL. This is because it differs from the reference (calibration) images, in which all digits should be 0.
Requirements
- Python 3.8
- IDS uEye XS camera with official SDK installed
- Note: The IDS uEye SDK includes the
pyueye
Python bindings.
install IDS Software Suite 4.97 for Windows 32/64-bit
from: https://en.ids-imaging.com/download-details/AB02716.html
*Make sure to choose the correct camera model (in this case it was UI-1007XS-C)
Python installations
Install the next packages:
pip install customtkinter
pip install opencv-python
pip install pyueye
pip install numpy
pip install scikit-image
pip install Pillow
How It Works
- Launch the app → The camera initializes with a short delay for stabilization.
- Select ROI → Click & drag over the live preview to set your inspection area.
- Calibrate → Press Calibrate (10x) to store 10 reference frames from the ROI.
- Start Test → Live frames are compared against references:
- PASS ✅ = differences are below threshold
- FAIL ❌ = significant change detected
- Reset → Clear ROI and start new inspection.
Workflow
- Run the software.
I have set a delay of 5 seconds so the camera can stabilize its focus.
- Position the device under test and select the ROI over the relevant display or feature.
- Click on Calibration (10x) capture references.
- Start Test — the system automatically shows PASS/FAIL.