使用 Python 识别 UPC 条码
通过您的 Python 应用程序扫描条码图像,无需安装任何其他软件.
对于尝试通过 Python 应用程序扫描自定义 UPC 条形码图像的开发人员, Aspose.Total for Python via .NET API 可根据业务需求,帮助自动化读取和识别任何颜色或尺寸的条码。 它是处理不同格式以及一维、二维和邮政条码的各种 API 的完整包。 作为 Aspose.Total for Python via .NET 包一部分的 Aspose.BarCode for Python via .NET API 使这个扫描过程变得简单。 此外,开发人员可以调整识别引擎的参数,以实现快速条码扫描或提高读取准确性。
如何在 Python 中识别 UPC 条码
- 使用带有 DecodeType.AllSupportedTypes 的 BarCodeReader 类对象作为参数
- 通过调用read_bar_codes()获取所有UPC代码
- 遍历所有结果以打印它
认可要求
- 对于 UPC 条形码扫描,需要 Python 3.5 或更高版本
- 直接从 PyPI ( Aspose.BarCode ) 引用项目中的 API
- 或者使用以下 pip 命令
pip install aspose-barcode-for-python-via-net
- 此外,基于 Microsoft Windows 或 Linux 的操作系统(参见 BarCode 的更多信息)
在 Python 中识别 UPC 符号条形码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.barcode import barcoderecognition | |
reader = barcoderecognition.BarCodeReader(<file name>, barcoderecognition.DecodeType.AllSupportedTypes) | |
recognized_results = reader.read_bar_codes() | |
for barcode in recognized_results: | |
print(barcode.code_text) |
探索扫码机 Python 选项
扫描 AUSTRALIAPOST 条码
(Australia Post Code)
扫描 AZTEC 条码
(Aztec 2D Barcode)
扫描 CODE128 条码
(Code 128)
扫描 CODE16K 条码
(Code 16K Barcode)
扫描 CODE32 条码
(CODE 32 Barcode)
扫描 CODE39 条码
(Code 39 Standard)
扫描 CODE93 条码
(Code 93 Standard)
扫描 CODEBLOCK 条码
(CodablockF Barcode)
扫描 DATABAR 条码
(GS1 DataBar (Reduced Space Symbology))
扫描 DATALOGIC2OF5 条码
(Datalogic 2 of 5 Barcode)
扫描 DATAMATRIX 条码
(Data Matrix Code)
扫描 DEUTSCHEPOST 条码
(Deutsche Post Leitcode)
扫描 DOTCODE 条码
(DotCode 2D Barcode)
扫描 DUTCHKIX 条码
(Dutch KIX Barcode)
扫描 EAN 条码
(European Article Number)
扫描 IATA2OF5 条码
(IATA 2 of 5 Barcode)
扫描 INTERLEAVED2OF5 条码
(Interleaved 2 of 5 Barcode)
扫描 ISBN 条码
(International Standard Book Number)
扫描 ISMN 条码
(International Standard Music Number)
扫描 ISSN 条码
(International Standard Serial Number)
扫描 ITALIANPOST25 条码
(ItalianPost25 Code)
扫描 ITF 条码
(Interleaved 2 of 5 (ITF))
扫描 MATRIX2OF5 条码
(Matrix 2 of 5 Barcode)
扫描 ONECODE 条码
(USPS 4-State Customer Barcode)
扫描 PDF417 条码
(PDF417 Code)
扫描 PLANET 条码
(PLANET)
扫描 POSTNET 条码
(POSTNET)
扫描 QR 条码
(Quick Response Code)
扫描 RM4SCC 条码
(Royal Mail 4-State Customer Code)
扫描 SINGAPOREPOST 条码
(Singapore Post QR Code)
扫描 STANDARD2OF5 条码
(Code 25 Interleaved)
扫描 SWISSPOSTPARCEL 条码
(Swiss Post Parcel Code)
扫描 UPC 条码
(UPC Code)
什么是 UPC 条码
UPC 条码或通用产品代码条码是一种在零售环境中广泛用于对产品信息进行编码的条码。 UPC 条形码由一系列垂直条和不同宽度的空格组成,设计用于条形码扫描仪读取。 UPC 条码通常由 12 位数字组成,第一位数字表示产品类型,其余数字代表产品代码和其他信息,例如制造商和原产国。扫描 UPC 条形码时,条形码中编码的信息会传输到计算机系统,计算机系统可以使用这些数据来识别产品并检索附加信息,例如价格和库存状态。这使得 UPC 条形码成为管理零售库存和简化结账流程的重要工具。