From e874e7b4bfaaaef0eee3f65d410e1781137cf64e Mon Sep 17 00:00:00 2001 From: the1dog Date: Mon, 17 Aug 2020 23:38:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=82=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .classpath | 35 ++++++++++++++ .gitignore | 23 +++++++++ .project | 23 +++++++++ HDH.txt | 22 +++++++++ LICENSE | 29 ++++++++++++ README.md | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 268 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 HDH.txt create mode 100644 LICENSE create mode 100644 README.md diff --git a/.classpath b/.classpath new file mode 100644 index 00000000..4094b033 --- /dev/null +++ b/.classpath @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a1c2a238 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/.project b/.project new file mode 100644 index 00000000..43c4144f --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + yx-image-recognition + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/HDH.txt b/HDH.txt new file mode 100644 index 00000000..3529f8ed --- /dev/null +++ b/HDH.txt @@ -0,0 +1,22 @@ +A00000 2020-08-17 13:36:08 +A00000 2020-08-17 13:51:40 +A00001 2020-08-17 13:52:15 +A00001 2020-08-17 13:52:17 +京A34291 2020-08-17 14:14:08 +京A34291 2020-08-17 14:14:55 +京AG6666 2020-08-17 14:15:01 +京AG6666 2020-08-17 14:15:04 +粤B88888 2020-08-17 14:20:02 +琼A 2020-08-17 14:20:02 +粤B88888 2020-08-17 14:20:05 +琼A 2020-08-17 14:20:05 +京A88731 2020-08-17 14:20:13 +京A88731 2020-08-17 14:20:16 +湘B5555 2020-08-17 14:20:25 +湘B5555 2020-08-17 14:20:47 +粤B88888 2020-08-17 14:22:01 +琼A 2020-08-17 14:22:01 +粤B88888 2020-08-17 14:22:04 +琼A 2020-08-17 14:22:04 +苏N00000 2020-08-17 14:22:10 +苏N00000 2020-08-17 14:22:12 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..435dd2bb --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2020, yuxue +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..857f7b56 --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# yx-image-recognition + +#### 介绍 +- **spring boot + maven 实现的车牌识别及训练系统** +- 基于java语言的深度学习项目,在整个开源社区来说都相对较少;而基于java语言实现车牌识别EasyPR-Java项目,最后的更新已经是五年以前。 +- **本人参考了EasyPR原版C++项目、以及fan-wenjie的EasyPR-Java项目;同时查阅了部分opencv官方4.0.1版本C++的源码,结合个人对java语言理解,整理出当前项目** +- 这是一个**入门级教程项目**,本人目前也正在学习图片识别相关技术;大牛请绕路 +- 当前项目在原有EasyPR项目基础上,增加了绿牌识别功能,只不过当前的训练库文件包含绿牌的样本太少,还需要重新增加绿牌样本的训练,后续会逐步上传 +- 当前已经添加基于svm算法的车牌检测训练、以及基于ann算法的车牌号码识别训练功能 +- 后续会逐步加入证件识别、人脸识别等功能 + +#### 包含功能 +- ****$\color{yellow}{黄}$** **$\color{blue}{蓝}$** **$\color{green}{绿}$**** **黄蓝绿车牌检测及车牌号码识别** +- 单张图片、多张图片并发、单图片多车牌检测及识别 +- **图片车牌检测训练** +- **图片文字识别训练** +- 包含两种依赖包的实现方式: 基于org.bytedeco.javacpp包的实现方式; 基于org.opencv官方包的实现方式 +- org.opencv官方包,提供了java语言api;java项目可以通过build path方式或者环境变量的方式引用; +- org.bytedeco.javacpp包,JavaCPP是一个开源库,它提供了在 Java 中高效访问本地 C++的方法;在pom中引入坐标依赖即可 + +#### 软件版本 +- jdk 1.8.61+ +- maven 3.0+ +- opencv 4.0.1 ; javacpp1.4.4;opencv-platform 4.0.1-1.4.4 +- spring boot 2.1.5.RELEASE +- yx-image-recognition 1.0.0版本 + +#### 软件架构 +- B/S 架构,前端html + requireJS,后端java +- 数据库使用 sqlite3.0 +- 接口文档使用swagger 2.0 + +#### 操作界面 +![1.png](./doc/doc_image/1.png) + +#### 车牌检测过程 + +高斯模糊: + +![1.png](./doc/doc_image/debug_GaussianBlur.jpg) + +图像灰度化: + +![1.png](./doc/doc_image/debug_gray.jpg) + +Sobel 算子: + +![1.png](./doc/doc_image/debug_Sobel.jpg) + +图像二值化: + +![1.png](./doc/doc_image/debug_threshold.jpg) + +图像闭操作: + +![1.png](./doc/doc_image/debug_morphology.jpg) + +二值图像降噪: + +![1.png](./doc/doc_image/debug_morphology1.jpg) + +提取外部轮廓: + +![1.png](./doc/doc_image/debug_Contours.jpg) + +外部轮廓筛选: + +![1.png](./doc/doc_image/107_screenblock.jpg) + +切图: + +![1.png](./doc/doc_image/debug_crop_1.jpg) +![1.png](./doc/doc_image/debug_crop_2.jpg) +![1.png](./doc/doc_image/debug_crop_3.jpg) + +重置切图尺寸: + +![1.png](./doc/doc_image/debug_resize_1.jpg) +![1.png](./doc/doc_image/debug_resize_2.jpg) +![1.png](./doc/doc_image/debug_resize_3.jpg) + +车牌检测结果: + +![1.png](./doc/doc_image/result_0.png) + +#### 图片车牌文字识别过程 + +debug_char_threshold: + +![1.png](./doc/doc_image/debug_char_threshold.jpg) + +debug_char_clearLiuDing: + +![1.png](./doc/doc_image/debug_char_clearLiuDing.jpg) + +debug_specMat: + +![1.png](./doc/doc_image/debug_specMat.jpg) + +debug_chineseMat: + +![1.png](./doc/doc_image/debug_chineseMat.jpg) + +debug_char_auxRoi: + +![1.png](./doc/doc_image/debug_char_auxRoi_0.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_1.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_2.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_3.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_4.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_5.jpg) +![1.png](./doc/doc_image/debug_char_auxRoi_6.jpg) + + +#### 安装教程 +- 开发环境搭建: [./doc/01_开发环境搭建.md](./doc/01_开发环境搭建.md) +- 将项目拉取到本地,PlateDetect文件夹拷贝到d盘下,默认车牌识别操作均在d:/PlateDetect/目录下处理 +- 需要修改操作路径,修改com/yuxue/constant/Constant.java文件常量参数即可,可以使用绝对盘符路径,也可以使用项目相对路径 +- spring boot方式运行项目,浏览器上输入 http://localhost:16666/index 即可打开操作界面 +- 浏览器上输入 http://localhost:16666/swagger-ui.html 即可打开接口文档页面 + + +#### 使用说明 + +- **车牌图片来源于网络,仅用于交流学习,不得用于商业用途;如有侵权,请联系本人删除** +- 转发请注明出处; 本项目作者:yuxue,一个不资深的java语言从业者 +- 作者gitee地址: https://gitee.com/admin_yu +- 作者csdn微博地址:https://blog.csdn.net/weixin_42686388 + +#### 参考文档 + +- liuruoze/EasyPR:https://gitee.com/easypr/EasyPR?_from=gitee_search +- fan-wenjie/EasyPR-Java: https://github.com/fan-wenjie/EasyPR-Java +- opencv官方: https://opencv.org/ + +