Skip to main content

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

  1. Chart generators:
    1. More misc charts (ghost-hunters)

    2. Vector chart gen: pdf and lithography

    3. Model image transfer (object/image, distortion, blur, noise)

    4. 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.

  2. Checkerboard:
    1. Ordering the grid

    2. Another recipe for point grid - Checkerboard is usually better but why not?

    3. Are there use cases for a line grid as well?

    4. Compare to opencv findChessboardCorners and calibrateCamera. Does my method have any advantage? Does opencv support projection cases or only camera cases?

  3. Sharpness:
    1. (Do I want to add an analysis for explicit measurement from Line Spread chart or only use Edge Spread?)

  4. Beam metrics:
    1. Gaussian fit

    2. Encircled energy

    3. Ensquared energy

    4. Off-axis metrics

  5. M^2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opticiq-0.1.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opticiq-0.1.0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

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

Hashes for opticiq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4321a548d0163ba5270ebaa89971150e18f5e955020db0c440494ac11b05df0d
MD5 b0aee3cc4ce21bb12d635d5dd15e0280
BLAKE2b-256 f39591f56f0007ef139efc194b407189eeb52a767858f7964aa4d2c09c3f5a86

See more details on using hashes here.

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

Hashes for opticiq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87fbe2b84c225e56175bcf6b1bc7cbc5e4f9fbfd65104fae89bf264c7fc2c391
MD5 4d74f495bc4bd2bdb71a740a4769ece9
BLAKE2b-256 19493888c9519a58e5a34af62fed0c4b0c321639409df53a0ec9c411148f3bd2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page