Commit d564e868 by 杨林龙

优化OCR识别

1 parent 1e8314d6
...@@ -194,6 +194,11 @@ for index, row in enumerate(result): ...@@ -194,6 +194,11 @@ for index, row in enumerate(result):
print("File downloaded successfully.") print("File downloaded successfully.")
original_image = Image.open(path) original_image = Image.open(path)
# 将4个通道的转为3个通道
if original_image.mode == "RGBA":
original_image = original_image.convert("RGB")
print(original_image.mode)
# 创建对比度增强器 # 创建对比度增强器
# enhancer = ImageEnhance.Contrast(original_image) # enhancer = ImageEnhance.Contrast(original_image)
......
...@@ -76,7 +76,7 @@ ocr = PaddleOCR( ...@@ -76,7 +76,7 @@ ocr = PaddleOCR(
# 定义要执行的SQL语句 # 定义要执行的SQL语句
SQL = """ SQL = """
SELECT b.* FROM sys_vin_check_ocr_06 a LEFT JOIN sys_order_file_ocr b ON b.id = a.file_id SELECT b.* FROM sys_vin_check_ocr_10 a LEFT JOIN sys_order_file_ocr b ON b.id = a.file_id
WHERE db_vin NOT LIKE '%*%' AND ocr_vin != db_vin OR ocr_vin IS NULL; WHERE db_vin NOT LIKE '%*%' AND ocr_vin != db_vin OR ocr_vin IS NULL;
""" """
# 执行SQL语句 # 执行SQL语句
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!