annotate3d op• 数据种类:image2d → image2d
• 调用: import fullseye as fs; fs.ledger.annotate3d_measure(img, p0, p1, pose, K, unit='', depth=None, color='emphasis', width=1.5, tick=8.0, font_size=12, label_fmt='{:.3g}', box_alpha=0.6, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None)(要直接调用实现,import annotate3d; annotate3d.annotate3d_measure(img, p0, p1, pose, K, unit='', depth=None, color='emphasis', width=1.5, tick=8.0, font_size=12, label_fmt='{:.3g}', box_alpha=0.6, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None);从台账取用则 ops3d.get("annotate3d_measure"))
返回图像(image2d):用投影的线与数值标出 3-D 两点间距离(网格单位)。
值为 |p1 - p0|(3-D,闭式)。即使像素上的长度被缩短,值也不变。
ValueError
2 点重合、端点在相机后方 / 图像外。
步骤: 计算 dist = |p1 - p0|(object 坐标的欧氏距离,单位为网格单位),投影 p0, p1(与 annotate3d_project 相同的约定)。绘制连接两端像素的线、两端的垂直刻度(长度 tick px)、两端半径 3 px 的点,在从线的中点朝画面上方离开 tick/2 + 4 px 的位置放置 label_fmt.format(dist) + " " + unit 的文字框。
参数:
• p0, p1: object 坐标 (3,)(有限,重合则拒绝)。
• unit: 字符串(为空则只显示数值)。label_fmt: str.format 格式(默认 "{:.3g}")。不做单位换算 — 网格是 mm 就仍是 mm。
• width [px] >= 0.5、tick [px] >= 0、font_size / box_alpha / text_color / font_path: 文字框的外观。
• depth: 前方距离图像。两端都被遮挡则线画为虚线,被遮挡端点的点画为空心(ring)。occlusion_tol: [0, 1)。
返回值: 绘制后的新图像(float64 [0, 1])。
报错条件: |p1 - p0| < 1e-12 / 任一端点 z <= 1e-9 / 任一端点在图像外(要求两端都 in_image) / 位姿、K、depth 不正确 / 文字框放不下。
用途: 在图上显示 fit_sphere3 的直径、smallest_box3 的边、2 个特征点之间的距离。值本身与绘制前的 np.linalg.norm(p1 - p0) 相同。
• 示例数据目录(下载 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_label · annotate3d_scale_bar · annotate3d_axes · annotate3d_bbox
*Provenance: annotate3d.py — 3D 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.