rounded_rect — ANNOTATE shape op

• 数据种类:image2d → image2d

• 调用: import fullseye as fs; fs.ledger.rounded_rect(img, rect, radius=8, color='neutral', width=2, fill=False, alpha=1.0, scheme='okabe_ito')(要直接调用实现,import annotate; annotate.rounded_rect(img, rect, radius=8, color='neutral', width=2, fill=False, alpha=1.0, scheme='okabe_ito');从台账取用则 opsannotate.get("rounded_rect"))

用法

圆角矩形(fill=True 时填充)。用作衬底或外框。

Raises

ValueError

矩形在图像外、radius 为负或超过边长的一半、alpha 在 [0,1] 之外。

绘制: 以像素中心到“圆角矩形”的距离判定是否在内侧,fill=False 时只叠加从外周起 max(1, width) px 宽的带(距离判定 1 级, 无抗锯齿)。合成为 out = m*color + (1-m)*img 乘以 alpha 的结果。

• img: (H, W) / (H, W, 1|3|4)。返回转换为 float64 并裁剪到 [0, 1] 的 副本(不改变输入)。NaN/Inf 则 ValueError。

• rect: (x, y, w, h),x = 列、y = 行。舍入为整数,w, h > 0, 且必须完全在图像内(超出部分不截短而是 ValueError)。占据的像素为 x .. x+w-1、y .. y+h-1。

• radius: 角的半径 [px],0 <= radius <= min(w, h)/2。0 为普通矩形。

• color: palette 的角色名("neutral" 等,由 scheme 解析)或 [0, 1] 的 RGB。灰度图像使用 RGB 的平均值。

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

用于手工搭出与 text_box 的底板或 annotate_legend 的外框相同的外观时。

详细使用指南

• figure_annotation 族使用指南

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

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

参考(示例数据、文献)

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

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

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

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

• annotate_gallery — py -3.11 examples/annotate_gallery.py

• poc_machine_condition_fusion — py -3.11 examples/poc_machine_condition_fusion.py

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

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

同类别(shape)

filled_polygon · arc · ellipse


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

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