This research aims at simply developping plate recognition project based on deep learning methods, with low complexity and high speed. This
project has been used by some commercial corporations. Free and open source, deploying by Zeusee.
添加的新的Python 序列模型-识别率大幅提高(尤其汉字)(2018.3.12)
添加了HyperLPR Lite 仅仅需160 行代码即可实现车牌识别(2018.3.12)
提供精确定位的车牌矩形框(2018.3.12)
增加了端到端模型的cpp实现(Linux)(2018.1.31)
增加字符分割训练代码和字符分割介绍(2018.1.)
更新了Android实现,大幅提高准确率和速度 (骁龙835 (720x1280) ~50ms )(2017.12.27)
添加了IOS版本的实现(感谢xiaojun123456的工作)
添加端到端的序列识别模型识别率大幅度提升,使得无需分割字符即可识别,识别速度提高20% (2017.11.17)
新增的端到端模型可以识别新能源车牌、教练车牌、白色警用车牌、武警车牌 (2017.11.17)
更新Windows版本的Visual Studio 2015 工程(2017.11.15)
增加cpp版本,目前仅支持标准蓝牌(需要依赖OpenCV 3.3) (2017.10.28)
推荐使用新更新的HyperLPR Lite,仅需一单独文件。
import HyperLPRLite as pr
import cv2
import numpy as np
grr = cv2.imread("images_rec/demo1.jpg")
model = pr.LPR("model/cascade.xml","model/model12.h5","model/ocr_plate_all_gru.h5")
for pstr,confidence,rect in model.SimpleRecognizePlateByE2E(grr):
if confidence>0.7:
image = drawRectBox(grr, rect, pstr+" "+str(round(confidence,3)))
print("plate_str",pstr)
print("plate_confidence",confidence)
cv2.imshow("image",image)
cv2.waitKey(0)
cd cpp_implementation
mkdir build
cd build
cmake ../
sudo make -j
#include "../include/Pipeline.h"
int main(){
pr::PipelinePR prc("model/cascade.xml",
"model/HorizonalFinemapping.prototxt","model/HorizonalFinemapping.caffemodel",
"model/Segmentation.prototxt","model/Segmentation.caffemodel",
"model/CharacterRecognization.prototxt","model/CharacterRecognization.caffemodel",
"model/SegmentationFree.prototxt","model/SegmentationFree.caffemodel"
);
//定义模型文件
cv::Mat image = cv::imread("/Users/yujinke/ClionProjects/cpp_ocr_demo/test.png");
std::vector<pr::PlateInfo> res = prc.RunPiplineAsImage(image,pr::SEGMENTATION_FREE_METHOD);
//使用端到端模型模型进行识别 识别结果将会保存在res里面
for(auto st:res) {
if(st.confidence>0.75) {
std::cout << st.getPlateName() << " " << st.confidence << std::endl;
//输出识别结果 、识别置信度
cv::Rect region = st.getPlateRect();
//获取车牌位置
cv::rectangle(image,cv::Point(region.x,region.y),cv::Point(region.x+region.width,region.y+region.height),cv::Scalar(255,255,0),2);
//画出车牌位置
}
}
cv::imshow("image",image);
cv::waitKey(0);
return 0 ;
}
车牌识别框架开发时使用的数据并不是很多,有意着可以为我们提供相关车牌数据。联系邮箱 455501914@qq.com。