annotate3d op• 데이터 종류: image2d → image2d
• 호출: import fullseye as fs; fs.ledger.annotate3d_scale_bar(img, origin, direction, length, pose, K, unit='', depth=None, color='neutral', width=2.0, tick=8.0, font_size=12, label_fmt='{:g}', box_alpha=0.55, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None)(구현을 직접 호출하려면 import annotate3d; annotate3d.annotate3d_scale_bar(img, origin, direction, length, pose, K, unit='', depth=None, color='neutral', width=2.0, tick=8.0, font_size=12, label_fmt='{:g}', box_alpha=0.55, text_color=None, occlusion_tol=0.01, scheme='okabe_ito', font_path=None), 원장에서 가져오려면 ops3d.get("annotate3d_scale_bar"))
이미지(image2d)를 돌려줍니다: 메시 단위로 length 인 바를 면 위에 놓고 투영합니다.
바는 origin 에서 direction(정규화) 방향으로 length 만큼 나아가는 3-D 선분이며, 투영 후의 화소 길이는 시선에 대한 기울기로 줄어든다(원근과 단축을 정직하게 보인다). 상면에 평행하면 화소 길이는 f * length / z ― tests 가 확인한다.
ValueError
direction 이 0, length 가 양이 아님, 끝점이 카메라 뒤 / 영상 밖.
절차: p1 = origin + direction / |direction| * length 를 만들고, origin 과 p1 을 투영(annotate3d_project 와 같은 관례). 양 끝 화소를 잇는 선과, 양 끝에 길이 tick [px] 의 수직 눈금을 그리고(_bar_with_ticks), 선의 중점에서화면 위쪽(row 가 작은 쪽)으로 tick/2 + 4 px 떨어진 위치에 label_fmt.format(length) + " " + unit 의 문자 상자를 둔다.
인수:
• origin (3,), direction (3,)(방향만 쓴다. 길이는 무시, 0 은거부), length: 메시 단위의 길이(> 0, 1e-300 이상).
• unit: 문자열(비어 있으면 수치만). label_fmt: str.format 의 서식(기본값 "{:g}").
• width [px] >= 0.5, tick [px] >= 0(0 이면 눈금 없음), font_size / box_alpha / text_color / font_path: 문자 상자의 외관.
• depth: 전방 거리 영상. 양 끝 모두 가려져 있으면 선을 파선으로 한다.
• color: 기본값 "neutral"(역할명). occlusion_tol: [0, 1).
반환값: 그리기가 끝난 새 영상(float64 [0, 1]).
에러가 되는 조건: direction 의 노름이 1e-12 미만 / length <= 0 / 어느 한 끝점이 z <= 1e-9 / 어느 한 끝점이 영상 밖(이 op 는 in_image 를 양 끝에 요구한다 — 화살표와 달리 테두리 밖은 거부) / 자세·K·depth 가 부정 / 문자 상자가 들어가지 않음.
주의: 화소상의 길이는 시선에 대한 기울기로 단축된다(상면에 평행하면 f * length / z px). 깊이 방향으로 두면 짧아 보이지만, 그것이 정직한 투영. 2 점 사이의 실측값을 나타내려면 annotate3d_measure.
• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL 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_axes · annotate3d_bbox · annotate3d_measure
*Provenance: annotate3d.py — 3D 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.