Software solution was developed as a part of the automated measurement system. System is explained in detail in master's thesis Machine vision application in workpieces dimensional control.
In the first section of the thesis, an automated visual inspection system for O-ring measurement is proposed. Measured O-ring features are also defined. Optical system components, calibration and setup are described. Measurement system software solution, developed using the Python programming language and the open-source software, is also introduced. Instructions for using software solution graphical interface are composed, and the algorithms for calibration, measurement and digital image preprocessing are defined.
The second part of thesis presents methods for measuring the O-ring using micrometer and the optical measurement system. The capability of each system is analyzed using the Six Sigma methodology. Optical measurement system sensitivity to the calibration is examined. Automated and manual measurement systems were compared by means of repeatability and reproducibility and intraclass correlation coefficient. Finally, the measures to increase the quality of the optical measurement system are proposed.
- Install Python 3.6+ and all Prerequisites
- Connect Basler USB 3.0 Camera for image grabbing (exactly this type of camera is necessary for parameter control using pypylon)
- Run script
main.py
Structure:
- Package cam:
cam.py
- Object for interaction with camera, setting parameters and grabbing images
event_handlers.py
- Camera event handlers
- Package gui:
flowcharts.py
- PyQtGraph Flowchart windows and libraries
mainwindow.py
- Application Main window and functions
ptrees.py
- Parameter trees shown in Main window
visualize.py
- Windows for grabbed frames, image preparation, dip.Image and real-time measurement
- Package processing:
nodes.py
- Nodes as main processing blocks in flowcharts
process.py
- Objects for parallel processing
main.py
- Launching application
calibrate_flowchart.fc
- Stored calibration flowchart
measure_flowchart.fc
- Stored measurement flowchart
measurement_result.tsv
- Stored measurement result
- Folder measurement_result
- Stored measurement results
Drivers:
Python modules:
- NumPy
- SciPy
- pypylon
- DIPlib 3 with PyDIP 3
- PyQtGraph
- Note: PyQtGraph might need some slight modifications to work proprely with Python 3.6
- multiprocess
For video example check project Github pages https://tbazina.github.io/dimension-visual-inspection/
Simple R script measurement_system_analysis.R
for optical system capability analysis is located in folder measurement_analysis. Folder also contains input data in .csv format and output images.
Following R libraries are required to run script:
This project is licensed under the BSD 3-Clause License - see the LICENSE.md file for details