annotate3d_label — 3D annotate3d op

• 数据种类:image2d × text → image2d

• 调用: import fullseye as fs; fs.ledger.annotate3d_label(img, text, anchor, pose, K, depth=None, offset=(26.0, -22.0), color='emphasis', width=1.5, cap_size=3.0, font_size=12, pad=4, box_alpha=0.72, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None)(要直接调用实现,import annotate3d; annotate3d.annotate3d_label(img, text, anchor, pose, K, depth=None, offset=(26.0, -22.0), color='emphasis', width=1.5, cap_size=3.0, font_size=12, pad=4, box_alpha=0.72, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None);从台账取用则 ops3d.get("annotate3d_label"))

用法

返回图像(image2d):给 3-D 锚点加上带引出线的文字。

文字放在从锚点像素偏移 offset [px] 的位置(由 offset[0] 的符号选择左右锚点)。若通过 depth 得知被遮挡,则为虚线 + 空心标记。

Raises

ValueError

锚点在相机后方 / 图像外、文字放不下、位姿或 K 不正确。

步骤: 用与 annotate3d_project 相同的投影把 anchor(object 坐标 (3,))变为像素 (x, y),从 (x, y) 向 (x + offset[0], y + offset[1]) 画引出线(annotate._aa_polyline,宽度 width),在锚点一侧画半径 cap_size 的点,在线的末端用 annotate.text_box 放置文字。文字框的连接点(anchor)在 offset[0] > 0 时为左中,< 0 时为右中,== 0 时若 offset[1] < 0 则为下中央、否则为上中央。

参数:

• offset: 像素单位 (dx, dy)(dy 向下为正 = 行方向)。默认 (26, -22) 指向右上。

• width: 线宽 [px],>= 0.5 的实数。cap_size: 点的半径 [px],0 则不画点。pad / font_size / box_alpha / text_color / font_path: 文字框的外观(从 font_size 起最小自动缩小到 9)。

• depth: 前方距离图像。若被遮挡,线变为虚线,点变为空心(ring)。

• color: 角色名或 RGB。occlusion_tol: [0, 1)。

返回值: 绘制后的新图像(float64 [0, 1],不修改输入)。

报错条件(按实现): 锚点 z <= 1e-9 / 锚点像素在 [0, W-1] x [0, H-1] 之外 / 位姿、K、depth 不正确 / 文字框即使缩小也放不进图像(text_box 一侧)。即使 offset 的末端在框外也会画线。

用途: 图中的部位名称、编号。一次给多个点加标签时,先用 annotate3d_project 取得可见判定,只对 visible 的点调用。

参考(示例数据、文献)

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

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

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

• annotate3d_figure — py -3.11 examples_3d/annotate3d_figure.py

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

fuse_to_voxel · fit_poly_surface · eval_poly_surface · surface_form_error · background_flatten · polar_unwrap · fit_zernike · matcap_shade

同类别(annotate3d)

annotate3d_project · annotate3d_arrow · annotate3d_scale_bar · annotate3d_axes · annotate3d_bbox · annotate3d_measure


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

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