mi-task/test/plugins/qrcode/threshold.py
havoc420ubuntu c9686a84e1 feat(utils): add QR code decoding functionality
- Integrate QReader for QR code detection and decoding
- Implement decode_qrcode method in ImageProcessor class
- Uncomment run_task_1 function call in main.py
2025-05-11 16:22:21 +00:00

13 lines
286 B
Python

import cv2
# 读取图像(灰度)
image = cv2.imread('qrcode-A1.jpg', 0)
# 设置阈值
threshold_value = 100
# 进行二值化处理
_, binary_image = cv2.threshold(image, threshold_value, 255, cv2.THRESH_BINARY)
# 保存结果
cv2.imwrite('binary_qrcode-A1.jpg', binary_image)