Files
Support-Agent/.claude/skills/presentation/image-de-la-cause.py
T
maximeandClaude Opus 5.5 98261833f6 Support: situation reports for BREITHORN, MICHIGAN and NEBRASKA extended to the whole of October 2026, and their presentations; new /presentation skill (D-114)
Reports: all October labels (data from 03.10), the expert's diagnosis kept; new findings before 20.10 (night without measurements 15-16.10 on all three; BREITHORN references hidden on 04, 07, 10.10; MICHIGAN curves agitated 17-18.10; NEBRASKA camera stepping back 13-17.10); figures redone for the month.

Presentations (presentation.pdf in each report folder), built with the AIMsight Typst factory ~/docfactory-presentation, in the structure set by the user: "Point de situation" title with station and period, a numbered chronological summary, one self-sufficient slide per event with its diagnosis and picture (BREITHORN: the vehicle in front of COLI24), a conclusion (why it is less reliable, what to do), closing slide. A diagnosis, never an instruction ("to ignore"); the camera's movement is real, its cause (fixing, wall or other) not known.

Skill .claude/skills/presentation/: structure, the user's rules, what failed, model deck (BREITHORN) and image-de-la-cause.py (brightened crops around a target).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:31:17 +01:00

34 lines
1.6 KiB
Python

"""Montrer la cause qui se voit dans l'image (véhicule, obstacle, phares) : recadrages côte à côte,
éclaircis, autour d'une cible marquée d'un cercle rouge.
.venv/bin/python .claude/skills/presentation/image-de-la-cause.py data/<STATION> <x> <y> <sortie.png> \
<AAAAMMJJTHHMMZ>="<légende>" [<AAAAMMJJTHHMMZ>="<légende>" ...] [--demi 350]
x, y : pixel de la cible dans l'image entière (« centre du cadre » d'une vignette de vignettes.py).
Une image par instant, prise dans <dossier>/images/<instant>_*.jpg ; mettre d'abord un instant sans la cause.
"""
import glob, sys
import matplotlib; matplotlib.use("Agg")
import matplotlib.pyplot as plt, matplotlib.image as mi
args = sys.argv[1:]
demi = 350
if "--demi" in args:
i = args.index("--demi"); demi = int(args[i + 1]); del args[i:i + 2]
dossier, x, y, sortie, *instants = args
x, y = int(x), int(y)
station = dossier.rstrip("/").split("/")[-1]
fig, axs = plt.subplots(1, len(instants), figsize=(4 * len(instants), 4.3), squeeze=False)
for ax, inst in zip(axs[0], instants):
k, _, lab = inst.partition("=")
img = mi.imread(glob.glob(f"{dossier}/images/{k}_*.jpg")[0]).astype(float)
y0, x0 = max(y - demi, 0), max(x - demi, 0)
img = img[y0:y + demi, x0:x + demi]
img = (img / img.max()) ** 0.45 # éclaircir les ombres, les scènes de nuit sont sombres
ax.imshow(img, cmap="gray", vmin=0, vmax=1)
ax.add_patch(plt.Circle((x - x0, y - y0), 28, fill=False, color="red", lw=1.5))
ax.set_title(lab, fontsize=11); ax.axis("off")
fig.suptitle(f"{station} : autour de la cible (cercle rouge), image éclaircie", fontsize=12)
fig.tight_layout(); fig.savefig(sortie, dpi=100); print(sortie)