基于 OpenCV 的车牌识别系统的设计与实现
摘要 根据中国汽车工业协会统计分析,近年来汽车产销比呈现持续增长趋势。
汽车拥有率的增长给我国交通部门工作造成的压力也在持续增长,但是目前已经存在的车牌识别系统并不能很好地适应持续增长的工作量,识别效率与识别准确率也有待优化,并且人机交互页面也不够友好。为缓解交通部门日子增加的工作量、推进智能交通的推广、更加准确高效地完成车牌识别的工作,设计一款高效率且人机交互界面友好的车牌识别系统成为时代所趋。
本文设计并实现了一个基于 OpenCV(Open Source Computer Vision Library)的车牌识别系统,并设计了一个停车场仿真系统用于测试并展示车牌识别系统的识别成果。车牌识别系统可以在一般电脑上对车辆检测和车牌识别的模型进行训练,并流畅测试运行。用户可以选择一定数量的待检测图像导入到指定文件夹下, 车牌识别系统运行完成后会完成车辆检测和车牌识别工作,并将检测后图像存入指定文件夹下,将图像文件名与其对应识别信息写入表格方便查阅。停车场仿真系统会根据登录权限展示不同页面,普通用户可以进行进入、离开停车场以及计费、支付的仿真操作,管理员用户可以管理、统计、查看停车场中车辆。
本文对现有的车辆检测以及车牌识别算法进行研究,选用了较为符合需求的WPOD-Net 深度网络(Warped Planar Object Detection Network)作为车辆检测算法以及 OCRNet 深度网络(Optical Character Recognition Network)作为车牌识别算法,并使用 OpenCV 框架调用 YOLOv5 (You Only Look Once)进行模型的训
练以及部署。软件采用较为轻量便捷的 GU(I Graphical User Interface)框架 Tkinter
开发编写停车场仿真系统,界面简单清爽,运行流畅。
关键词:深度学习 WpodNet OCRNet 车牌识别 OpenCV Tkinter
Design and Implementation of a License Plate Recognition System
Based on OpenCV
Abstract According to the statistical analysis of the China Association of Automobile Manufacturers, the automobile production sales ratio has shown a continuous growth trend in recent years. The increase in car ownership has also continued to put
pressure on the work of China's transportation department. However, the existing license plate recognition systems cannot adapt well to the continuous increase in workload, and recognition efficiency and accuracy still need to be optimized, and human-computer interaction pages are not user-friendly enough. To alleviate the increasing workload of transportation departments, promote the promotion of intelligent transportation, and complete the work of license plate recognition more accurately and efficiently, designing an efficient and user-friendly license plate recognition system has become a trend of the times.
This article designs and implements a license plate recognition system based on OpenCV, and designs a parking lot simulation system to test and display the recognition results of the license plate recognition system. The license plate recognition system can retrain the model of vehicle detection and license plate recognition on a general computer, and smoothly test and run it. Users can select a certain number of images to be detected and import them into a designated folder. After the license plate recognition system runs, it will complete the vehicle detection and license plate recognition work, and store the detected images in the designated folder. The image file name and its corresponding recognition information will be written into the table for easy reference. The parking lot simulation system will display different pages based on login permissions. Ordinary users can perform simulation operations such as entering and leaving the parking lot, as well as billing and payment. Administrator users can manage, count, and view vehicles in the parking lot.
This article conducts research on existing vehicle detection and license plate recognition algorithms, selecting WpodNet vehicle detection algorithm and OCRNet
license plate recognition algorithm that meet the requirements, and utilizing the YOLOv5 framework that extensively uses OpenCV for model training and deployment. The software adopts the relatively lightweight and convenient GUI framework Tkinter to develop and write a parking lot simulation system, with a simple and refreshing interface and smooth operation.
Key words: Deep learning WpodNet OCRNet License Plate Recognition OpenCV Tkinter
4.3 软件设计目标................................................ 21
4.4 软件功能需求分析............................................ 21
4.4.1 车牌检测模块 .......................................... 22
4.4.2 车牌识别模块 .......................................... 22
4.4.3 基于车牌识别的停车场仿真系统模块 ...................... 23
4.4 软件总体设计................................................ 24
4.5 软件功能流程图.............................................. 26
第五章 车牌识别系统软件实现 27
5.1 车牌检测算法实现............................................ 27
5.1.1 车牌检测网络实现 ...................................... 27
5.1.2 数据集的选择与训练 .................................... 27
5.2 车牌识别算法实现............................................ 30
5.2.1 车牌识别网络实现 ...................................... 30
5.2.2 数据集的选择与训练 .................................... 30
5.3 软件开发环境................................................ 31
5.4 停车场仿真模块实现.......................................... 32
5.4.1 登录界面 .............................................. 32
5.4.2 普通用户界面 .......................................... 33
5.4.3 管理员用户界面 ........................................ 35
结论 38
致谢 39
参考文献: 40