add svm_lbp.xml and test new plate judge model.

v1.6alpha
liuruoze 9 years ago
parent 60bacab2b9
commit 5aa281a925

@ -1652,3 +1652,23 @@ Recall:33.9553% , Precise:62.5128% , Fscore:44.0071% .
Recall:33.9553%, Precise:62.5128%, Fscore:44.0071%.
平均字符差距:3.6, 完全匹配数:2, 完全匹配率:10%
总时间:49秒, 平均执行时间:0.98秒
2016-06-20 08:42:36
总图片数:200, 未识出图片:6, 定位率:97%
Recall:83.2984%, Precise:86.2716%, Fscore:84.7589%.
平均字符差距:0.845361, 完全匹配数:127, 完全匹配率:65.4639%
总时间:200秒, 平均执行时间:1秒
2016-06-20 08:48:27
总图片数:200, 未识出图片:7, 定位率:96.5%
Recall:88.3398%, Precise:91.9465%, Fscore:90.1071%.
平均字符差距:0.689119, 完全匹配数:132, 完全匹配率:68.3938%
总时间:187秒, 平均执行时间:0.935秒
2016-06-20 09:40:17
总图片数:200, 未识出图片:13, 定位率:93.5%
Recall:82.0834%, Precise:87.8835%, Fscore:84.8845%.
平均字符差距:0.983957, 完全匹配数:116, 完全匹配率:62.0321%
总时间:203秒, 平均执行时间:1.015秒
2016-06-20 09:44:25
总图片数:200, 未识出图片:7, 定位率:96.5%
Recall:88.3398%, Precise:91.9465%, Fscore:90.1071%.
平均字符差距:0.689119, 完全匹配数:132, 完全匹配率:68.3938%
总时间:191秒, 平均执行时间:0.955秒

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 KiB

After

Width:  |  Height:  |  Size: 57 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -22,8 +22,7 @@ namespace easypr {
std::vector<CPlate> all_result_Plates;
//如果颜色查找找到n个以上包含n个的车牌就不再进行Sobel查找了。
const int color_find_max = m_maxPlates;
if ( !type || type & PR_DETECT_SOBEL)
{
m_plateLocate->plateSobelLocate(src, sobel_Plates, index);
@ -71,6 +70,37 @@ namespace easypr {
// 使用非极大值抑制来判断车牌
PlateJudge::instance()->plateJudgeUsingNMS(all_result_Plates, resultVec, m_maxPlates);
if (0)
{
Mat result = src.clone();
for (size_t i = 0; i < resultVec.size(); i++)
{
CPlate plate = resultVec[i];
Rect_<float> outputRect;
calcSafeRect(plate.getPlatePos(), src, outputRect);
if (1)
{
cv::rectangle(result, outputRect, Scalar(0, 0, 255));
}
if (0)
{
std::stringstream ss(std::stringstream::in | std::stringstream::out);
ss << "resources/image/tmp/plate_" << i << ".jpg";
imwrite(ss.str(), src(outputRect));
}
}
if (1)
{
imshow("result", result);
waitKey(0);
destroyWindow("result");
}
}
return 0;
}

@ -119,8 +119,8 @@ namespace easypr {
waitKey(0);
}
int response = plateSetScore(plate);
if (response == 0) {
int result = plateSetScore(plate);
if (result == 0) {
plateVec.push_back(plate);
if (0) {
imshow("plateMat", inMat);
@ -139,9 +139,9 @@ namespace easypr {
plate.setPlateMat(tmpDes);
int responseCascade = plateSetScore(plate);
int resultCascade = plateSetScore(plate);
if (responseCascade == 0) {
if (resultCascade == 0) {
plateVec.push_back(plate);
}
}

@ -964,7 +964,7 @@ int CPlateLocate::plateMserLocate(Mat src, vector<CPlate> &candPlates, int index
//flags.push_back(1);
}
vector<RotatedRect> rects_mser_blue;
vector<RotatedRect> rects_mser;
vector<CPlate> plates;
Mat src_b;
@ -975,24 +975,28 @@ int CPlateLocate::plateMserLocate(Mat src, vector<CPlate> &candPlates, int index
//double scale_ratio = 1;
//Mat image = scaleImage(channelImage, Size(scale_size, scale_size), scale_ratio);
Mat image = channelImage;
mserSearch(image, BLUE, src_b, rects_mser_blue, index);
mserSearch(image, BLUE, src_b, rects_mser, index);
}
for (size_t i = 0; i < rects_mser_blue.size(); ++i)
for (size_t i = 0; i < rects_mser.size(); ++i)
{
Rect_<float> outputRect;
calcSafeRect(rects_mser[i], src, outputRect);
if (0)
{
std::stringstream ss(std::stringstream::in | std::stringstream::out);
ss << "resources/image/tmp/plate_" << i << ".jpg";
Rect_<float> outputRect;
calcSafeRect(rects_mser_blue[i], src, outputRect);
imwrite(ss.str(), src(outputRect));
}
}
CPlate plate;
plate.setPlateLocateType(CMSER);
plate.setPlateMat(src(outputRect));
plate.setPlatePos(rects_mser[i]);
candPlates.push_back(plate);
}
//deskew(src, src_b, rects_mser_blue, plates);

@ -90,18 +90,19 @@ namespace easypr {
CPlateRecognize pr;
// 设置Debug模式
pr.setDebug(false);
pr.setLifemode(true);
// 设置要处理的一张图片中最多有多少车牌
pr.setMaxPlates(4);
pr.setDetectType(PR_DETECT_COLOR | PR_DETECT_SOBEL);
//pr.setDetectType(PR_DETECT_CMSER);
//CPlateDetect pd;
//pd.setDetectType(PR_DETECT_CMSER);
//pd.setPDDebug(false);
//pd.setPDLifemode(true);
int size = files.size();
if (0 == size) {
@ -177,6 +178,8 @@ namespace easypr {
vector<CPlate> plateVec;
int result = pr.plateRecognize(src, plateVec);
//pd.plateDetect(src, plateVec);
// get the ground truth and compare it with the detect list;
map<string, vector<CPlate>>::iterator it;
vector<CPlate> plateVecGT;

@ -110,7 +110,9 @@ int test_plate_recognize() {
CPlateRecognize pr;
pr.setLifemode(true);
pr.setDebug(true);
pr.setDetectType(easypr::PR_DETECT_CMSER);
pr.setMaxPlates(4);
pr.setDetectType(PR_DETECT_COLOR | PR_DETECT_SOBEL);
//pr.setDetectType(easypr::PR_DETECT_CMSER);
//vector<string> plateVec;
vector<CPlate> plateVec;

Loading…
Cancel
Save