# Conflicts:
#	accuracy.txt
#	include/easypr/core/chars_recognise.h
#	include/easypr/core/chars_segment.h
#	src/core/chars_recognise.cpp
#	src/core/plate_recognize.cpp
#	src/train/ann_train.cpp
v1.6alpha
Micooz 10 years ago
commit 25adeea4ef

@ -243,4 +243,6 @@ $ ./easypr_test svm --train --has-plate=has/ --no-plate=no/ --divide --svm=save/
taotao1233邱锦山唐大侠jsxyhelu如果有一天(zhoushiwei),学习奋斗,袁承志,
圣城小石匠goldriverMicooz梦里时光Rain Wang任薛纪ahccom星夜落尘海豚嘎嘎(车主之家)刘超以及所有对EasyPR贡献数据的热心同学。
圣城小石匠goldriverMicooz梦里时光Rain Wang任薛纪ahccom星夜落尘海豚嘎嘎(车主之家)
刘超Free&&Easy, 以及所有对EasyPR贡献数据的热心同学。

@ -1185,7 +1185,99 @@
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:176秒, 平均执行时间:0.862745秒
2015-08-05 14:09:17
总图片数:204张, 未识出图片:5张, 定位率:97.549%
平均字符差距:0.567839个, 完全匹配数:148张, 完全匹配率:74.3719%
总时间:230秒, 平均执行时间:1.12745秒
2015-07-31 17:53:07
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:182秒, 平均执行时间:0.892157秒
2015-07-31 18:02:12
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:183秒, 平均执行时间:0.897059秒
2015-07-31 18:06:37
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:182秒, 平均执行时间:0.892157秒
2015-07-31 18:11:16
总图片数:1张, 未识出图片:0张, 定位率:100%
平均字符差距:0个, 完全匹配数:1张, 完全匹配率:100%
总时间:1秒, 平均执行时间:1秒
2015-07-31 18:11:31
总图片数:1张, 未识出图片:0张, 定位率:100%
平均字符差距:0个, 完全匹配数:1张, 完全匹配率:100%
总时间:0秒, 平均执行时间:0秒
2015-07-31 18:18:20
总图片数:1张, 未识出图片:0张, 定位率:100%
平均字符差距:0个, 完全匹配数:1张, 完全匹配率:100%
总时间:0秒, 平均执行时间:0秒
2015-07-31 18:21:34
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.510101个, 完全匹配数:147张, 完全匹配率:74.2424%
总时间:182秒, 平均执行时间:0.892157秒
2015-07-31 18:32:25
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:1.05556个, 完全匹配数:108张, 完全匹配率:54.5455%
总时间:214秒, 平均执行时间:1.04902秒
2015-07-31 18:36:36
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.510101个, 完全匹配数:147张, 完全匹配率:74.2424%
总时间:183秒, 平均执行时间:0.897059秒
2015-07-31 18:41:32
总图片数:1张, 未识出图片:0张, 定位率:100%
平均字符差距:0个, 完全匹配数:1张, 完全匹配率:100%
总时间:0秒, 平均执行时间:0秒
2015-07-31 18:44:39
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.959596个, 完全匹配数:115张, 完全匹配率:58.0808%
总时间:184秒, 平均执行时间:0.901961秒
2015-07-31 18:50:08
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.914141个, 完全匹配数:115张, 完全匹配率:58.0808%
总时间:185秒, 平均执行时间:0.906863秒
2015-07-31 18:53:53
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:186秒, 平均执行时间:0.911765秒
2015-07-31 19:01:29
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:1.01515个, 完全匹配数:111张, 完全匹配率:56.0606%
总时间:187秒, 平均执行时间:0.916667秒
2015-07-31 19:09:06
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.535354个, 完全匹配数:146张, 完全匹配率:73.7374%
总时间:202秒, 平均执行时间:0.990196秒
2015-07-31 19:13:50
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:215秒, 平均执行时间:1.05392秒
2015-07-31 20:00:31
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.520202个, 完全匹配数:145张, 完全匹配率:73.2323%
总时间:184秒, 平均执行时间:0.901961秒
2015-07-31 20:07:10
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.535354个, 完全匹配数:146张, 完全匹配率:73.7374%
总时间:221秒, 平均执行时间:1.08333秒
2015-07-31 20:12:20
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.550505个, 完全匹配数:144张, 完全匹配率:72.7273%
总时间:225秒, 平均执行时间:1.10294秒
2015-07-31 20:27:53
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.550505个, 完全匹配数:143张, 完全匹配率:72.2222%
总时间:210秒, 平均执行时间:1.02941秒
2015-07-31 20:52:02
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.540404个, 完全匹配数:142张, 完全匹配率:71.7172%
总时间:204秒, 平均执行时间:1秒
2015-07-31 20:55:51
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.550505个, 完全匹配数:143张, 完全匹配率:72.2222%
总时间:206秒, 平均执行时间:1.0098秒
2015-07-31 21:32:29
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.550505个, 完全匹配数:143张, 完全匹配率:72.2222%
总时间:182秒, 平均执行时间:0.892157秒
2015-07-31 21:36:50
总图片数:204张, 未识出图片:6张, 定位率:97.0588%
平均字符差距:0.550505个, 完全匹配数:144张, 完全匹配率:72.7273%
总时间:195秒, 平均执行时间:0.955882秒

