Skip to main content

OptoCalib

OptoCalib Before and After Calibration

ArUco-locked perspective alignment with perceptual CIE L*a*b* / CIEDE2000 colorimetry, 16-bit linear RAW processing, Ridge-regularized 3×3 CCM, and Numba-accelerated post-detect warping.

pip install optocalib-lab

Key Features (v0.5.5)

  • Perspective & Scale Rectification: Locks onto 4 ArUco markers (IDs 0-3) with sub-pixel corner refinement (cv2.cornerSubPix).
  • Perceptual Colorimetry (CIEDE2000 / ΔE₀₀): Normalizes ambient illuminant shift using a white reference ROI and reports perceptual color error verified against the Sharma et al. (2005) reference dataset.
  • 16-Bit Linear RAW & 3×3 CCM: Supports linear sensor arrays, Ridge-regularized 3×3 Color Correction Matrix fitting, and HSV specular glare masking.
  • Typed API & Uncertainty (PEP 561): Immutable CalibrationResult dataclasses, domain exceptions (MarkersNotFound, InvalidRawLevels), 95% bootstrap confidence intervals (CV%), and CLI (python -m optocalib.cli).

Quick Start

import cv2
from optocalib import generate_calibration_card, calibrate_typed

# 1. Generate a printable calibration template
generate_calibration_card("my_lab_mat.png")

# 2. Rectify perspective and normalize ambient lighting
bgr = cv2.imread("captured_photo.jpg")
result = calibrate_typed(bgr, strict=True)
print(f"ΔE00: {result.delta_e00_before:.2f} -> {result.delta_e00_after:.2f} ({result.backend})")
cv2.imwrite("calibrated_output.png", result.image)

Latency Benchmark & Reproducibility

Post-detect homography warp + white-balance fusion benchmark (820×360 BGR uint8 frame, 50 timed repeats after 5 JIT warm-up runs on Apple Silicon M-series CPU):

Backend Resolution Warm-up Timed Repeats Median Latency
Numba JIT (numba) 820 × 360 5 50 ~0.57 ms
Pure NumPy Fallback 820 × 360 5 50 ~3.40 ms

Development & Attribution

OptoCalib was architected, specified, and verified by Bedriye Dilmen (b-dlmnnn), combining OpenCV/NumPy computer-vision primitives with perceptual CIEDE2000 colorimetry, 16-bit linear sensor processing, Ridge-regularized 3×3 CCM fitting, and bootstrap uncertainty intervals. AI coding assistants were used during implementation and refactoring; all mathematical invariants and 87 unit tests were audited and verified locally.

Metadata

Release files for optocalib-lab 0.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optocalib-lab 0.5.5
File Size Uploaded Provenance Actions
optocalib_lab-0.5.5.tar.gz 22.9 kB Without provenance Details for optocalib_lab-0.5.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optocalib-lab 0.5.5
File Interpreter ABI Platform Actions
optocalib_lab-0.5.5-py3-none-any.whl Python 3 none any Details for optocalib_lab-0.5.5-py3-none-any.whl

Total release size: 41.4 kB

Release files / optocalib_lab-0.5.5.tar.gz

Download URL optocalib_lab-0.5.5.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a598e25e9f2f094b93353620f63e338c111f061a0c5d679c548ba1eea9ee920b
BLAKE2b-256 checksum
How to use checksums
fe02c4a8e2cebcbf868f027086bcf4fab2dde151d5b5b677f9a335b2dcb42e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / optocalib_lab-0.5.5-py3-none-any.whl

Download URL optocalib_lab-0.5.5-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d36f21c648a12db30709a2a2c81f0f166e6406ed057ae95bd461a0b30df36f66
BLAKE2b-256 checksum
How to use checksums
0fcf132f53fbfc86a13a0d9b8fd400a080226d889c96300bf9acf3e419d3d4d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for optocalib-lab 0.5.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page