Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.3 #238

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

1.3 #238

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Demo.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.新的车牌定位算法。
训练前请先记得解压训练的数据包。

### 跨平台

Expand Down
32 changes: 32 additions & 0 deletions accuracy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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��
7,746 changes: 3,873 additions & 3,873 deletions resources/model/ann.xml

Large diffs are not rendered by default.

Binary file modified resources/train/data/chars_recognise_ann/chars2.7z
Binary file not shown.
Binary file modified resources/train/data/chars_recognise_ann/charsChinese.7z
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 31 additions & 13 deletions src/core/plate_locate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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�ռ����ɫ��������
Expand Down Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/train/ann_train.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ int annMain() {
saveModel(10, 40);

cout << "To be end." << endl;
int end;
cin >> end;
//int end;
//cin >> end;
return 0;
}