qr-barcode-reader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseQR/Barcode Reader
QR/Barcode Reader
Decode and extract data from QR codes and barcodes in images with support for multiple barcode formats.
对图片中的二维码和条形码进行解码并提取数据,支持多种条形码格式。
Purpose
用途
Barcode scanning for:
- Inventory management and tracking
- Product information lookup
- Document verification
- Event check-in systems
- Automated data entry
条形码扫描适用于:
- 库存管理与追踪
- 产品信息查询
- 文档验证
- 活动签到系统
- 自动化数据录入
Features
功能特性
- Multiple Formats: QR Code, EAN-13, Code128, Code39, UPC-A, DataMatrix
- Batch Processing: Scan multiple images in one operation
- Data Extraction: Decode to text, URLs, structured data
- Image Preprocessing: Auto-rotation, enhancement for better recognition
- Validation: Verify barcode checksums
- Export: JSON, CSV output with decoded data
- 多格式支持:二维码(QR Code)、EAN-13、Code128、Code39、UPC-A、DataMatrix
- 批量处理:一次操作扫描多张图片
- 数据提取:解码为文本、URL、结构化数据
- 图像预处理:自动旋转、增强图像以提升识别效果
- 验证功能:验证条形码校验和
- 导出功能:将解码后的数据导出为JSON、CSV格式
Quick Start
快速开始
python
from qr_barcode_reader import QRBarcodeReaderpython
from qr_barcode_reader import QRBarcodeReaderRead QR code
读取二维码
reader = QRBarcodeReader()
result = reader.read_image('qr_code.png')
print(result.data) # Decoded text
reader = QRBarcodeReader()
result = reader.read_image('qr_code.png')
print(result.data) # 解码后的文本
Batch read directory
批量读取目录中的图片
results = reader.read_directory('images/', formats=['qr', 'ean13'])
undefinedresults = reader.read_directory('images/', formats=['qr', 'ean13'])
undefinedCLI Usage
CLI 使用方法
bash
undefinedbash
undefinedRead single image
读取单张图片
python qr_barcode_reader.py image.png
python qr_barcode_reader.py image.png
Batch read directory
批量读取目录中的图片
python qr_barcode_reader.py images/*.png --output results.json
undefinedpython qr_barcode_reader.py images/*.png --output results.json
undefined