liuruoze 10 years ago
parent a14d69cf7c
commit def46ac564

@ -93,7 +93,7 @@
<ClCompile Include="src\core\chars_segment.cpp" />
<ClCompile Include="src\core\features.cpp" />
<ClCompile Include="src\core\plate.cpp" />
<ClCompile Include="src\core\core_util.cpp" />
<ClCompile Include="src\core\core_func.cpp" />
<ClCompile Include="src\test\accuracy_test.cpp" />
<ClCompile Include="src\train\ann_train.cpp" />
<ClCompile Include="src\train\svm_train.cpp" />
@ -122,7 +122,7 @@
<ClInclude Include="src\include\plate_judge.h" />
<ClInclude Include="src\include\plate_locate.h" />
<ClInclude Include="src\include\plate_recognize.h" />
<ClInclude Include="src\include\core_util.h" />
<ClInclude Include="src\include\core_func.h" />
<ClInclude Include="src\include\prep.h" />
<ClInclude Include="src\include\util.h" />
</ItemGroup>

@ -93,7 +93,7 @@
<ClCompile Include="src\core\plate.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="src\core\core_util.cpp">
<ClCompile Include="src\core\core_func.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
@ -134,7 +134,7 @@
<ClInclude Include="src\include\plate.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="src\include\core_util.h">
<ClInclude Include="src\include\core_func.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>