@ -25,7 +25,7 @@ class CPlateRecognize : public CPlateDetect, public CCharsRecognise {
CPlateRecognize();
//! 车牌检测与字符识别
int plateRecognize(cv::Mat src, std::vector<std::string>& licenseVec);
int plateRecognize(cv::Mat src, std::vector<std::string>& licenseVec, int index = 0);
//! 生活模式与工业模式切换
inline void setLifemode(bool param) { CPlateDetect::setPDLifemode(param); }

File diff suppressed because it is too large Load Diff

@ -73,7 +73,7 @@ Mat CCharsSegment::preprocessChar(Mat in) {
//! ×Ö·û·Ö¸îÓëÅÅÐò
int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec, int index) {
if (!input.data) return 0x01;
@ -135,7 +135,7 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
if (m_debug) {
stringstream ss(stringstream::in | stringstream::out);
ss << "resources/image/tmp/debug_char_threshold" << ".jpg";
ss << "resources/image/tmp/debug_char_threshold_" << index << ".jpg";
utils::imwrite(ss.str(), img_threshold);
}
@ -147,7 +147,7 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
if (m_debug) {
stringstream ss(stringstream::in | stringstream::out);
ss << "resources/image/tmp/debug_char_clearLiuDing" << ".jpg";
ss << "resources/image/tmp/debug_char_clearLiuDing_" << index << ".jpg";
utils::imwrite(ss.str(), img_threshold);
}
@ -184,22 +184,22 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
size_t specIndex = 0;
//获得特殊字符对应的Rectt,如苏A的"A"
// 获得特殊字符对应的Rectt,如苏A的"A"
specIndex = GetSpecificRect(sortedRect);
if (m_debug) {
if (specIndex < sortedRect.size()) {
Mat specMat(img_threshold, sortedRect[specIndex]);
stringstream ss(stringstream::in | stringstream::out);
ss << "resources/image/tmp/debug_specMat"
ss << "resources/image/tmp/debug_specMat_" << index
<< ".jpg";
utils::imwrite(ss.str(), specMat);
}
}
//根据特定Rect向左反推出中文字符
//这样做的主要原因是根据findContours方法很难捕捉到中文字符的准确Rect因此仅能
//退过特定算法来指定
// 根据特定Rect向左反推出中文字符
// 这样做的主要原因是根据findContours方法很难捕捉到中文字符的准确Rect因此仅能
// 退过特定算法来指定
Rect chineseRect;
if (specIndex < sortedRect.size())
chineseRect = GetChineseRect(sortedRect[specIndex]);
@ -209,7 +209,7 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
if (m_debug) {
Mat chineseMat(img_threshold, chineseRect);
stringstream ss(stringstream::in | stringstream::out);
ss << "resources/image/tmp/debug_chineseMat"
ss << "resources/image/tmp/debug_chineseMat_" << index
<< ".jpg";
utils::imwrite(ss.str(), chineseMat);
}
@ -223,18 +223,50 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec) {
if (newSortedRect.size() == 0) return 0x05;
// 开始截取每个字符
for (size_t i = 0; i < newSortedRect.size(); i++) {
Rect mr = newSortedRect[i];
Mat auxRoi(img_threshold, mr);
auxRoi = preprocessChar(auxRoi);
if (m_debug) {
//Mat auxRoi(img_threshold, mr);
// 使用灰度图来截取图块,然后依次对每个图块进行大津阈值来二值化
Mat auxRoi(input_grey, mr);
Mat newRoi;
if (BLUE == plateType) {
/* img_threshold = auxRoi.clone();
int w = input_grey.cols;
int h = input_grey.rows;
Mat tmp = input_grey(Rect_<double>(w * 0.1, h * 0.1, w * 0.8, h * 0.8));
int threadHoldV = ThresholdOtsu(tmp);*/
threshold(auxRoi, newRoi, 5, 255, CV_THRESH_BINARY + CV_THRESH_OTSU);
}
else if (YELLOW == plateType) {
threshold(auxRoi, newRoi, 5, 255, CV_THRESH_BINARY_INV + CV_THRESH_OTSU);
}
else if (WHITE == plateType) {
threshold(auxRoi, newRoi, 5, 255, CV_THRESH_OTSU + CV_THRESH_BINARY_INV);
}
else {
threshold(auxRoi, newRoi, 5, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
}
// 归一化大小
newRoi = preprocessChar(newRoi);
// 假设我们要重新训练ANN模型在这里需要把训练样板输出
if (i == 0) {
stringstream ss(stringstream::in | stringstream::out);
ss << "resources/image/tmp/debug_char_auxRoi_" << (i)
ss << "resources/image/tmp/debug_char_auxRoi_" << index << "_" << (i)
<< ".jpg";
utils::imwrite(ss.str(), auxRoi);
utils::imwrite(ss.str(), newRoi);
}
resultVec.push_back(auxRoi);
// 每个字符图块输入到下面的步骤进行处理
resultVec.push_back(newRoi);
}
return 0;

@ -72,7 +72,7 @@ int accuracyTest(const char* test_path) {
cout << "Ô­ÅÆ:" << plateLicense << endl;
vector<string> plateVec;
int result = pr.plateRecognize(src, plateVec);
int result = pr.plateRecognize(src, plateVec, i);
if (result == 0) {
int num = plateVec.size();

Loading…
Cancel
Save