LR-EDIT-OPTICS-PROFILE: keep the distortion check with the other Python tools

Moves it to tools/ with a pinned requirements file, as tools/spectral_camera_table.py does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015gRtdWF1E9358FfzhzYqCS
This commit is contained in:
Claude 2026-10-13 00:01:10 +00:00
parent ed68b2e685
commit 60c3efdfc3
No known key found for this signature in database
3 changed files with 12 additions and 4 deletions

View File

@ -101,7 +101,7 @@ ILCE-7M3: a checkerboard filling the frame on a TV (handheld) and on a desktop m
uncompressed raws, apertures from wide open to f/8, plus one textured wall. Tables covered strong barrel (16 mm,
−690 at the corner), strong pincushion (70 mm, +1161) and the sign change between them.
Method (`scripts/sony_distortion_check.py`): LightCraft renders each ARW at full size with the profile correction
Method (`tools/sony_distortion_check.py`): LightCraft renders each ARW at full size with the profile correction
on and off; sub-pixel board corners (Hessian saddle points refined with `cornerSubPix`, kept only where the four
quadrants alternate, labelled into rows and columns) are matched with the JPEG's by grid position, with the
match fixed by the central corners before any fit, because a board is periodic. A similarity (zoom, rotation,

View File

@ -0,0 +1,6 @@
# Python packages for tools/sony_distortion_check.py (docs/sony-lens-corrections.md).
# python3 -m venv .venv-distortion && .venv-distortion/bin/pip install -r tools/requirements-sony-distortion-check.txt
numpy==2.5.3
scipy==1.18.1
opencv-python-headless==5.0.0.93
Pillow==12.3.0

View File

@ -1,7 +1,9 @@
#!/usr/bin/env python3
"""Compare LightCraft's Sony embedded distortion correction with the camera's own JPEG.
sony_distortion_check.py --cli target/release/lightcraft-cli --work WORKDIR PHOTO_DIR [PHOTO_DIR…]
python3 -m venv .venv-distortion && .venv-distortion/bin/pip install -r tools/requirements-sony-distortion-check.txt
.venv-distortion/bin/python tools/sony_distortion_check.py --cli target/release/lightcraft-cli \
--work WORKDIR [--json results.json] PHOTO_DIR [PHOTO_DIR…]
Every ARW with a JPG of the same name is rendered by LightCraft twice, embedded correction on
and off, and measured against the camera JPEG (shot with Lens Comp. Distortion on Auto):
@ -12,8 +14,8 @@ and off, and measured against the camera JPEG (shot with Lens Comp. Distortion o
Checkerboard shots use the board's corners (sub-pixel), other shots SIFT features (agreement
only). Offsets are in pixels of the camera JPEG (6000 px wide on the A7 III); the "@2376"
columns rescale them to the 2376 px exports docs/sony-lens-corrections.md reports.
Needs numpy, scipy and opencv-python-headless.
columns rescale them to the 2376 px exports docs/sony-lens-corrections.md reports (method and results
there, under "ILCE-7M3 validation").
"""
import argparse