a little modify

1.3
Fenix 10 years ago
parent e068167c24
commit 177e07ae15

1
.gitignore vendored

@ -14,6 +14,7 @@ Thumbs.db
[Rr]elease/
[Rr]eleases/
experiment/
experi/
bak/
x64/
x86/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

@ -77,7 +77,7 @@ int CPlateJudge::plateJudge(const vector<Mat>& inVec,
for (int j = 0; j < num; j++)
{
Mat inMat = inVec[j];
int response = -1;
plateJudge(inMat, response);

@ -89,6 +89,7 @@ bool CPlateLocate::verifySizes(RotatedRect mr)
Mat CPlateLocate::showResultMat(Mat src, Size rect_size, Point2f center, int index)
{
Mat img_crop;
getRectSubPix(src, rect_size, center, img_crop);
if(m_debug)
@ -278,8 +279,25 @@ int CPlateLocate::plateLocate(Mat src, vector<Mat>& resultVec)
//Create and rotate image
Mat rotmat = getRotationMatrix2D(minRect.center, angle, 1);
Mat img_rotated;
/*if(m_debug)
{
stringstream ss(stringstream::in | stringstream::out);
ss << "image/tmp/needRotate" << i << ".jpg";
imwrite(ss.str(), result);
}*/
warpAffine(src, img_rotated, rotmat, src.size(), CV_INTER_CUBIC);
/*if(m_debug)
{
stringstream ss(stringstream::in | stringstream::out);
ss << "image/tmp/img_rotated" << i << ".jpg";
imwrite(ss.str(), result);
}*/
//Mat resultMat(img_rotated, minRect);
Mat resultMat;
resultMat = showResultMat(img_rotated, rect_size, minRect.center, k++);

@ -71,8 +71,9 @@ int main()
case 4:
// TODO
break;
case 5:
general_test();
case 5:
//general_test();
generate_gdts();
break;
case 6:
// 开发团队;

@ -149,13 +149,14 @@ int acurayTest(const string& test_path)
cout << "未识别图片:" << count_norecogin << "张, ";
float count_recogin = count_all - (count_err + count_norecogin);
float count_rate = count_recogin / count_all * 100;
cout << "识别率:" << count_rate << "% " << endl;
float count_rate = count_recogin / count_all;
float count_norate = 1 - count_rate;
cout << "未识出率:" << count_norate * 100 << "% " << endl;
diff_avg = diff_all / count_recogin;
match_rate = match_count/ count_recogin * 100;
cout << "平均字距:" << diff_avg << "个, ";
cout << "平均字符差距:" << diff_avg << "个, ";
cout << "完全匹配数:" << match_count << "张, ";
cout << "完全匹配率:" << match_rate << "% " << endl;
cout << endl;

@ -316,7 +316,7 @@ int test_plate_recognize()
cout << "test_plate_recognize" << endl;
//Mat src = imread("image/plate_locate.jpg");
Mat src = imread("image/test.jpg");
Mat src = imread("image/experi/¼½FA3215.jpg");
CPlateRecognize pr;
pr.LoadANN("model/ann.xml");

@ -11,13 +11,16 @@ using namespace easypr;
extern const string GENERAL_TEST_PATH;
// TODO 将下面的路径改成你的
const string your_data_path = "F:/data/easypr-data/tmp-3";
const string src_path = "F:/data/easypr-data/tmp-5";
// TODO 将下面的路径改成你的
const string dst_path = "F:/data/easypr-data/tmp-6";
int general_test()
{
////获取该路径下的所有文件
vector<string> files;
getFiles(your_data_path, files);
getFiles(src_path, files);
CPlateLocate lo;
CPlateJudge ju;
@ -69,7 +72,7 @@ int general_test()
if (size == 2)
{
stringstream ss(stringstream::in | stringstream::out);
ss << "F:/data/easypr-data/tmp-4" << "/" << spilt_plate[size-1] << ".jpg";
ss << dst_path << "/" << spilt_plate[size-1] << ".jpg";
imwrite(ss.str(), src);
}
}

@ -118,6 +118,6 @@ Mat imageProcess(Mat img)
Rect rect(width*0.01, height*0.01, width*0.99, height*0.99);
Mat dst = img(rect);
GaussianBlur( dst, dst, Size(1, 1), 0, 0, BORDER_DEFAULT );
//GaussianBlur( dst, dst, Size(1, 1), 0, 0, BORDER_DEFAULT );
return dst;
}
Loading…
Cancel
Save