scale_bar — ANNOTATE furniture op

• Data kinds: image2d → image2d

• Call: import fullseye as fs; fs.ledger.scale_bar(img, length, units_per_pixel, unit='µm', xy=None, anchor='rb', color='neutral', thickness=5, margin=14, font_size=13, label=True, label_fmt='{:g}', font_path=None, scheme='okabe_ito', text_color=None) (implementation को सीधे call करना हो तो import annotate; annotate.scale_bar(img, length, units_per_pixel, unit='µm', xy=None, anchor='rb', color='neutral', thickness=5, margin=14, font_size=13, label=True, label_fmt='{:g}', font_path=None, scheme='okabe_ito', text_color=None), registry से लेना हो तो opsannotate.get("scale_bar"))

उपयोग

भौतिक लंबाई का scale bar। pixel↔भौतिक रूपांतरण argument से लिया जाता है (खुद से तय नहीं किया जाता)।

bar की pixel length round(length / units_per_pixel) है -- यही construction से मिला ground truth है, और tests.test_annotate इस मेल को संख्याओं से जाँचता है।

Parameters

length : float

bar जो physical length दर्शाता है (unit की इकाई में)।

units_per_pixel : float

1 pixel कितने unit के बराबर है। magnification नहीं बल्कि resolution दें।

unit : str

इकाई का लिखित रूप ('µm', 'mm', 'px' आदि)।

xy : (x,y) or None

bar का reference point। None हो तो anchor की ओर वाले कोने से margin अंदर।

label : bool

क्या "200 µm" का label साथ में लिखना है।

Returns

ndarray

Raises

ValueError

length / units_per_pixel positive नहीं या non-finite, pixel length 1 से कम,

bar (और label) image में नहीं समाते।

उपयोग की विस्तृत guide

• figure_annotation family guide

पृष्ठभूमि guides (इस op के पीछे की physics और conventions)

• dataset_conventions — Training dataset के conventions — COCO / YOLO / VOC और visual inspection में सावधानियाँ

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• annotate_gallery — py -3.11 examples/annotate_gallery.py

वे अगले ops जिनसे type जुड़ता है (image2d को input के रूप में लेते हैं)

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

इसी category के (furniture)

legend_box · color_bar


*Provenance: annotate.py — ANNOTATE operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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