|
@@ -1 +1,67 @@ |
|
|
Welcome to the HyperLPR wiki! |
|
|
|
|
|
|
|
|
[TOC] |
|
|
|
|
|
|
|
|
|
|
|
# 1. 简介 |
|
|
|
|
|
HyperLPR是一个使用深度学习针对对中文车牌识别的实现,与较为流行的开源的EasyPR相比,它的检测速度和鲁棒性和多场景的适应性都要好于目前开源的EasyPR。本安装针对Window 7 x64,Python3.5版本。 |
|
|
|
|
|
# 2. 安装依赖 |
|
|
|
|
|
基本要求: |
|
|
|
|
|
* 使用Python版的程序,比C++的准确率高,包含的车牌类型多 |
|
|
|
|
|
* 操作系统Windows 7 x64 |
|
|
|
|
|
* cpu版本 |
|
|
|
|
|
* Keras使用Tensorflow作为后端 |
|
|
|
|
|
* Python 3.5对Tensorflow适应性比较好 |
|
|
|
|
|
## 2.1. 安装Anaconda |
|
|
|
|
|
* 使用清华大学开源软件镜像站[Anaconda](https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/) |
|
|
|
|
|
* 选择[Anaconda3-4.2.0-Windows-x86_64.exe](https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.2.0-Windows-x86_64.exe)下载,其Python版本是3.5 |
|
|
|
|
|
* Anaconda自带了Numpy,Scipy,Scikit-image,PIL |
|
|
|
|
|
## 2.2. 安装Tensorflow和Keras |
|
|
|
|
|
* "开始"-“程序”-“Anaconda3”-“Anaconda Prompt”命令行打开 |
|
|
|
|
|
* 安装cpu版本的tensorflow,命令行输入 |
|
|
|
|
|
``` |
|
|
|
|
|
pip install tensorflow |
|
|
|
|
|
``` |
|
|
|
|
|
* 安装Keras,命令行输入 |
|
|
|
|
|
``` |
|
|
|
|
|
pip install Keras |
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
## 2.3. 安装OpenCV 3.3 |
|
|
|
|
|
* 使用 whl 文件进行安装,[opencv_python‑3.4.0+contrib‑cp35‑cp35m‑win_amd64.whl](https://download.lfd.uci.edu/pythonlibs/n1rrk3iq/opencv_python-3.4.0+contrib-cp35-cp35m-win_amd64.whl),若不能下载,请在[链接](https://www.lfd.uci.edu/~gohlke/pythonlibs/)查找OpenCV |
|
|
|
|
|
* 将opencv_python‑3.4.0+contrib‑cp35‑cp35m‑win_amd64.whl放到某个目录下,"开始"-“程序”-“Anaconda3”-“Anaconda Prompt”命令行打开,定位到文件目录下,命令行输入 |
|
|
|
|
|
``` |
|
|
|
|
|
pip install opencv_python‑3.4.0+contrib‑cp35‑cp35m‑win_amd64.whl |
|
|
|
|
|
``` |
|
|
|
|
|
# 3.PyCharm开发Python程序 |
|
|
|
|
|
* 使用免费的Community版本,下载最新的[PyCharm](https://www.jetbrains.com/pycharm/download/#section=windows)。 |
|
|
|
|
|
* 使用PyCharm的git下载HyperLPR |
|
|
|
|
|
* 复制batch.py为batch_py3.py,修改代码如下,支持中文字符路径 |
|
|
|
|
|
``` |
|
|
|
|
|
#coding=utf-8 |
|
|
|
|
|
import os |
|
|
|
|
|
from hyperlpr_py3 import pipline as pp |
|
|
|
|
|
|
|
|
|
|
|
import cv2 |
|
|
|
|
|
|
|
|
|
|
|
import numpy as np |
|
|
|
|
|
|
|
|
|
|
|
parent = "D:\data\license_plate_images" |
|
|
|
|
|
|
|
|
|
|
|
for filename in os.listdir(parent): |
|
|
|
|
|
print(filename) |
|
|
|
|
|
path = os.path.join(parent, filename) |
|
|
|
|
|
print(path) |
|
|
|
|
|
if path.endswith(".jpg") or path.endswith(".png"): |
|
|
|
|
|
image = cv2.imdecode(np.fromfile(path, dtype=np.uint8), -1) |
|
|
|
|
|
|
|
|
|
|
|
image, res = pp.SimpleRecognizePlate(image) |
|
|
|
|
|
cv2.imshow("image", image) |
|
|
|
|
|
cv2.waitKey(0) |
|
|
|
|
|
``` |
|
|
|
|
|
* 运行batch_py3.py,发现"hyperlpr_py3/Segmentation.py"第113行有错误 |
|
|
|
|
|
``` |
|
|
|
|
|
median = (data[size//2]+data[size//2-1])/2 |
|
|
|
|
|
``` |
|
|
|
|
|
修改为 |
|
|
|
|
|
``` |
|
|
|
|
|
median = (data[size//2]+data[size//2-1])//2 |
|
|
|
|
|
``` |
|
|
|
|
|
|