annotate_outline — ANNOTATE paper op

• 数据种类:image2d × mask → image2d

• 调用: import fullseye as fs; fs.ledger.annotate_outline(img, mask, label=None, color='emphasis', width=1.5, alpha=1.0, dash=None, font_size=12, label_offset=(0, 0), box_alpha=0.6, text_color=None, scheme='okabe_ito', font_path=None, layout=None)(要直接调用实现,import annotate; annotate.annotate_outline(img, mask, label=None, color='emphasis', width=1.5, alpha=1.0, dash=None, font_size=12, label_offset=(0, 0), box_alpha=0.6, text_color=None, scheme='okabe_ito', font_path=None, layout=None);从台账取用则 opsannotate.get("annotate_outline"))

用法

返回图像(image2d):把掩码轮廓画成(抗锯齿的)闭合折线,并在重心处放文字。

Raises

ValueError

mask 的形状与图像不同、没有为真的像素、alpha 在 [0,1] 之外。

步骤:若无 layout,则用 annotate_outline_layout(mask) 求边界环(沿像素边的 (x, y) 闭合多边形,外周和孔都有,按连通分量)和质心, 再把各环以距离覆盖率的抗锯齿折线叠加上去。若有 label, 则在质心 + label_offset 处放置 text_box(anchor="cm",带衬底)。

• img:(H, W) / (H, W, 1|3|4),float64 副本、[0, 1]。

• mask:(H, W),与图像同形([row, col] 下标)。非 bool 用 > 0.5 二值化,非有限则 ValueError。没有为真的像素则 ValueError。

• width:线宽 [px],0.5 以上。dash=(on, off) [px] 为虚线(on > 0、off >= 0)。

• alpha:[0, 1]。box_alpha 是文字衬底的不透明度。

• label_offset:(dx, dy) [px]。质心落在轮廓外的形状(新月形等) 在这里偏移。

• layout:传入 annotate_outline_layout 的返回值即可不重新计算,把同一布局用于另一幅图(读取 contours / centroid)。

• 返回值:与输入同形的 float64。

若要用填充表示则用 overlay_mask,若要给多个区域编号则用 annotate_markers。

详细使用指南

• figure_annotation 族使用指南

背景知识指南(该算子背后的物理与约定)

• dataset_conventions — 训练数据集规范知识 —— COCO / YOLO / VOC 及外观检测中的陷阱

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• paper_figure — py -3.11 examples/paper_figure.py

• poc_rotation_invariance_audit — py -3.11 examples/poc_rotation_invariance_audit.py

类型可衔接的下一个算子(可接受 image2d 作为输入)

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

同类别(paper)

annotate_leader_layout · annotate_leader · annotate_markers · annotate_legend · annotate_dimension_layout · annotate_dimension · annotate_angle_layout · annotate_angle


*Provenance: annotate.py — ANNOTATE 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.