text_box — ANNOTATE text op

• 데이터 종류: image2d × text → image2d

• 호출: import fullseye as fs; fs.ledger.text_box(img, text, xy, color='neutral', text_color=None, box_color=None, box_alpha=0.72, anchor='lt', pad=5, font_size=14, min_font_size=9, max_width=None, font_path=None, line_spacing=1.15, scheme='okabe_ito', min_contrast=2.0, border=0, border_color=None, style=None, wrap=True, bold=False, italic=False)(구현을 직접 호출하려면 import annotate; annotate.text_box(img, text, xy, color='neutral', text_color=None, box_color=None, box_alpha=0.72, anchor='lt', pad=5, font_size=14, min_font_size=9, max_width=None, font_path=None, line_spacing=1.15, scheme='okabe_ito', min_contrast=2.0, border=0, border_color=None, style=None, wrap=True, bold=False, italic=False), 원장에서 가져오려면 opsannotate.get("text_box"))

사용법

밑판(반투명 판)이 붙은 글자. 넘치면 조용히 자르지 않고 예외.

Parameters

img : ndarray

(H,W) 또는 (H,W,C), float [0,1].

text : str

그릴 문자열.

xy : (x, y)

앵커 위치(x=col, y=row, row는 아래 방향).

color : str or sequence

역할명 또는 RGB. text_color가 지정되지 않으면 이것이 테두리 색으로

쓰이고, 글자는 읽기 쉬운 기본색이 된다.

text_color, box_color : str/sequence or None

글자색·판의 색. None이면 기본값(밝은 글자 × 어두운 판). 글자색이 None일

때는, 실제로 아래에 나오는 색에 대해 밝은 기본색이 min_contrast를

밑도는 경우에 한해, 어두운 글자(판의 색)로 자동 전환한다 —— 판 없이

(box_alpha=0) 흰 바탕에 놓는 눈금·컬러바·범례의 라벨이

흰색에 녹아들지 않도록. text_color를 명시했을 때는 전환하지 않는다

(색은 그림의 의미이므로 멋대로 바꾸지 않고, 읽을 수 없으면 예외로 한다).

box_alpha : float

판의 불투명도 [0,1]. 0이면 판을 그리지 않는다(눈금 라벨용).

anchor : str

'lt','ct','rt','lm','cm','rm','lb','cb','rb'의 9가지.

pad : int

판의 안쪽 여백[px].

max_width : int or None

글자의 줄바꿈 폭. None이면 1행 그대로.

wrap : bool

False이면 줄바꿈하지 않고 1행 그대로 줄여서 max_width에 맞춘다.

min_contrast : float

글자와 "실제로 그 아래에 나오는 색"의 대비비 하한. 밑돌면

ValueError(배경과 동화한 글자는 아무도 알아챌 수 없으므로 통과시키지 않는다).

한계(정직하게): 비교하는 상대는 판 아래의 평균색이므로,

흰색과 검정이 반반 섞인 사진 위에 box_alpha=0으로 놓으면, 평균은

중간 회색이 되어 검사를 통과해 버린다(흰 부분 위의 글자는 읽을 수 없다).

바탕이 거친 곳에서는 box_alpha를 올려 판이 효과를 내게 할 것 ——

이 검사는 "판을 잊었다"를 잡기 위한 것이며,

"판이 있어도 읽을 수 없다"까지는 보장하지 않는다.

border : int

판의 테두리선 굵기(0이면 테두리 없음). 색은 border_color 또는 color.

style : dict or None

테두리선을 긋는 imagedraw.draw_polyline에 그대로 넘기는 인수.

Returns

ndarray

같은 shape의 새 배열.

Raises

ValueError

판이 영상에서 삐져나옴 / 글자가 들어가지 않음 / 대비 부족 /

알 수 없는 역할명·앵커 / 음의 여백.

자세한 사용 가이드

• figure_annotation 패밀리 가이드

배경 지식 가이드(이 연산자 앞에 있는 물리·규약)

• dataset_conventions — 학습 데이터셋 규약 지식 — COCO / YOLO / VOC와 외관 검사의 함정

참고(샘플 데이터·문헌)

• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.

• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.

• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.

실행 가능한 예제(이 연산자를 실제로 호출하는 검증된 샘플)

• annotate_gallery — py -3.11 examples/annotate_gallery.py

• annotate_paper_tour — py -3.11 examples/annotate_paper_tour.py

• drawlist_deferred — py -3.11 examples/drawlist_deferred.py

• poc_active_contours — py -3.11 examples/poc_active_contours.py

• poc_agv_fleet — py -3.11 examples/poc_agv_fleet.py

• poc_air_hockey_intercept — py -3.11 examples/poc_air_hockey_intercept.py

• poc_ball_bounce — py -3.11 examples/poc_ball_bounce.py

• poc_beam_modal_video — py -3.11 examples/poc_beam_modal_video.py

• poc_cad_scan_deviation — py -3.11 examples/poc_cad_scan_deviation.py

• poc_camera_calibration — py -3.11 examples/poc_camera_calibration.py

• poc_camera_shake_deblur — py -3.11 examples/poc_camera_shake_deblur.py

• poc_connectome_across_worms — py -3.11 examples/poc_connectome_across_worms.py

• poc_crack_width_timeseries — py -3.11 examples/poc_crack_width_timeseries.py

• poc_ct_void_morphology — py -3.11 examples/poc_ct_void_morphology.py

