annotate_invert_path — ANNOTATE overlay op

• Data kinds: image2d × pairs → image2d

• Call: import fullseye as fs; fs.ledger.annotate_invert_path(img, points, width=1.5, closed=False, dash=None, mode='complement', alpha=1.0, bits=128, min_contrast=1.5, on_invisible='warn') (to call the implementation directly, import annotate; annotate.annotate_invert_path(img, points, width=1.5, closed=False, dash=None, mode='complement', alpha=1.0, bits=128, min_contrast=1.5, on_invisible='warn'); from the registry, opsannotate.get("annotate_invert_path"))

Usage

Draws a polyline (line) in inverted color. Anti-aliased.

Lines are at a disadvantage compared with regions, which is why this op is separate -- for a line 1.5 pixels thick, the coverage of the edge pixels is only about 0.3, so inverting moves them only by their coverage fraction. On a mid-tone ground they vanish even sooner than regions. The judgement uses "pixels with coverage 0.5 or more" (those below are semi-transparent to begin with, so if they are invisible, that is not the inversion's fault).

Parameters

points : (N,2)

Polyline vertices (x, y) (pixel coordinates).

width : float

Line thickness (pixels, 0.5 or more).

closed : bool

If true, connects the last point to the first.

dash : (on, off) or None

Dash step (pixels). Same rule as _dash_pieces.

mode, alpha, min_contrast, on_invisible :

Same as annotate_invert.

Returns

(H,W[,C]) float64

A copy with the inversion applied.

Examples

>>> import numpy as np, annotate

>>> img = np.zeros((16, 32))

>>> out = annotate.annotate_invert_path(img, [(2, 8), (29, 8)], width=3)

>>> float(out[8, 15]) # on a black ground, so it becomes a white line

1.0

>>> float(out[2, 15]) # away from the line, unchanged

0.0

Detailed usage guide

• figure_annotation family guide

Background guides (the physics and conventions behind this op)

• dataset_conventions — Training-dataset conventions — COCO / YOLO / VOC and pitfalls in visual inspection

References (sample data, literature)

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

Runnable examples (verified samples that actually call this op)

• annotate_paper_tour — py -3.11 examples/annotate_paper_tour.py

Ops the type connects to (they accept image2d as input)

text_box · arrow · leader_line · label_points · crosshair · legend_box · color_bar · scale_bar

Same category (overlay)

overlay_mask · overlay_labels · annotate_invert_visibility · annotate_invert


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