fullseye

annotate3d_scale_bar — 3D annotate3d op

使い方

画像(image2d)を返す: メッシュ単位で length のバーを面上に置いて射影する。

バーは origin から direction(正規化)に length 進む 3-D 線分で、 射影後の画素長は視線に対する傾きで縮む(遠近と短縮を正直に見せる)。 像面に平行なら画素長は f * length / z ―― tests が確かめる。

Raises

ValueError direction がゼロ、length が非正、端点がカメラの後ろ / 画像の外。

手順: p1 = origin + direction / |direction| * length を作り、originp1 を射影(annotate3d_project と同じ慣習)。両端の画素を結ぶ線と、 両端に長さ tick [px] の垂直な目盛を描き(_bar_with_ticks)、線の中点から 画面上側(row が小さい側)へ tick/2 + 4 px 離した位置に label_fmt.format(length) + " " + unit の文字箱を置く。

引数:

返り値: 描画済みの新しい画像(float64 [0, 1])。

エラーになる条件: direction のノルムが 1e-12 未満 / length <= 0 / どちらかの端点が z <= 1e-9 / どちらかの端点が画像の外(この op は in_image を両端に要求する — 矢印と違い枠外は拒否) / 姿勢・Kdepth の不正 / 文字箱が収まらない。

注意: 画素上の長さは視線に対する傾きで短縮する(像面に平行なら f * length / z px)。奥行き方向に置くと短く見えるが、それが正直な射影。 2 点間の実測値を示すなら annotate3d_measure

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(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_axes · annotate3d_bbox · annotate3d_measure


Provenance: annotate3d.py — 3D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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