ann_train change

v1.6alpha
liuruoze 10 years ago
parent 7f6ed737a8
commit 023519af0a

@ -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贡献数据的热心同学。

@ -1249,3 +1249,27 @@
总图片数: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秒

File diff suppressed because it is too large Load Diff

@ -227,46 +227,46 @@ int CCharsSegment::charsSegment(Mat input, vector<Mat>& resultVec, int index) {
for (size_t i = 0; i < newSortedRect.size(); i++) {
Rect mr = newSortedRect[i];
Mat auxRoi(img_threshold, mr);
//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);
//}
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);
}
// 归一化大小
auxRoi = preprocessChar(auxRoi);
newRoi = preprocessChar(newRoi);
// 假设我们要重新训练ANN模型在这里需要把训练样板输出
if (i == 0) {
stringstream ss(stringstream::in | stringstream::out);
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;

@ -5,9 +5,6 @@
#include "chars.hpp"
#include "plate.hpp"
extern int annMain();
namespace easypr {
namespace demo {
@ -424,7 +421,7 @@ int main(int argc, const char* argv[]) {
std::cout << "Run \"easypr_test svm\" for more usage." << std::endl;
break;
case 4:
annMain();
// TODO
break;
case 5:
easypr::preprocess::generate_gdts();

Loading…
Cancel
Save