encode_barcode1d — SYMBOL barcode1d op

• 資料種類:無 → table(僅由參數決定的運算子 —— 不接受影像或資料輸入)

• 呼叫: import fullseye as fs; fs.ledger.encode_barcode1d(text, symbology='code128', *, wide_ratio=2.5, check_digit=False, gs1=False)(要直接呼叫實作,import barcode1d; barcode1d.encode_barcode1d(text, symbology='code128', *, wide_ratio=2.5, check_digit=False, gs1=False);從台帳取用則 opssymbol.get("encode_barcode1d"))

• GPU:無(僅 CPU 參考實作)

用法

將字串編碼為一維條碼的元素寬度(以模組為單位)(table)。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

Encode text as a 1-D symbol. Returns a table: symbology, text (the human-readable data, e.g. EAN-13 with its check digit), widths (element widths in modules, first element a bar, quiet zones excluded), quiet (left, right) in modules, n_modules (symbol length without quiet zones), edges (cumulative element boundaries starting at the left quiet-zone edge = 0), values (symbol character values, Code 128 only) and wide_ratio (two-width symbologies).

symbology: "ean13" (12 or 13 digits; the 13th must be the check digit), "upca" (11 or 12 digits), "code128" (ASCII 32..126, automatic code sets B / C; gs1=True puts FNC1 first and maps '\x1d' to FNC1 — GS1-128), "code39" (0-9 A-Z - . space $ / + %, start/stop * added, optional mod-43 check with check_digit=True), "itf" (an even number of digits; check_digit=True appends the GS1 mod-10 check to make the count even). wide_ratio (two-width symbologies) must lie in [2.0, 3.0].

空の入力(text == "")は ValueError(理由: 符号化する中身が無い)。拒否(ValueError): 文字列でない、未知のシンボル体系、字種の外の文字、桁数違い、検査数字の不一致、wide_ratio が [2.0, 3.0] の外。

詳細使用指南

• symbol_reading 族使用指南

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• poc_symbol_package_1d — py -3.11 examples/poc_symbol_package_1d.py

型別可銜接的下一個運算子(可接受 table 作為輸入)

render_symbol · symbol_read_trials · symbol_read_pod · ocr_classify · ocr_read_line · ocr_read_trials

同類別(barcode1d)

ean_check_digit · barcode_scan_profiles · decode_barcode_profile · read_barcode1d


*Provenance: barcode1d.py — SYMBOL 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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