annotate3d_measure — 3D annotate3d op

資料種類:image2dimage2d

呼叫: 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、閉形式)。画素上の長さは短縮しても値は変わらない。

Raises

------

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.5tick [px] >= 0font_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_figurepy -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.