- Integrate QReader for QR code detection and decoding - Implement decode_qrcode method in ImageProcessor class - Uncomment run_task_1 function call in main.py
13 lines
327 B
Python
13 lines
327 B
Python
from qreader import QReader
|
|
import cv2
|
|
|
|
# 创建QReader实例
|
|
qreader = QReader()
|
|
|
|
# 读取包含二维码的图像
|
|
image = cv2.cvtColor(cv2.imread("captured_images/qrcode-2/image_20250511_103244.png"), cv2.COLOR_BGR2RGB)
|
|
|
|
# 检测并解码二维码
|
|
decoded_text = qreader.detect_and_decode(image=image)
|
|
|
|
print(decoded_text[0]) |