- 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
286 B
Python
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) |