overlay op• Data kinds: image2d × mask → table
• Call: import fullseye as fs; fs.ledger.annotate_invert_visibility(img, mask, mode='complement', alpha=1.0, bits=128) (to call the implementation directly, import annotate; annotate.annotate_invert_visibility(img, mask, mode='complement', alpha=1.0, bits=128); from the registry, opsannotate.get("annotate_invert_visibility"))
> This operator's description has not been translated yet. The original text follows as it is.
反転色がその地の上で本当に見えるかを、描く前に測る。
反転色の利点は「地の色を知らなくてよい」ことだが、弱点はたった 1 つで、
しかも致命的 —— 中間調では反転しても同じ色になる。8bit グレーの
v=128 に対する補色は v=127 で、WCAG のコントラスト比は 1.014
(比 1.0 が「同じ色」。実測 2026-09-08)。比 1.5 を下回る帯は
v ∈ [113, 142] の 30/256 階調 = 全階調の 12 % に及ぶ。
:func:annotate_invert と :func:annotate_invert_path は内部でこれを
呼んで警告するが、自分で fail-closed にしたいときはこの op で測って
から描く(`min_contrast を見て、低ければ mode="contrast"` に倒す)。
Parameters
----------
img : (H,W) または (H,W,C)
地。値域 [0,1]。
mask : (H,W)
反転を乗せるところ。真偽か [0,1] の重み。形が違えば例外。
mode : str
:data:INVERT_MODES のいずれか。
alpha : float
反転の効き。描くときと同じ値を渡すこと —— 見え方は「反転色」ではなく
実際に置かれる色で決まるので、`alpha` を落とすと答えが変わる。
Returns
-------
dict
`pixels(重み >= 0.5 の画素数) / min_contrast` /
`median_contrast / invisible_fraction`(比が
:data:INVERT_MIN_CONTRAST 未満の割合) / `worst_xy`(最悪の画素、
無ければ `None`)。
Examples
--------
>>> import numpy as np, annotate
>>> flat = np.full((8, 8), 128 / 255.0) # 中間調 —— 反転が消える地
>>> rep = annotate.annotate_invert_visibility(flat, np.ones((8, 8), bool))
>>> round(rep["min_contrast"], 3)
1.014
>>> rep["invisible_fraction"]
1.0
>>> annotate.annotate_invert_visibility(flat, np.ones((8, 8), bool),
... mode="contrast")["min_contrast"] > 4.5
True
• figure_annotation family guide
• dataset_conventions — 学習データセット規約の知識 — COCO / YOLO / VOC と外観検査での落とし穴
• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).
• Operator provenance and references — the sources of the research/methods this op family came from.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• annotate_paper_tour — py -3.11 examples/annotate_paper_tour.py
table as input)—
overlay)overlay_mask · overlay_labels · annotate_invert · annotate_invert_path
*Provenance: annotate.py — ANNOTATE operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.