@ -5,46 +5,44 @@ EasyPR是一个中文的开源车牌识别系统其目标是成为一个简
相比于其他的车牌识别系统EasyPR有如下特点
* 它基于openCV这个开源库。这意味着你可以获取全部源代码并且移植到java等平台。
* 它基于openCV这个开源库。这意味着你可以获取全部源代码并且移植到opencv支持的所有平台。
* 它能够识别中文。例如车牌为苏EUK722的图片它可以准确地输出std:string类型的"苏EUK722"的结果。
* 它的识别率较高。图片清晰情况下车牌检测与字符识别可以达到90%以上的精度。
### 版本
EasyPR最开始是发布在[GitHub](https://github.com/liuruoze/EasyPR)上的,然后在国内的[oschina](http://git.oschina.net/easypr/EasyPR)上也部署了一份镜像。
相关的issue欢迎在GitHub上统一提交。目前除了windows版本以外还有以下其他平台的版本
|版本 | 开发者 | 地址
|------|-------|-------
| android | goldriver | [linuxxx/EasyPR_Android](https://github.com/linuxxx/EasyPR_Android)
| linux | Micooz | [Micooz/EasyPR/tree/linux-dev](https://github.com/Micooz/EasyPR/tree/linux-dev)
| ios | zhoushiwei | [zhoushiwei/EasyPR-iOS](https://github.com/zhoushiwei/EasyPR-iOS)
| mac | zhoushiwei | [zhoushiwei/EasyPR](https://github.com/zhoushiwei/EasyPR)
| c# | 暂无 |
| java | 暂无 |
感谢以上所有开发者的努力!
* 它的识别率较高。图片清晰情况下车牌检测与字符识别可以达到80%以上的精度。
### 更新
本版本是EasyPR 1.2版本相比前版本的主要改进是提升了车牌定位模块的准确性从上个版本70%左右的准确率提升到目前的94%。见下图:
![1.2版综合效果](doc/res/testresult.png)
主要内容如下:
* 1.车牌定位使用了“颜色信息”+“二次Sobel”的综合搜索方法。在下面的window中红框代表Sobel定位结果黄框代表颜色定位结果。
* 车牌定位使用了“颜色信息”+“二次Sobel”的综合搜索方法。在下面的window中红框代表Sobel定位结果黄框代表颜色定位结果。
* 2.“批量测试”功能增加了一个结果查看window这个窗口可以用SetDebug()方法开闭(true开false关)。
* “批量测试”增加了一个结果查看window这个窗口可以用SetDebug()方法开闭(true开false关)。
![查看结果](doc/res/window.png)
* 3.解决了“大角度定位”问题,见下图。原图中的车牌可以被定位并转换到正确的视角。
* 基本攻克了“大角度定位”问题,下图的车牌被定位并转到了正确的视角。
![大角度定位](doc/res/bigangle.png)
* 4.GDTS里新增了若干张新测试图包括数张大角度图。
* GDTS里新增了若干张新测试图包括数张大角度图。
* “批量测试”结果现在同时会保存在“run_accuracy”文件中可以查询历史运行信息。
* 与Linux版本做了整合可以实现跨平台编译。
### 平台
目前除了windows平台以外还有以下其他平台的EasyPR版本。一些平台的版本可能会暂时落后于主平台。
|版本 | 开发者 | 版本 | 地址
|------|-------|-------|-------
| android | goldriver | 1.1 | [linuxxx/EasyPR_Android](https://github.com/linuxxx/EasyPR_Android)
| linux | Micooz | 1.2 | 已跟EasyPR整合
| ios | zhoushiwei | 1.1 | [zhoushiwei/EasyPR-iOS](https://github.com/zhoushiwei/EasyPR-iOS)
| mac | zhoushiwei | 1.1 | [zhoushiwei/EasyPR](https://github.com/zhoushiwei/EasyPR)
### 兼容性
@ -117,7 +115,7 @@ EasyPR不需要安装开发者直接在其上做改动。如果想使用DLL
| plate_recognize | 车牌识别,是车牌检测与字符识别的共有子类
| features | 特征提取回调函数
| plate | 车牌抽象
| prep.h | 预包含头文件
| core_func.h | 共有的一些函数
以下表格是src目录下一些辅助文件的解释与关系:
@ -130,10 +128,17 @@ EasyPR不需要安装开发者直接在其上做改动。如果想使用DLL
| svm_train.cpp | svm训练函数
| generate_gdts.cpp | GDTS生成函数
### 问题
### Contributer
* liuruoze作者与核心代码编写
* Micoozlinux平台编译性能优化util类
* jsxyheludeface版本一
* zhoushiweideface版本二
如果有任何问题或者建议请在issues里直接提交或者发emaileasypr_dev@163.com。
建议与问题一经采纳即会将您的贡献大名列入EasyPR的感谢名单 Credits )中。
* ahccom新的plateLocate函数
### 鸣谢

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

@ -541,3 +541,139 @@
总图片数:8张, 未识出图片:0张, 定位率:100%
平均字符差距:7.25个, 完全匹配数:0张, 完全匹配率:0%
总时间:2秒, 平均执行时间:0.25秒
2015-03-14 14:58:46
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:2.46903个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:378秒, 平均执行时间:3.15秒
2015-03-14 15:04:02
总图片数:8张, 未识出图片:1张, 定位率:87.5%
平均字符差距:2.42857个, 完全匹配数:0张, 完全匹配率:0%
总时间:27秒, 平均执行时间:3.375秒
2015-03-14 15:05:08
总图片数:8张, 未识出图片:1张, 定位率:87.5%
平均字符差距:2.42857个, 完全匹配数:0张, 完全匹配率:0%
总时间:34秒, 平均执行时间:4.25秒
2015-03-14 15:07:02
总图片数:2张, 未识出图片:1张, 定位率:50%
平均字符差距:7个, 完全匹配数:0张, 完全匹配率:0%
总时间:5秒, 平均执行时间:2.5秒
2015-03-14 15:11:01
总图片数:2张, 未识出图片:1张, 定位率:50%
平均字符差距:7个, 完全匹配数:0张, 完全匹配率:0%
总时间:5秒, 平均执行时间:2.5秒
2015-03-14 15:11:28
总图片数:2张, 未识出图片:1张, 定位率:50%
平均字符差距:7个, 完全匹配数:0张, 完全匹配率:0%
总时间:3秒, 平均执行时间:1.5秒
2015-03-14 15:11:57
总图片数:2张, 未识出图片:1张, 定位率:50%
平均字符差距:3个, 完全匹配数:0张, 完全匹配率:0%
总时间:4秒, 平均执行时间:2秒
2015-03-14 15:12:21
总图片数:2张, 未识出图片:1张, 定位率:50%
平均字符差距:3个, 完全匹配数:0张, 完全匹配率:0%
总时间:3秒, 平均执行时间:1.5秒
2015-03-14 15:13:09
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:23秒, 平均执行时间:1.64286秒
2015-03-14 15:13:40
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:13秒, 平均执行时间:0.928571秒
2015-03-14 15:15:37
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:27秒, 平均执行时间:1.92857秒
2015-03-14 15:16:21
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:22秒, 平均执行时间:1.57143秒
2015-03-14 15:19:45
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:64秒, 平均执行时间:4.57143秒
2015-03-14 15:20:52
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.25个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:44秒, 平均执行时间:3.14286秒
2015-03-14 15:25:19
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:2秒, 平均执行时间:0.142857秒
2015-03-14 15:26:01
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:2秒, 平均执行时间:0.142857秒
2015-03-14 15:26:41
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:2.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:3秒, 平均执行时间:0.214286秒
2015-03-14 15:29:41
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:1.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:3秒, 平均执行时间:0.214286秒
2015-03-14 15:50:34
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:1.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:2秒, 平均执行时间:0.142857秒
2015-03-14 15:52:29
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:89秒, 平均执行时间:0.741667秒
2015-03-14 15:58:14
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:1.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:3秒, 平均执行时间:0.214286秒
2015-03-14 15:59:55
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:81秒, 平均执行时间:0.675秒
2015-03-14 16:06:13
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:85秒, 平均执行时间:0.708333秒
2015-03-14 16:08:37
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:1.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:2秒, 平均执行时间:0.142857秒
2015-03-14 16:10:08
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:89秒, 平均执行时间:0.741667秒
2015-03-14 16:11:13
总图片数:14张, 未识出图片:6张, 定位率:57.1429%
平均字符差距:1.75个, 完全匹配数:1张, 完全匹配率:12.5%
总时间:2秒, 平均执行时间:0.142857秒
2015-03-14 16:12:43
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:87秒, 平均执行时间:0.725秒
2015-03-14 16:15:10
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.95575个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:85秒, 平均执行时间:0.708333秒
2015-03-14 16:17:09
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:87秒, 平均执行时间:0.725秒
2015-03-14 16:23:10
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:88秒, 平均执行时间:0.733333秒
2015-03-14 16:25:20
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.99115个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:85秒, 平均执行时间:0.708333秒
2015-03-14 16:32:12
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.99115个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:152秒, 平均执行时间:1.26667秒
2015-03-14 16:34:18
总图片数:120张, 未识出图片:8张, 定位率:93.3333%
平均字符差距:1.94643个, 完全匹配数:30张, 完全匹配率:26.7857%
总时间:87秒, 平均执行时间:0.725秒
2015-03-14 16:39:58
总图片数:120张, 未识出图片:7张, 定位率:94.1667%
平均字符差距:1.9646个, 完全匹配数:27张, 完全匹配率:23.8938%
总时间:85秒, 平均执行时间:0.708333秒

@ -74,7 +74,7 @@ namespace easypr{
return -3;
//判断车牌颜色以此确认threshold方法
Color plateType = getPlateType(input);
Color plateType = getPlateType(input, true);
Mat input_grey;
cvtColor(input, input_grey, CV_RGB2GRAY);
@ -95,10 +95,14 @@ namespace easypr{
threshold(input_grey, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY_INV);
else
threshold(input_grey, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
/*imshow("img_threshold", img_threshold);
waitKey(0);*/
/*if (1)
{
imshow("img_threshold", img_threshold);
waitKey(0);
destroyWindow("img_threshold");
}*/
if (m_debug)
{
stringstream ss(stringstream::in | stringstream::out);
@ -145,9 +149,14 @@ namespace easypr{
if (vecRect.size() == 0)
return -3;
vector<Rect> sortedRect;
//对符合尺寸的图块按照从左到右进行排序
SortRect(vecRect, sortedRect);
//vector<Rect> sortedRect;
////对符合尺寸的图块按照从左到右进行排序
//SortRect(vecRect, sortedRect);
vector<Rect> sortedRect(vecRect);
std::sort(sortedRect.begin(), sortedRect.end(), [](const Rect &r1, const Rect &r2) {
return r1.x < r2.x;
});
int specIndex = 0;
//获得指示城市的特定Rect,如苏A的"A"
@ -317,17 +326,22 @@ namespace easypr{
int CCharsSegment::RebuildRect(const vector<Rect>& vecRect, vector<Rect>& outRect, int specIndex)
{
//最大只能有7个Rect,减去中文的就只有6个Rect
int count = 6;
//int count = 6;
for (int i = 0; i < vecRect.size(); i++)
{
//将特殊字符左边的Rect去掉这个可能会去掉中文Rect不过没关系我们后面会重建。
if (i < specIndex)
continue;
//for (int i = 0; i < vecRect.size(); i++)
//{
// //将特殊字符左边的Rect去掉这个可能会去掉中文Rect不过没关系我们后面会重建。
// if (i < specIndex)
// continue;
// outRect.push_back(vecRect[i]);
// if (!--count)
// break;
//}
int count = 6;
for (size_t i = specIndex; i < vecRect.size() && count; ++i, --count) {
outRect.push_back(vecRect[i]);
if (!--count)
break;
}
return 0;

@ -3,7 +3,7 @@
// 这个部分中的函数轻易不要改动
#include "../include/prep.h"
#include "../include/core_util.h"
#include "../include/core_func.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides
@ -13,25 +13,23 @@ namespace easypr {
//! 根据一幅图像与颜色模板获取对应的二值图
//! 输入RGB图像, 颜色模板(蓝色、黄色)
//! 输出灰度图只有0和255两个值255代表匹配0代表不匹配
Mat colorMatch(const Mat& src, Mat& match, const Color r)
Mat colorMatch(const Mat& src, Mat& match, const Color r, const bool adaptive_minsv)
{
// S和V的最小值由adaptive_minsv这个bool值判断
// 如果为true则最小值取决于H值按比例衰减
// 如果为false则不再自适应使用固定的最小值minabs_sv
// 默认为false
const int max_sv = 255;
const int minref_sv = 64;
const int minabs_sv = 90;
const bool adaptive_minsv = false;
const float max_sv = 255;
const float minref_sv = 64;
const float minabs_sv = 90;
//blue的H范围
const int min_blue = 100;
const int max_blue = 140;
const int min_blue = 100; //100
const int max_blue = 140; //140
//yellow的H范围
const int min_yellow = 15;
const int max_yellow = 40;
const int min_yellow = 15; //15
const int max_yellow = 40; //40
Mat src_hsv;
// 转到HSV空间进行处理颜色搜索主要使用的是H分量进行蓝色与黄色的匹配工作
@ -103,9 +101,9 @@ namespace easypr {
// S和V的最小值由adaptive_minsv这个bool值判断
// 如果为true则最小值取决于H值按比例衰减
// 如果为false则不再自适应使用固定的最小值minabs_sv
int min_sv = 0;
float min_sv = 0;
if (true == adaptive_minsv)
min_sv = minref_sv - minref_sv / 2 * (1 - Hdiff_p);
min_sv = minref_sv - minref_sv /2 * (1 - Hdiff_p); // inref_sv - minref_sv / 2 * (1 - Hdiff_p)
else
min_sv = minabs_sv; // add
@ -140,16 +138,16 @@ namespace easypr {
//! 判断一个车牌的颜色
//! 输入车牌mat与颜色模板
//! 返回true或fasle
bool plateColorJudge(Mat src, const Color r)
bool plateColorJudge(const Mat& src, const Color r, const bool adaptive_minsv)
{
// 判断阈值
const float thresh = 0.5;
Mat src_gray;
colorMatch(src, src_gray, r);
colorMatch(src, src_gray, r, adaptive_minsv);
float percent = float(countNonZero(src_gray)) / float(src_gray.rows * src_gray.cols);
//cout << "percent:" << percent << endl;
// cout << "percent:" << percent << endl;
if (percent > thresh)
return true;
@ -159,13 +157,13 @@ namespace easypr {
//getPlateType
//判断车牌的类型
Color getPlateType(Mat src)
Color getPlateType(const Mat& src, const bool adaptive_minsv)
{
if (plateColorJudge(src, BLUE) == true) {
if (plateColorJudge(src, BLUE, adaptive_minsv) == true) {
//cout << "BLUE" << endl;
return BLUE;
}
else if (plateColorJudge(src, YELLOW) == true) {
else if (plateColorJudge(src, YELLOW, adaptive_minsv) == true) {
//cout << "YELLOW" << endl;
return YELLOW;
}

@ -4,7 +4,7 @@
#include "../include/prep.h"
#include "../include/features.h"
#include "../include/core_util.h"
#include "../include/core_func.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides

@ -10,6 +10,9 @@ CPlateDetect::CPlateDetect()
//cout << "CPlateDetect" << endl;
m_plateLocate = new CPlateLocate();
m_plateJudge = new CPlateJudge();
// 默认EasyPR在一幅图中定位最多3个车
m_maxPlates = 3;
}
void CPlateDetect::LoadSVM(string s)
@ -65,7 +68,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector<Mat>& resultVec, bool showDete
vector<CPlate> all_result_Plates;
//如果颜色查找找到n个以上包含n个的车牌就不再进行Sobel查找了。
const int color_find_max = 4;
const int color_find_max = m_maxPlates;
Mat result;
src.copyTo(result);

@ -118,11 +118,11 @@ int CPlateLocate::colorSearch(const Mat& src, const Color r, Mat& out, vector<Ro
{
Mat match_grey;
const int color_morph_width = 8;
const int color_morph_width = 10;
const int color_morph_height = 2;
// 进行颜色查找
colorMatch(src, match_grey, r);
colorMatch(src, match_grey, r, false);
if (0){
imshow("match_grey", match_grey);
@ -215,73 +215,6 @@ bool CPlateLocate::sobelJudge(Mat roi)
}
bool CPlateLocate::charJudge(Mat roi)
{
int plateType = getPlateType(roi);
Mat roi_gray;
cvtColor(roi, roi_gray, CV_RGB2GRAY);
//Threshold input image
Mat img_threshold;
if (1 == plateType)
threshold(roi_gray, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
else
threshold(roi_gray, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY_INV);
//去除车牌上方的柳钉以及下方的横线等干扰
clearLiuDing(img_threshold);
imshow("charJudge", img_threshold);
waitKey(0);
vector< vector< Point> > contours;
findContours(img_threshold,
contours, // a vector of contours
CV_RETR_EXTERNAL, // retrieve the external contours
CV_CHAIN_APPROX_NONE); // all pixels of each contours
//Start to iterate to each contour founded
vector<vector<Point> >::iterator itc = contours.begin();
vector<Rect> vecRect;
while (itc != contours.end())
{
Rect mr = boundingRect(Mat(*itc));
Mat auxRoi(img_threshold, mr);
if (verifyCharSizes(auxRoi))
vecRect.push_back(mr);
++itc;
}
if (vecRect.size() <= 4)
return false;
return true;
//Mat src_blur;
//GaussianBlur(roi, src_blur, Size(m_GaussianBlurSize, m_GaussianBlurSize), 0, 0, BORDER_DEFAULT);
//Mat src_grey;
//cvtColor(src_blur, src_grey, CV_RGB2GRAY);
//Mat src_threshold;
//double otsu_thresh_val = threshold(src_grey, src_threshold, 0, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
//Mat src_edge;
//double high_thresh_val = otsu_thresh_val, lower_thresh_val = otsu_thresh_val * 0.5;
//Canny(src_grey, src_edge, lower_thresh_val, high_thresh_val, 3, true);
//namedWindow("canny", CV_WINDOW_AUTOSIZE);
//imshow("canny", src_edge);
//waitKey(0);
return true;
}
//! 字符尺寸验证
bool CPlateLocate::verifyCharSizes(Mat r)
{
@ -514,9 +447,14 @@ int CPlateLocate::deskew(const Mat& src, const Mat& src_b, vector<RotatedRect>&
resize(deskew_mat, plate_mat, plate_mat.size(), 0, 0, INTER_AREA);
else
resize(deskew_mat, plate_mat, plate_mat.size(), 0, 0, INTER_CUBIC);
/*imshow("plate_mat", plate_mat);
waitKey(0);*/
/*if (1)
{
imshow("plate_mat", plate_mat);
waitKey(0);
destroyWindow("plate_mat");
}*/
CPlate plate;
plate.setPlatePos(roi_rect);

@ -44,7 +44,7 @@ namespace easypr {
inline string getPlateColor(Mat input) const
{
string color = "δ֪";
Color result = getPlateType(input);
Color result = getPlateType(input, true);
if (BLUE == result)
color = "À¶ÅÆ";
if (YELLOW == result)

@ -13,7 +13,7 @@
#define __CHARS_SEGMENT_H__
#include "prep.h"
#include "core_util.h"
#include "core_func.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides

@ -1,5 +1,5 @@
#ifndef __PLATE_UTIL_H__
#define __PLATE_UTIL_H__
#ifndef __CORE_FUNC_H__
#define __CORE_FUNC_H__
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides
@ -11,12 +11,12 @@ namespace easypr {
//! 根据一幅图像与颜色模板获取对应的二值图
//! 输入RGB图像, 颜色模板(蓝色、黄色)
//! 输出灰度图只有0和255两个值255代表匹配0代表不匹配
Mat colorMatch(const Mat& src, Mat& match, const Color r);
Mat colorMatch(const Mat& src, Mat& match, const Color r, const bool adaptive_minsv);
//! 判断一个车牌的颜色
//! 输入车牌mat与颜色模板
//! 返回true或fasle
bool plateColorJudge(Mat src, const Color r);
bool plateColorJudge(const Mat& src, const Color r, const bool adaptive_minsv);
//clearLiuDing
//去除车牌上方的钮钉
@ -25,7 +25,7 @@ namespace easypr {
Mat clearLiuDing(Mat img);
//! 获得车牌颜色
Color getPlateType(Mat input);
Color getPlateType(const Mat& src, const bool adaptive_minsv);
//! 直方图均衡
Mat histeq(Mat in);
@ -36,4 +36,4 @@ namespace easypr {
} /*! \namespace easypr*/
#endif
/* endif __PLATE_UTIL_H__ */
/* endif __CORE_FUNC_H__ */

@ -69,8 +69,14 @@ public:
inline void setJudgeAngle(int param){m_plateLocate->setJudgeAngle(param);}
inline void setMaxPlates(float param){ m_maxPlates = param; }
inline float getMaxPlates() const { return m_maxPlates; }
private:
//!车牌定位
//! 设置一幅图中最多有多少车牌
int m_maxPlates;
//! 车牌定位
CPlateLocate* m_plateLocate;
//! łľĹĆĹĐśĎ

@ -16,7 +16,7 @@
#include "prep.h"
#include "plate.h"
#include "features.h"
#include "core_util.h"
#include "core_func.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides

@ -16,7 +16,7 @@
#include "prep.h"
#include "plate.h"
#include "core_util.h"
#include "core_func.h"
/*! \namespace easypr
Namespace where all the C++ EasyPR functionality resides
@ -69,7 +69,6 @@ public:
//! 未使用函数与代码
//! 开始------------
bool charJudge(Mat roi);
bool sobelJudge(Mat roi);
int deskewOld(Mat src, vector<RotatedRect>& inRects, vector<RotatedRect>& outRects, vector<Mat>& outMats, LocateType locateType);
bool verifyCharSizes(Mat r);

@ -97,7 +97,7 @@ int main(int argc, char *argv[])
cout << endl;
cout << "本项目在建设过程中,受到了很多人的帮助,其中以下是对本项目做出突出贡献的" << endl;
cout << "(贡献包括有益建议,代码调优,数据提供等等,排名按时间顺序)" << endl;
cout << "taotao1233唐大侠jsxyhelu如果有一天(zhoushiwei)学习奋斗袁承志圣城小石匠goldriverMicooz梦里时光Rain Wang" << endl;
cout << "taotao1233唐大侠jsxyhelu如果有一天(zhoushiwei)学习奋斗袁承志圣城小石匠goldriverMicooz梦里时光Rain Wangahccom" << endl;
cout << "还有很多的同学对本项目也给予了鼓励与支持,在此也一并表示真诚的谢意!" << endl;
cout << endl;
break;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save