• poc_dehazing — py -3.11 examples/poc_dehazing.py

• poc_dem_terrain — py -3.11 examples/poc_dem_terrain.py

• poc_diabolo_model_and_vision — py -3.11 examples/poc_diabolo_model_and_vision.py

• poc_dic_strain — py -3.11 examples/poc_dic_strain.py

• poc_driving_crossing — py -3.11 examples/poc_driving_crossing.py

• poc_driving_decisions — py -3.11 examples/poc_driving_decisions.py

• poc_driving_endless_map — py -3.11 examples/poc_driving_endless_map.py

• poc_driving_lateral — py -3.11 examples/poc_driving_lateral.py

• poc_driving_longitudinal — py -3.11 examples/poc_driving_longitudinal.py

• poc_driving_pass — py -3.11 examples/poc_driving_pass.py

• poc_driving_school — py -3.11 examples/poc_driving_school.py

• poc_driving_traffic — py -3.11 examples/poc_driving_traffic.py

• poc_driving_weather — py -3.11 examples/poc_driving_weather.py

• poc_emva1288_sensor — py -3.11 examples/poc_emva1288_sensor.py

• poc_eye_to_brain — py -3.11 examples/poc_eye_to_brain.py

• poc_focus_stacking — py -3.11 examples/poc_focus_stacking.py

• poc_food_cutting_measure — py -3.11 examples/poc_food_cutting_measure.py

• poc_granular_heap_repose — py -3.11 examples/poc_granular_heap_repose.py

• poc_graph_hierarchy_segmentation — py -3.11 examples/poc_graph_hierarchy_segmentation.py

• poc_interferometry_step — py -3.11 examples/poc_interferometry_step.py

• poc_kendama — py -3.11 examples/poc_kendama.py

• poc_leak_localization — py -3.11 examples/poc_leak_localization.py

• poc_lidar_terrain_change — py -3.11 examples/poc_lidar_terrain_change.py

• poc_livestock_body_volume — py -3.11 examples/poc_livestock_body_volume.py

• poc_machine_condition_fusion — py -3.11 examples/poc_machine_condition_fusion.py

• poc_malecns_activity_wave — py -3.11 examples/poc_malecns_activity_wave.py

• poc_measurement_system_analysis — py -3.11 examples/poc_measurement_system_analysis.py

• poc_mesh_quality_repair — py -3.11 examples/poc_mesh_quality_repair.py

• poc_motion_magnification — py -3.11 examples/poc_motion_magnification.py

• poc_multibeam_bathymetry — py -3.11 examples/poc_multibeam_bathymetry.py

• poc_panorama_drift — py -3.11 examples/poc_panorama_drift.py

• poc_particle_tracking — py -3.11 examples/poc_particle_tracking.py

• poc_peg_failure_recovery — py -3.11 examples/poc_peg_failure_recovery.py

• poc_peg_insertion_tactile — py -3.11 examples/poc_peg_insertion_tactile.py

• poc_photoelasticity — py -3.11 examples/poc_photoelasticity.py

• poc_powder_scoop_pour — py -3.11 examples/poc_powder_scoop_pour.py

• poc_print_warpage_risk — py -3.11 examples/poc_print_warpage_risk.py

• poc_pxrd_phase_peel — py -3.11 examples/poc_pxrd_phase_peel.py

• poc_registration_basin — py -3.11 examples/poc_registration_basin.py

• poc_river_surface_velocity — py -3.11 examples/poc_river_surface_velocity.py

• poc_rotation_invariance_audit — py -3.11 examples/poc_rotation_invariance_audit.py

• poc_rover_slip_risk_path — py -3.11 examples/poc_rover_slip_risk_path.py

• poc_segmentation_gauntlet — py -3.11 examples/poc_segmentation_gauntlet.py

• poc_stockpile_volume — py -3.11 examples/poc_stockpile_volume.py

• poc_strain_history — py -3.11 examples/poc_strain_history.py

• poc_structure_4d_deterioration — py -3.11 examples/poc_structure_4d_deterioration.py

• poc_superresolution_limits — py -3.11 examples/poc_superresolution_limits.py

• poc_swarm_obstacle_from_flow — py -3.11 examples/poc_swarm_obstacle_from_flow.py

• poc_table_tennis_bounce — py -3.11 examples/poc_table_tennis_bounce.py

• poc_table_tennis_rally_loop — py -3.11 examples/poc_table_tennis_rally_loop.py

• poc_table_tennis_spin — py -3.11 examples/poc_table_tennis_spin.py

• poc_tacscalib_sphere_lut — py -3.11 examples/poc_tacscalib_sphere_lut.py

• poc_template_tracking — py -3.11 examples/poc_template_tracking.py

• poc_timelapse_growth — py -3.11 examples/poc_timelapse_growth.py

• poc_traffic_counting — py -3.11 examples/poc_traffic_counting.py

• poc_ttc_rss — py -3.11 examples/poc_ttc_rss.py

• poc_world_terrain — py -3.11 examples/poc_world_terrain.py

• poc_wound_area_tracking — py -3.11 examples/poc_wound_area_tracking.py

• poc_xyt_event_surface — py -3.11 examples/poc_xyt_event_surface.py

타입이 이어지는 다음 연산자(image2d 를 입력으로 받는 것)

arrow · leader_line · label_points · crosshair · legend_box · color_bar · scale_bar · axes_frame

같은 카테고리(text)

measure_text


*Provenance: annotate.py — ANNOTATE 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*

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