简体   繁体   English

如何提高 OCR 车牌上数字的可见性

[英]How to improve the visibility of numbers on license plate for OCR

I am using easyocr methods to recognize the text on the license plate but the results are not good.我正在使用easyocr方法来识别车牌上的文字,但结果并不好。

I have developed deep learning model which detects license plates and crops them.我开发了深度学习模型,可以检测车牌并进行裁剪。

After that, I just want to detect the numbers on the license plate.之后,我只想检测车牌上的数字。 What methods can be used to improve the cropped image?可以使用哪些方法来改善裁剪后的图像?

车牌 ​​1

Output from Easy ocr - ['KA51', 'AE-7007'] Easy ocr 的输出 - ['KA51', 'AE-7007']

车牌 ​​2

Output from Easy ocr - ['KLOB BK.7779'] Easy ocr 的输出 - ['KLOB BK.7779']

Code:代码:

import easyocr
import string
reader = easyocr.Reader(['en']) 
img = "/mydrive/yolor/cropped/318_0.jpg"

#ALLOWED_LIST = string.ascii_uppercase+string.digits
#characters = reader.readtext(img, detail=0, allowlist=ALLOWED_LIST )
characters = reader.readtext(img, detail=0)
print(characters)}

You can use Pillow to adjust brightness, sharpness and/or contrast.您可以使用 Pillow 来调整亮度、锐度和/或对比度。 Here is the documentation for the image enhance functions: https://pillow.readthedocs.io/en/stable/reference/ImageEnhance.html这是图像增强功能的文档: https ://pillow.readthedocs.io/en/stable/reference/ImageEnhance.html

You will have to find something that works well enough on all pictures.您将必须找到在所有图片上都运行良好的东西。 That's why I would recommend to do something like a gridsearch and evaluate it on your dataset to find the best settings for the pre processing.这就是为什么我建议做一些类似网格搜索的事情,并在你的数据集上对其进行评估,以找到预处理的最佳设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM