Compare commits

...

4 Commits
master ... 1.3

Author SHA1 Message Date
liuruoze 4c49f89ed1 a little change
10 years ago
liuruoze 200607bae6 readme change
10 years ago
liuruoze eb83fa2ede chang readme
10 years ago
liuruoze 61b0710882 v1.3 change, fix svm train, add ann train
10 years ago

@ -61,6 +61,7 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

@ -10,23 +10,13 @@ EasyPR是一个中文的开源车牌识别系统其目标是成为一个简
### 更新
本次更新是1.3 正版,主要改进在于几个方面:
本次更新是1.3 正版,主要改进在于几个方面:
1.相对原先的1.2版本,在完整识别率上有所提升
1.修正了SVM训练的问题
![效果比较](resources/doc/res/13ver.jpg)
2.增加ANN训练功能。
2.增加了30张左右的新图片目前的测试图片数达到了204张。
3.对“字符分割”类的代码做了改善。
在1.4版本中计划做以下几点改善:
1.开放ANN训练功能。
2.新的评价框架,更加合理的评估数据。
3.新的车牌定位算法。
训练前请先记得解压训练的数据包。
### 跨平台

@ -1185,3 +1185,35 @@
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:176秒, 平均执行时间:0.862745秒
2016-01-12 11:52:36
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:175秒, 平均执行时间:0.857843秒
2016-01-12 12:03:37
总图片数:204张, 未识出图片:12张, 定位率:94.1176%
平均字符差距:0.479167个, 完全匹配数:141张, 完全匹配率:73.4375%
总时间:192秒, 平均执行时间:0.941176秒
2016-01-12 12:11:18
总图片数:204张, 未识出图片:12张, 定位率:94.1176%
平均字符差距:0.953125个, 完全匹配数:109张, 完全匹配率:56.7708%
总时间:189秒, 平均执行时间:0.926471秒
2016-01-12 12:23:55
总图片数:204张, 未识出图片:12张, 定位率:94.1176%
平均字符差距:0.479167个, 完全匹配数:140张, 完全匹配率:72.9167%
总时间:196秒, 平均执行时间:0.960784秒
2016-01-12 12:33:46
总图片数:204张, 未识出图片:12张, 定位率:94.1176%
平均字符差距:0.484375个, 完全匹配数:139张, 完全匹配率:72.3958%
总时间:191秒, 平均执行时间:0.936275秒
2016-01-12 12:37:05
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.540404个, 完全匹配数:142张, 完全匹配率:71.7172%
总时间:184秒, 平均执行时间:0.901961秒
2016-01-12 16:18:50
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.540404个, 完全匹配数:142张, 完全匹配率:71.7172%
总时间:179秒, 平均执行时间:0.877451秒
2016-01-12 17:52:47
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.540404个, 完全匹配数:142张, 完全匹配率:71.7172%
总时间:197秒, 平均执行时间:0.965686秒

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

@ -69,17 +69,26 @@ bool CPlateLocate::verifySizes(RotatedRect mr) {
float rmin = aspect - aspect * error;
float rmax = aspect + aspect * error;
float area = mr.size.height * mr.size.width;
int area = mr.size.height * mr.size.width;
float r = (float)mr.size.width / (float)mr.size.height;
if (r < 1) r = (float)mr.size.height / (float)mr.size.width;
// cout << "area:" << area << endl;
// cout << "r:" << r << endl;
if ((area < min || area > max) || (r < rmin || r > rmax))
if (area < min)
return false;
else
return true;
if (area > max)
return false;
if (r < rmin)
return false;
if (r > rmax)
return false;
return true;
}
// !基于HSV空间的颜色搜索方法
@ -123,19 +132,28 @@ int CPlateLocate::colorSearch(const Mat& src, const Color r, Mat& out,
CV_RETR_EXTERNAL, // 提取外部轮廓
CV_CHAIN_APPROX_NONE); // all pixels of each contours
vector<vector<Point>>::iterator itc = contours.begin();
while (itc != contours.end()) {
RotatedRect mr = minAreaRect(Mat(*itc));
//vector<vector<Point>>::iterator itc = contours.begin();
//while (itc != contours.end()) {
// RotatedRect mr = minAreaRect(Mat(*itc));
// // ÐèÒª½øÐдóС³ß´çÅжÏ
// if (!verifySizes(mr))
// itc = contours.erase(itc);
// else {
// ++itc;
// outRects.push_back(mr);
// }
//}
// 需要进行大小尺寸判断
if (!verifySizes(mr))
itc = contours.erase(itc);
else {
++itc;
size_t size = contours.size();
for (int i = 0; i < size; i++)
{
RotatedRect mr = minAreaRect(Mat(contours[i]));
if (verifySizes(mr))
outRects.push_back(mr);
}
}
return 0;
}

@ -240,7 +240,7 @@ int annMain() {
saveModel(10, 40);
cout << "To be end." << endl;
int end;
cin >> end;
//int end;
//cin >> end;
return 0;
}

File diff suppressed because it is too large Load Diff

@ -5,6 +5,8 @@
#include "chars.hpp"
#include "plate.hpp"
int annMain();
namespace easypr {
namespace demo {
@ -397,7 +399,7 @@ int main(int argc, const char* argv[]) {
while (!isExit) {
std::cout << "////////////////////////////////////" << std::endl;
const char* options[] = {"EasyPR Option:", "1. 测试;", "2. 批量测试;",
"3. SVMѵÁ·;", "4. ANNѵÁ·(먦·Å);",
"3. SVMѵ<EFBFBD><EFBFBD>;", "4. ANNѵ<4E><D1B5>;",
"5. GDTS生成;", "6. 开发团队;", "7. 感谢名单;",
"8. 退出;", NULL};
easypr::Utils::print_str_lines(options);
@ -419,9 +421,18 @@ int main(int argc, const char* argv[]) {
case 3:
// easypr::demo::svmMain();
std::cout << "Run \"easypr_test svm\" for more usage." << std::endl;
{
easypr::Svm svm("resources/train/data/plate_detect_svm/learn/HasPlate",
"resources/train/data/plate_detect_svm/learn/NoPlate");
svm.train();
}
break;
case 4:
// TODO
{
annMain();
}
break;
case 5:
easypr::preprocess::generate_gdts();

Loading…
Cancel
Save