Optical Image Quality and Beam Tests routines
Project description
Introduction
The optical engineer’s library for quantitative image quality testing and analysis of laser beams.
Installation:
pip install opticiq pip install opticiq[extras]
From the docs folder
A few jupyter-notebook sessions demonstrate working features:
demoCheckerboard.ipynb Saddle-point detection in recipe_checkerboard2 maps a checkerboard image.
demoSlantEdgeIQ.ipynb Demonstrates recipe_slantedge which auto finds regions of interest (ROI) and analyzes (slanted) edges to determine Line Spread Function LSF and Modulation Transfer Function MTF.
demoStarsBeams.ipynb Demonstrates recipe_star2 (which is applicable to beams as well as stars) to find and analyze local maxima.
2d Array of float
Note that opticiq always expects an image to be 2d array of type float. Recipes use imageGradient and (as of 0.0.5) imageGradient doesn’t verify or auto-convert to float. Even after blur, a gradient of integers will have “spikes” at discreet steps, and those artifacts may ruin feature detection.
Library Coding
A goal of opticiq is reusability before automation, so recipe_xx functions are high-level front-ends but you can always copy and paste a recipe to hack at the low-level components if needed. (BSD license keeps the door open.)
Take a moment to look at a recipe and see how the most common low-level components are used:
The first step is imageGradients() which blurs the image first and then returns gradients.
The second step is usually use some combo of gradients to get a Regions object. The structure of Regions may seem counterintuitive, but the hidden motive is to defer region-specific computations until after instantiation. Someday it may be possible for this API to multi-thread when the number of regions is high (esp. star fields), although of course Python itself can’t do that.
It depends on the recipe’s purpose, but a third step may be peaksAnalysis.
Aspiring Feature Set
IQ test chart generation, for display, print, or lithography (partially complete)
Various MTF test methods, using point, line, or edge function tests
Grid and distortion testing
Beam diameter (or star diameter), and other beam metrics
Low-level functions that support the above features, e.g. gradient tests and auto-ROI (partially complete)
Status
Alpha
A chunk of the planned functionality is working now.
TO DO - Planned features
- Chart generators:
More misc charts (ghost-hunters)
Vector chart gen: pdf and lithography
Model image transfer (object/image, distortion, blur, noise)
In addition to ChartGen_img (raster): allow enslaving a projector device so that camera and projector can be scripted to execute multiple image quality tests in sequence, whether the two reside on the same machine or networked.
- Checkerboard:
Ordering the grid
Another recipe for point grid - Checkerboard is usually better but why not?
Are there use cases for a line grid as well?
Compare to opencv findChessboardCorners and calibrateCamera. Does my method have any advantage? Does opencv support projection cases or only camera cases?
- Sharpness:
(Do I want to add an analysis for explicit measurement from Line Spread chart or only use Edge Spread?)
- Beam metrics:
Gaussian fit
Encircled energy
Ensquared energy
Off-axis metrics
M^2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opticiq-0.1.0.tar.gz.
File metadata
- Download URL: opticiq-0.1.0.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4321a548d0163ba5270ebaa89971150e18f5e955020db0c440494ac11b05df0d
|
|
| MD5 |
b0aee3cc4ce21bb12d635d5dd15e0280
|
|
| BLAKE2b-256 |
f39591f56f0007ef139efc194b407189eeb52a767858f7964aa4d2c09c3f5a86
|
File details
Details for the file opticiq-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opticiq-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87fbe2b84c225e56175bcf6b1bc7cbc5e4f9fbfd65104fae89bf264c7fc2c391
|
|
| MD5 |
4d74f495bc4bd2bdb71a740a4769ece9
|
|
| BLAKE2b-256 |
19493888c9519a58e5a34af62fed0c4b0c321639409df53a0ec9c411148f3bd2
|