From 901db309de7e0331e400a61b5ed21fdc4b97107e Mon Sep 17 00:00:00 2001 From: Micooz Date: Wed, 10 Jun 2015 10:02:36 +0800 Subject: [PATCH 01/21] Fix warnings thrown by QtCreator. --- src/core/core_func.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/core_func.cpp b/src/core/core_func.cpp index 3bcb21c..38f5516 100644 --- a/src/core/core_func.cpp +++ b/src/core/core_func.cpp @@ -63,6 +63,9 @@ Mat colorMatch(const Mat& src, Mat& match, const Color r, min_h = min_white; max_h = max_white; break; + default: + // Color::UNKNOWN + break; } float diff_h = float((max_h - min_h) / 2); @@ -343,7 +346,7 @@ void clearLiuDingOnly(Mat& img) { for (int j = 0; j < img.cols - 1; j++) { if (img.at(i, j) != img.at(i, j + 1)) jumpCount++; - if (img.at(i, j) == 255) { + if (img.at(i, j) == 255) { whiteCount++; } } From 2f2f63411f72b9756702e6f17ef1fec2697ea739 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 16:40:05 +0800 Subject: [PATCH 02/21] Remove redefined macro NDEBUG. --- src/core/chars_identify.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/chars_identify.cpp b/src/core/chars_identify.cpp index 12b8922..7b6a95f 100644 --- a/src/core/chars_identify.cpp +++ b/src/core/chars_identify.cpp @@ -6,8 +6,6 @@ */ namespace easypr { -#define NDEBUG - //中国车牌 const char strCharacters[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', From edba417b3e41ca852fc35a4ed98adc17a935fbbd Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 16:42:08 +0800 Subject: [PATCH 03/21] Fixed "int" type mismatch "size_t" warnings. --- src/core/plate_detect.cpp | 6 +++--- src/core/plate_locate.cpp | 22 +++++++++++----------- src/preprocess/gdts.cpp | 2 +- src/train/ann_train.cpp | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core/plate_detect.cpp b/src/core/plate_detect.cpp index e87b947..4e7d82b 100644 --- a/src/core/plate_detect.cpp +++ b/src/core/plate_detect.cpp @@ -66,7 +66,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector& resultVec, // color_result_Plates.push_back(color_Plates[i]); //} - for (int i = 0; i < color_result_Plates.size(); i++) { + for (size_t i = 0; i < color_result_Plates.size(); i++) { CPlate plate = color_result_Plates[i]; plate.setPlateLocateType(COLOR); @@ -83,7 +83,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector& resultVec, sobel_result_Plates.push_back(sobel_Plates[i]); }*/ - for (int i = 0; i < sobel_result_Plates.size(); i++) { + for (size_t i = 0; i < sobel_result_Plates.size(); i++) { CPlate plate = sobel_result_Plates[i]; if (0) { @@ -99,7 +99,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector& resultVec, } } - for (int i = 0; i < all_result_Plates.size(); i++) { + for (size_t i = 0; i < all_result_Plates.size(); i++) { // 把截取的车牌图像依次放到左上角 CPlate plate = all_result_Plates[i]; resultVec.push_back(plate); diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index f7ddd6a..c4c0e80 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -278,7 +278,7 @@ int CPlateLocate::sobelFrtSearch(const Mat& src, ++itc; } - for (int i = 0; i < first_rects.size(); i++) { + for (size_t i = 0; i < first_rects.size(); i++) { RotatedRect roi_rect = first_rects[i]; Rect_ safeBoundRect; @@ -353,7 +353,7 @@ int CPlateLocate::sobelSecSearchPart(Mat& bound, Point2f refpoint, ++itc; } - for (int i = 0; i < second_rects.size(); i++) { + for (size_t i = 0; i < second_rects.size(); i++) { RotatedRect roi = second_rects[i]; if (verifySizes(roi)) { Point2f refcenter = roi.center + refpoint; @@ -425,7 +425,7 @@ int CPlateLocate::sobelSecSearch(Mat& bound, Point2f refpoint, ++itc; } - for (int i = 0; i < second_rects.size(); i++) { + for (size_t i = 0; i < second_rects.size(); i++) { RotatedRect roi = second_rects[i]; if (verifySizes(roi)) { Point2f refcenter = roi.center + refpoint; @@ -557,7 +557,7 @@ int CPlateLocate::deskew(const Mat& src, const Mat& src_b, Mat mat_debug; src.copyTo(mat_debug); - for (int i = 0; i < inRects.size(); i++) { + for (size_t i = 0; i < inRects.size(); i++) { RotatedRect roi_rect = inRects[i]; float r = (float)roi_rect.size.width / (float)roi_rect.size.height; @@ -869,7 +869,7 @@ int CPlateLocate::deskewOld(Mat src, vector& inRects, vector& outRects, vector& outMats, LocateType locateType) { int k = 1; - for (int i = 0; i < inRects.size(); i++) { + for (size_t i = 0; i < inRects.size(); i++) { RotatedRect minRect = inRects[i]; if (verifySizes(minRect)) { @@ -1048,7 +1048,7 @@ int CPlateLocate::plateColorLocate(Mat src, vector& candPlates, colorSearch(src, YELLOW, src_b, rects_color_yellow, index); deskew(src, src_b, rects_color_yellow, plates); - for (int i = 0; i < plates.size(); i++) { + for (size_t i = 0; i < plates.size(); i++) { candPlates.push_back(plates[i]); } return 0; @@ -1119,7 +1119,7 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, vector> bound_rects_part; //对不符合要求的区域进行扩展 - for (int i = 0; i < bound_rects.size(); i++) { + for (size_t i = 0; i < bound_rects.size(); i++) { double fRatio = bound_rects[i].width * 1.0 / bound_rects[i].height; if (fRatio < 3.0 && fRatio > 1.0 && bound_rects[i].height < 120) { Rect_ itemRect = bound_rects[i]; @@ -1140,7 +1140,7 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, } } //对断裂的部分进行二次处理 - for (int i = 0; i < bound_rects_part.size(); i++) { + for (size_t i = 0; i < bound_rects_part.size(); i++) { Rect_ bound_rect = bound_rects_part[i]; Point2f refpoint(bound_rect.x, bound_rect.y); @@ -1159,7 +1159,7 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, sobelSecSearchPart(bound_mat, refpoint, rects_sobel); } - for (int i = 0; i < bound_rects.size(); i++) { + for (size_t i = 0; i < bound_rects.size(); i++) { Rect_ bound_rect = bound_rects[i]; Point2f refpoint(bound_rect.x, bound_rect.y); @@ -1185,7 +1185,7 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, // 进行抗扭斜处理 deskew(src, src_b, rects_sobel, plates); - for (int i = 0; i < plates.size(); i++) candPlates.push_back(plates[i]); + for (size_t i = 0; i < plates.size(); i++) candPlates.push_back(plates[i]); return 0; } @@ -1477,7 +1477,7 @@ int CPlateLocate::plateLocate(Mat src, vector& resultVec, int index) { } } int k = 1; - for (int i = 0; i < rects.size(); i++) { + for (size_t i = 0; i < rects.size(); i++) { RotatedRect minRect = rects[i]; if (verifySizes(minRect)) { // rotated rectangle drawing diff --git a/src/preprocess/gdts.cpp b/src/preprocess/gdts.cpp index 1516569..5b405d6 100644 --- a/src/preprocess/gdts.cpp +++ b/src/preprocess/gdts.cpp @@ -30,7 +30,7 @@ int generate_gdts() { std::cout << "Begin to prepare generate_gdts!" << std::endl; - for (int i = 0; i < size; i++) { + for (size_t i = 0; i < size; i++) { std::string filepath = files[i].c_str(); std::cout << "------------------" << std::endl; std::cout << filepath << std::endl; diff --git a/src/train/ann_train.cpp b/src/train/ann_train.cpp index a722072..75cc0b7 100644 --- a/src/train/ann_train.cpp +++ b/src/train/ann_train.cpp @@ -117,7 +117,7 @@ int saveTrainData() { auto files = Utils::getFiles(ss.str()); size_t size = files.size(); - for (int j = 0; j < size; j++) { + for (size_t j = 0; j < size; j++) { cout << files[j].c_str() << endl; Mat img = imread(files[j].c_str(), 0); Mat f5 = features(img, 5); From 66c7ebf987b15728047029da6f5ab301fa9f946d Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 16:55:56 +0800 Subject: [PATCH 04/21] Fixed all warnings in char_segment.cpp. --- src/core/chars_segment.cpp | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/core/chars_segment.cpp b/src/core/chars_segment.cpp index a057af2..5ad7edd 100644 --- a/src/core/chars_segment.cpp +++ b/src/core/chars_segment.cpp @@ -8,8 +8,8 @@ Namespace where all the C++ EasyPR functionality resides */ namespace easypr { -const float DEFAULT_BLUEPERCEMT = 0.3; -const float DEFAULT_WHITEPERCEMT = 0.1; +const float DEFAULT_BLUEPERCEMT = 0.3f; +const float DEFAULT_WHITEPERCEMT = 0.1f; CCharsSegment::CCharsSegment() { // cout << "CCharsSegment" << endl; @@ -29,18 +29,18 @@ bool CCharsSegment::verifyCharSizes(Mat r) { // Char sizes 45x90 float aspect = 45.0f / 90.0f; float charAspect = (float)r.cols / (float)r.rows; - float error = 0.7; - float minHeight = 10; - float maxHeight = 35; + float error = 0.7f; + float minHeight = 10.f; + float maxHeight = 35.f; // We have a different aspect ratio for number 1, and it can be ~0.2 - float minAspect = 0.05; + float minAspect = 0.05f; float maxAspect = aspect + aspect * error; // area of pixels - float area = countNonZero(r); + int area = cv::countNonZero(r); // bb area - float bbArea = r.cols * r.rows; + int bbArea = r.cols * r.rows; //% of pixel in area - float percPixels = area / bbArea; + int percPixels = area / bbArea; if (percPixels <= 1 && charAspect > minAspect && charAspect < maxAspect && r.rows >= minHeight && r.rows < maxHeight) @@ -57,8 +57,8 @@ Mat CCharsSegment::preprocessChar(Mat in) { int charSize = CHAR_SIZE; //统一每个字符的大小 Mat transformMat = Mat::eye(2, 3, CV_32F); int m = max(w, h); - transformMat.at(0, 2) = m / 2 - w / 2; - transformMat.at(1, 2) = m / 2 - h / 2; + transformMat.at(0, 2) = float(m / 2 - w / 2); + transformMat.at(1, 2) = float(m / 2 - h / 2); Mat warpImage(m, m, in.type()); warpAffine(in, warpImage, transformMat, warpImage.size(), INTER_LINEAR, @@ -86,7 +86,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { int w = input.cols; int h = input.rows; - Mat tmpMat = input(Rect(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmpMat = input(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); //判断车牌颜色以此确认threshold方法 Color plateType = getPlateType(tmpMat, true); @@ -101,7 +101,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { int w = input_grey.cols; int h = input_grey.rows; - Mat tmp = input_grey(Rect(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); // utils::imwrite("E:/img_inputgray2.jpg", input_grey); @@ -116,7 +116,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { img_threshold = input_grey.clone(); int w = input_grey.cols; int h = input_grey.rows; - Mat tmp = input_grey(Rect(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); utils::imwrite("resources/image/tmp/inputgray2.jpg", input_grey); @@ -200,7 +200,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { std::sort(sortedRect.begin(), sortedRect.end(), [](const Rect& r1, const Rect& r2) { return r1.x < r2.x; }); - int specIndex = 0; + size_t specIndex = 0; //获得特殊字符对应的Rectt,如苏A的"A" specIndex = GetSpecificRect(sortedRect); @@ -241,7 +241,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { if (newSortedRect.size() == 0) return -3; - for (int i = 0; i < newSortedRect.size(); i++) { + for (size_t i = 0; i < newSortedRect.size(); i++) { Rect mr = newSortedRect[i]; Mat auxRoi(img_threshold, mr); @@ -266,17 +266,17 @@ int CCharsSegment::SortRect(const vector& vecRect, vector& out) { vector orderIndex; vector xpositions; - for (int i = 0; i < vecRect.size(); i++) { + for (size_t i = 0; i < vecRect.size(); i++) { orderIndex.push_back(i); xpositions.push_back(vecRect[i].x); } - - float min = xpositions[0]; + + int min = xpositions[0]; int minIdx = 0; - for (int i = 0; i < xpositions.size(); i++) { + for (size_t i = 0; i < xpositions.size(); i++) { min = xpositions[i]; minIdx = i; - for (int j = i; j < xpositions.size(); j++) { + for (size_t j = i; j < xpositions.size(); j++) { if (xpositions[j] < min) { min = xpositions[j]; minIdx = j; @@ -287,13 +287,13 @@ int CCharsSegment::SortRect(const vector& vecRect, vector& out) { orderIndex[i] = aux_min; orderIndex[minIdx] = aux_i; - float aux_xi = xpositions[i]; - float aux_xmin = xpositions[minIdx]; + int aux_xi = xpositions[i]; + int aux_xmin = xpositions[minIdx]; xpositions[i] = aux_xmin; xpositions[minIdx] = aux_xi; } - for (int i = 0; i < orderIndex.size(); i++) { + for (size_t i = 0; i < orderIndex.size(); i++) { out.push_back(vecRect[orderIndex[i]]); } @@ -303,7 +303,7 @@ int CCharsSegment::SortRect(const vector& vecRect, vector& out) { //! 根据特殊车牌来构造猜测中文字符的位置和大小 Rect CCharsSegment::GetChineseRect(const Rect rectSpe) { int height = rectSpe.height; - float newwidth = rectSpe.width * 1.15; + float newwidth = rectSpe.width * 1.15f; int x = rectSpe.x; int y = rectSpe.y; @@ -321,7 +321,7 @@ int CCharsSegment::GetSpecificRect(const vector& vecRect) { int maxHeight = 0; int maxWidth = 0; - for (int i = 0; i < vecRect.size(); i++) { + for (size_t i = 0; i < vecRect.size(); i++) { xpositions.push_back(vecRect[i].x); if (vecRect[i].height > maxHeight) { @@ -333,7 +333,7 @@ int CCharsSegment::GetSpecificRect(const vector& vecRect) { } int specIndex = 0; - for (int i = 0; i < vecRect.size(); i++) { + for (size_t i = 0; i < vecRect.size(); i++) { Rect mr = vecRect[i]; int midx = mr.x + mr.width / 2; From dab4fbd44f6ec24dd545d1c9a8da4d2c3313eb3d Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 17:04:09 +0800 Subject: [PATCH 05/21] Fixed all warnings in core_func.cpp. --- src/core/core_func.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/core_func.cpp b/src/core/core_func.cpp index 38f5516..e9b09eb 100644 --- a/src/core/core_func.cpp +++ b/src/core/core_func.cpp @@ -69,7 +69,7 @@ Mat colorMatch(const Mat& src, Mat& match, const Color r, } float diff_h = float((max_h - min_h) / 2); - int avg_h = min_h + diff_h; + float avg_h = min_h + diff_h; int channels = src_hsv.channels(); int nRows = src_hsv.rows; @@ -101,7 +101,7 @@ Mat colorMatch(const Mat& src, Mat& match, const Color r, bool colorMatched = false; if (H > min_h && H < max_h) { - int Hdiff = 0; + float Hdiff = 0; if (H > avg_h) Hdiff = H - avg_h; else @@ -153,7 +153,7 @@ Mat colorMatch(const Mat& src, Mat& match, const Color r, bool bFindLeftRightBound1(Mat& bound_threshold, int& posLeft, int& posRight) { //从两边寻找边界 - int span = bound_threshold.rows * 0.2; + float span = bound_threshold.rows * 0.2f; //左边界检测 for (int i = 0; i < bound_threshold.cols - span - 1; i += 3) { int whiteCount = 0; @@ -169,7 +169,7 @@ bool bFindLeftRightBound1(Mat& bound_threshold, int& posLeft, int& posRight) { break; } } - span = bound_threshold.rows * 0.2; + span = bound_threshold.rows * 0.2f; //右边界检测 for (int i = bound_threshold.cols - 1; i > span; i -= 2) { int whiteCount = 0; @@ -201,7 +201,7 @@ bool bFindLeftRightBound1(Mat& bound_threshold, int& posLeft, int& posRight) { bool bFindLeftRightBound(Mat& bound_threshold, int& posLeft, int& posRight) { //从两边寻找边界 - int span = bound_threshold.rows * 0.2; + float span = bound_threshold.rows * 0.2f; //左边界检测 for (int i = 0; i < bound_threshold.cols - span - 1; i += 2) { int whiteCount = 0; @@ -217,7 +217,7 @@ bool bFindLeftRightBound(Mat& bound_threshold, int& posLeft, int& posRight) { break; } } - span = bound_threshold.rows * 0.2; + span = bound_threshold.rows * 0.2f; //右边界检测 for (int i = bound_threshold.cols - 1; i > span; i -= 2) { int whiteCount = 0; @@ -243,7 +243,7 @@ bool bFindLeftRightBound(Mat& bound_threshold, int& posLeft, int& posRight) { bool bFindLeftRightBound2(Mat& bound_threshold, int& posLeft, int& posRight) { //从两边寻找边界 - int span = bound_threshold.rows * 0.2; + float span = bound_threshold.rows * 0.2f; //左边界检测 for (int i = 0; i < bound_threshold.cols - span - 1; i += 3) { int whiteCount = 0; @@ -259,7 +259,7 @@ bool bFindLeftRightBound2(Mat& bound_threshold, int& posLeft, int& posRight) { break; } } - span = bound_threshold.rows * 0.2; + span = bound_threshold.rows * 0.2f; //右边界检测 for (int i = bound_threshold.cols - 1; i > span; i -= 3) { int whiteCount = 0; @@ -289,8 +289,8 @@ bool bFindLeftRightBound2(Mat& bound_threshold, int& posLeft, int& posRight) { bool plateColorJudge(const Mat& src, const Color r, const bool adaptive_minsv, float& percent) { // 判断阈值 - const float thresh = 0.45; - + const float thresh = 0.45f; + Mat src_gray; colorMatch(src, src_gray, r, adaptive_minsv); @@ -351,7 +351,7 @@ void clearLiuDingOnly(Mat& img) { } } - jump.at(i) = jumpCount; + jump.at(i) = (float)jumpCount; } for (int i = 0; i < img.rows; i++) { @@ -382,7 +382,7 @@ bool clearLiuDing(Mat& img) { } } - jump.at(i) = jumpCount; + jump.at(i) = (float)jumpCount; } int iCount = 0; From cac83f09863b8eb745b59d920e4faa64ea92d959 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 17:20:40 +0800 Subject: [PATCH 06/21] Fixed all warnings in plate_judge.cpp. --- src/core/plate_judge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/plate_judge.cpp b/src/core/plate_judge.cpp index 1b7c935..a190882 100644 --- a/src/core/plate_judge.cpp +++ b/src/core/plate_judge.cpp @@ -88,7 +88,7 @@ int CPlateJudge::plateJudge(const vector& inVec, int w = inMat.cols; int h = inMat.rows; //再取中间部分判断一次 - Mat tmpmat = inMat(Rect(w * 0.05, h * 0.1, w * 0.9, h * 0.8)); + Mat tmpmat = inMat(Rect_(w * 0.05, h * 0.1, w * 0.9, h * 0.8)); Mat tmpDes = inMat.clone(); resize(tmpmat, tmpDes, Size(inMat.size())); From 09f51c5f7c53bdb67118a4bda84e241d16c4fdef Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 17:42:30 +0800 Subject: [PATCH 07/21] Fixed: debug status should be bool type, for performance. --- include/easypr/plate_detect.h | 4 ++-- include/easypr/plate_locate.h | 6 +++--- include/easypr/plate_recognize.h | 2 +- src/core/plate_judge.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/easypr/plate_detect.h b/include/easypr/plate_detect.h index 4524230..369bb7d 100644 --- a/include/easypr/plate_detect.h +++ b/include/easypr/plate_detect.h @@ -42,10 +42,10 @@ class CPlateDetect { inline void setPDLifemode(bool param) { m_plateLocate->setLifemode(param); } //! 是否开启调试模式 - inline void setPDDebug(int param) { m_plateLocate->setDebug(param); } + inline void setPDDebug(bool param) { m_plateLocate->setDebug(param); } //! 获取调试模式状态 - inline int getPDDebug() { return m_plateLocate->getDebug(); } + inline bool getPDDebug() { return m_plateLocate->getDebug(); } //! 设置与读取变量 inline void setGaussianBlurSize(int param) { diff --git a/include/easypr/plate_locate.h b/include/easypr/plate_locate.h index 6716526..4f3dfef 100644 --- a/include/easypr/plate_locate.h +++ b/include/easypr/plate_locate.h @@ -114,10 +114,10 @@ class CPlateLocate { inline void setJudgeAngle(int param) { m_angle = param; } //! 是否开启调试模式 - inline void setDebug(int param) { m_debug = param; } + inline void setDebug(bool param) { m_debug = param; } //! 获取调试模式状态 - inline int getDebug() { return m_debug; } + inline bool getDebug() { return m_debug; } //! PlateLocate所用常量 static const int DEFAULT_GAUSSIANBLUR_SIZE = 5; @@ -162,7 +162,7 @@ class CPlateLocate { int m_angle; //! 是否开启调试模式,0关闭,非0开启 - int m_debug; + bool m_debug; }; } /*! \namespace easypr*/ diff --git a/include/easypr/plate_recognize.h b/include/easypr/plate_recognize.h index 5b75515..5059621 100644 --- a/include/easypr/plate_recognize.h +++ b/include/easypr/plate_recognize.h @@ -32,7 +32,7 @@ class CPlateRecognize : public CPlateDetect, public CCharsRecognise { inline void setLifemode(bool param) { CPlateDetect::setPDLifemode(param); } //! 是否开启调试模式 - inline void setDebug(int param) { + inline void setDebug(bool param) { CPlateDetect::setPDDebug(param); CCharsRecognise::setCRDebug(param); } diff --git a/src/core/plate_judge.cpp b/src/core/plate_judge.cpp index a190882..f415f07 100644 --- a/src/core/plate_judge.cpp +++ b/src/core/plate_judge.cpp @@ -52,7 +52,7 @@ int CPlateJudge::plateJudge(const Mat& inMat, int& result) { p.convertTo(p, CV_32FC1); float response = svm.predict(p); - result = response; + result = (int)response; return 0; } From 8655ccd543d3a28e6c169c3270ba14b726575488 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 18:16:47 +0800 Subject: [PATCH 08/21] Fixed type mismatch problem. --- src/core/plate_locate.cpp | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index c4c0e80..906b491 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -7,9 +7,9 @@ using namespace std; Namespace where all the C++ EasyPR functionality resides */ namespace easypr { - -const float DEFAULT_ERROR = 0.9; // 0.6 -const float DEFAULT_ASPECT = 3.75; // 3.75 + +const float DEFAULT_ERROR = 0.9f; // 0.6 +const float DEFAULT_ASPECT = 3.75f; // 3.75 CPlateLocate::CPlateLocate() { // cout << "CPlateLocate" << endl; @@ -69,7 +69,7 @@ bool CPlateLocate::verifySizes(RotatedRect mr) { float rmin = aspect - aspect * error; float rmax = aspect + aspect * error; - int area = mr.size.height * mr.size.width; + float 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; @@ -197,9 +197,9 @@ bool CPlateLocate::sobelJudge(Mat roi) { MORPH_RECT, Size(m_MorphSizeWidth, m_MorphSizeHeight)); morphologyEx(roi_threshold, roi_threshold, MORPH_CLOSE, element); - float channels = roi_threshold.channels(); - float nRows = roi_threshold.rows; - float nCols = roi_threshold.cols; + int channels = roi_threshold.channels(); + int nRows = roi_threshold.rows; + int nCols = roi_threshold.cols; float percent = float(countNonZero(roi_threshold)) / float(nRows * nCols); // cout << "precent:" << percent << endl; @@ -215,18 +215,18 @@ bool CPlateLocate::verifyCharSizes(Mat r) { // Char sizes 45x90 float aspect = 45.0f / 90.0f; float charAspect = (float)r.cols / (float)r.rows; - float error = 0.7; - float minHeight = 10; - float maxHeight = 35; + float error = 0.7f; + float minHeight = 10.f; + float maxHeight = 35.f; // We have a different aspect ratio for number 1, and it can be ~0.2 - float minAspect = 0.05; + float minAspect = 0.05f; float maxAspect = aspect + aspect * error; // area of pixels - float area = countNonZero(r); + int area = cv::countNonZero(r); // bb area - float bbArea = r.cols * r.rows; + int bbArea = r.cols * r.rows; //% of pixel in area - float percPixels = area / bbArea; + int percPixels = area / bbArea; if (percPixels <= 1 && charAspect > minAspect && charAspect < maxAspect && r.rows >= minHeight && r.rows < maxHeight) @@ -267,7 +267,7 @@ int CPlateLocate::sobelFrtSearch(const Mat& src, if (verifySizes(mr)) { first_rects.push_back(mr); - int area = mr.size.height * mr.size.width; + float 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; @@ -321,7 +321,7 @@ int CPlateLocate::sobelSecSearchPart(Mat& bound, Point2f refpoint, if (bFindLeftRightBound(tempBoundThread, posLeft, posRight)) { //找到两个边界后进行连接修补处理 if (posRight != 0 && posLeft != 0 && posLeft < posRight) { - int posY = bound_threshold.rows * 0.5; + int posY = int(bound_threshold.rows * 0.5); for (int i = posLeft + bound_threshold.rows * 0.1; i < posRight - 4; i++) { bound_threshold.data[posY * bound_threshold.cols + i] = 255; @@ -358,7 +358,7 @@ int CPlateLocate::sobelSecSearchPart(Mat& bound, Point2f refpoint, if (verifySizes(roi)) { Point2f refcenter = roi.center + refpoint; Size2f size = roi.size; - double angle = roi.angle; + float angle = roi.angle; RotatedRect refroi(refcenter, size, angle); outRects.push_back(refroi); @@ -430,7 +430,7 @@ int CPlateLocate::sobelSecSearch(Mat& bound, Point2f refpoint, if (verifySizes(roi)) { Point2f refcenter = roi.center + refpoint; Size2f size = roi.size; - double angle = roi.angle; + float angle = roi.angle; RotatedRect refroi(refcenter, size, angle); outRects.push_back(refroi); @@ -498,13 +498,13 @@ void DeleteNotArea(Mat& inmat) { int w = inmat.cols; int h = inmat.rows; - Mat tmpMat = inmat(Rect(w * 0.15, h * 0.1, w * 0.7, h * 0.7)); + Mat tmpMat = inmat(Rect_(w * 0.15, h * 0.1, w * 0.7, h * 0.7)); //判断车牌颜色以此确认threshold方法 Color plateType = getPlateType(tmpMat, true); Mat img_threshold; if (BLUE == plateType) { img_threshold = input_grey.clone(); - Mat tmp = input_grey(Rect(w * 0.15, h * 0.15, w * 0.7, h * 0.7)); + Mat tmp = input_grey(Rect_(w * 0.15, h * 0.15, w * 0.7, h * 0.7)); int threadHoldV = ThresholdOtsu(tmp); threshold(input_grey, img_threshold, threadHoldV, 255, CV_THRESH_BINARY); @@ -515,7 +515,7 @@ void DeleteNotArea(Mat& inmat) { } else if (YELLOW == plateType) { img_threshold = input_grey.clone(); - Mat tmp = input_grey(Rect(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); threshold(input_grey, img_threshold, threadHoldV, 255, @@ -1252,8 +1252,8 @@ int CPlateLocate::plateLocate(Mat src, vector& resultVec, int index) { for (int i = 0; i < tmp.rows; i++) { for (int j = 0; j < tmp.cols; j++) { int nH = hsvSplit[0].at(i, j) * 2; - float fS = hsvSplit[1].at(i, j) / 255.0; - float fV = hsvSplit[2].at(i, j) / 255.0; + float fS = hsvSplit[1].at(i, j) / 255.0f; + float fV = hsvSplit[2].at(i, j) / 255.0f; if (nH >= 200 && nH <= 255 && fS >= 0.4 && fS <= 1 && fV >= 0.3 && fV <= 1) // 蓝色 dst_blue.at(i, j) = 255; @@ -1300,8 +1300,8 @@ int CPlateLocate::plateLocate(Mat src, vector& resultVec, int index) { for (int i = 0; i < tmp.rows; i++) { for (int j = 0; j < tmp.cols; j++) { int nH = hsvSplit[0].at(i, j) * 2; - float fS = hsvSplit[1].at(i, j) / 255.0; - float fV = hsvSplit[2].at(i, j) / 255.0; + float fS = hsvSplit[1].at(i, j) / 255.0f; + float fV = hsvSplit[2].at(i, j) / 255.0f; if (nH >= 25 && nH <= 55 && fS >= 0.4 && fS <= 1 && fV >= 0.3 && fV <= 1) // 黄色 dst_yellow.at(i, j) = 255; From 40143ced74a45ceeb8dc821a93661d1538794c4d Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 18:23:18 +0800 Subject: [PATCH 09/21] Fixed type mismatch problem. --- src/core/plate_locate.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index 906b491..087ed1d 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -965,7 +965,7 @@ int CPlateLocate::deskewOld(Mat src, vector& inRects, double xdiff = double(middle_crop.rows) * g; plTri[0] = Point2f(0, 0); plTri[1] = Point2f(middle_crop.cols - 1, 0); - plTri[2] = Point2f(0 + xdiff, middle_crop.rows - 1); + plTri[2] = Point2f(0 + (float)xdiff, middle_crop.rows - 1); } dstTri[0] = Point2f(0, 0); @@ -1120,7 +1120,7 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, //对不符合要求的区域进行扩展 for (size_t i = 0; i < bound_rects.size(); i++) { - double fRatio = bound_rects[i].width * 1.0 / bound_rects[i].height; + float fRatio = bound_rects[i].width * 1.0f / bound_rects[i].height; if (fRatio < 3.0 && fRatio > 1.0 && bound_rects[i].height < 120) { Rect_ itemRect = bound_rects[i]; //宽度过小,进行扩展 @@ -1133,8 +1133,8 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, itemRect.width = src.cols - itemRect.x; } - itemRect.y = itemRect.y - itemRect.height * 0.08; - itemRect.height = itemRect.height * 1.16; + itemRect.y = itemRect.y - itemRect.height * 0.08f; + itemRect.height = itemRect.height * 1.16f; bound_rects_part.push_back(itemRect); } @@ -1144,15 +1144,15 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, Rect_ bound_rect = bound_rects_part[i]; Point2f refpoint(bound_rect.x, bound_rect.y); - int x = bound_rect.x > 0 ? bound_rect.x : 0; - int y = bound_rect.y > 0 ? bound_rect.y : 0; + float x = bound_rect.x > 0 ? bound_rect.x : 0; + float y = bound_rect.y > 0 ? bound_rect.y : 0; - int width = + float width = x + bound_rect.width < src.cols ? bound_rect.width : src.cols - x; - int height = + float height = y + bound_rect.height < src.rows ? bound_rect.height : src.rows - y; - Rect safe_bound_rect(x, y, width, height); + Rect_ safe_bound_rect(x, y, width, height); Mat bound_mat = src(safe_bound_rect); // Sobel第二次精细搜索(部分) @@ -1163,15 +1163,15 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, Rect_ bound_rect = bound_rects[i]; Point2f refpoint(bound_rect.x, bound_rect.y); - int x = bound_rect.x > 0 ? bound_rect.x : 0; - int y = bound_rect.y > 0 ? bound_rect.y : 0; + float x = bound_rect.x > 0 ? bound_rect.x : 0; + float y = bound_rect.y > 0 ? bound_rect.y : 0; - int width = + float width = x + bound_rect.width < src.cols ? bound_rect.width : src.cols - x; - int height = + float height = y + bound_rect.height < src.rows ? bound_rect.height : src.rows - y; - Rect safe_bound_rect(x, y, width, height); + Rect_ safe_bound_rect(x, y, width, height); Mat bound_mat = src(safe_bound_rect); // Sobel第二次精细搜索 From 9529c488cd23aed9416951ca41ba81f88e000223 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 19:10:42 +0800 Subject: [PATCH 10/21] Fixed type mismatch problem. --- src/core/plate_locate.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index 087ed1d..318db4b 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -322,7 +322,7 @@ int CPlateLocate::sobelSecSearchPart(Mat& bound, Point2f refpoint, //找到两个边界后进行连接修补处理 if (posRight != 0 && posLeft != 0 && posLeft < posRight) { int posY = int(bound_threshold.rows * 0.5); - for (int i = posLeft + bound_threshold.rows * 0.1; i < posRight - 4; + for (int i = posLeft + (int)(bound_threshold.rows * 0.1); i < posRight - 4; i++) { bound_threshold.data[posY * bound_threshold.cols + i] = 255; } @@ -671,18 +671,18 @@ bool CPlateLocate::rotation(Mat& in, Mat& out, const Size rect_size, Mat in_large; in_large.create(in.rows * 1.5, in.cols * 1.5, in.type()); - int x = in_large.cols / 2 - center.x > 0 ? in_large.cols / 2 - center.x : 0; - int y = in_large.rows / 2 - center.y > 0 ? in_large.rows / 2 - center.y : 0; + float x = in_large.cols / 2 - center.x > 0 ? in_large.cols / 2 - center.x : 0; + float y = in_large.rows / 2 - center.y > 0 ? in_large.rows / 2 - center.y : 0; - int width = x + in.cols < in_large.cols ? in.cols : in_large.cols - x; - int height = y + in.rows < in_large.rows ? in.rows : in_large.rows - y; + float width = x + in.cols < in_large.cols ? in.cols : in_large.cols - x; + float height = y + in.rows < in_large.rows ? in.rows : in_large.rows - y; /*assert(width == in.cols); assert(height == in.rows);*/ if (width != in.cols || height != in.rows) return false; - Mat imageRoi = in_large(Rect(x, y, width, height)); + Mat imageRoi = in_large(Rect_(x, y, width, height)); addWeighted(imageRoi, 0, in, 1, 0, imageRoi); Point2f center_diff(in.cols / 2, in.rows / 2); @@ -967,7 +967,7 @@ int CPlateLocate::deskewOld(Mat src, vector& inRects, plTri[1] = Point2f(middle_crop.cols - 1, 0); plTri[2] = Point2f(0 + (float)xdiff, middle_crop.rows - 1); } - + dstTri[0] = Point2f(0, 0); dstTri[1] = Point2f(WIDTH - 1, 0); dstTri[2] = Point2f(0, HEIGHT - 1); From b2b4132a5364c69eaab9ebc611e61b643eb7c465 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 19:24:16 +0800 Subject: [PATCH 11/21] Fixed type mismatch problem. --- src/core/plate_locate.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index 318db4b..cf7981a 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -685,8 +685,8 @@ bool CPlateLocate::rotation(Mat& in, Mat& out, const Size rect_size, Mat imageRoi = in_large(Rect_(x, y, width, height)); addWeighted(imageRoi, 0, in, 1, 0, imageRoi); - Point2f center_diff(in.cols / 2, in.rows / 2); - Point2f new_center(in_large.cols / 2, in_large.rows / 2); + Point2f center_diff(in.cols / 2.f, in.rows / 2.f); + Point2f new_center(in_large.cols / 2.f, in_large.rows / 2.f); Mat rot_mat = getRotationMatrix2D(new_center, angle, 1); @@ -792,9 +792,9 @@ void CPlateLocate::affine(const Mat& in, Mat& out, const double slope) { Point2f dstTri[3]; Point2f plTri[3]; - int height = in.rows; //行 - int width = in.cols; //列 - double xiff = abs(slope) * height; + float height = (float)in.rows; //行 + float width = (float)in.cols; //列 + float xiff = (float)abs(slope) * height; if (slope > 0) { //右偏型,新起点坐标系在xiff/2位置 @@ -816,14 +816,10 @@ void CPlateLocate::affine(const Mat& in, Mat& out, const double slope) { dstTri[2] = Point2f(xiff / 2, height - 1); } - /*dstTri[0] = Point2f(0, 0); - dstTri[1] = Point2f(WIDTH - 1, 0); - dstTri[2] = Point2f(0, HEIGHT - 1);*/ - Mat warp_mat = getAffineTransform(plTri, dstTri); Mat affine_mat; - affine_mat.create(height, width, TYPE); + affine_mat.create((int)height, (int)width, TYPE); if (in.rows > HEIGHT || in.cols > WIDTH) warpAffine(in, affine_mat, warp_mat, affine_mat.size(), @@ -954,18 +950,18 @@ int CPlateLocate::deskewOld(Mat src, vector& inRects, double PI = 3.14159265; double g = tan((angle + 90) * PI / 180.0); - double xdiff = double(middle_crop.rows) * g; - plTri[0] = Point2f(0 + xdiff, 0); - plTri[1] = Point2f(middle_crop.cols - 1, 0); - plTri[2] = Point2f(0, middle_crop.rows - 1); + double xdiff = middle_crop.rows * g; + plTri[0] = Point2f(0 + (float)xdiff, 0); + plTri[1] = Point2f(middle_crop.cols - 1.f, 0); + plTri[2] = Point2f(0, middle_crop.rows - 1.f); } else { double PI = 3.14159265; double g = tan(abs(angle) * PI / 180.0); double xdiff = double(middle_crop.rows) * g; plTri[0] = Point2f(0, 0); - plTri[1] = Point2f(middle_crop.cols - 1, 0); - plTri[2] = Point2f(0 + (float)xdiff, middle_crop.rows - 1); + plTri[1] = Point2f(middle_crop.cols - 1.f, 0); + plTri[2] = Point2f(0 + (float)xdiff, middle_crop.rows - 1.f); } dstTri[0] = Point2f(0, 0); From 3af6a95e111fe345636c82a7bda12586212ba7e4 Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 19:28:58 +0800 Subject: [PATCH 12/21] Fixed type mismatch problem. --- accuracy.txt | 8 ++++++++ src/preprocess/deface.cpp | 2 +- src/preprocess/gdts.cpp | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/accuracy.txt b/accuracy.txt index 4713c12..8ea8425 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1077,3 +1077,11 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.482143个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:152秒, 平均执行时间:0.878613秒 +2015-06-11 19:24:04 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.47619个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:59秒, 平均执行时间:0.34104秒 +2015-06-11 19:26:37 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.47619个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:54秒, 平均执行时间:0.312139秒 diff --git a/src/preprocess/deface.cpp b/src/preprocess/deface.cpp index 83033d7..23d67b9 100644 --- a/src/preprocess/deface.cpp +++ b/src/preprocess/deface.cpp @@ -21,7 +21,7 @@ cv::Mat detectAndMaskFace(cv::Mat& img, cv::CascadeClassifier& cascade, cv::Size(30, 30)); for (auto r = faces.begin(); r != faces.end(); r++) { cv::Rect facerect = *r; - cv::Mat roi = img(cv::Rect(facerect.x * scale, facerect.y * scale, + cv::Mat roi = img(cv::Rect_(facerect.x * scale, facerect.y * scale, facerect.width * scale, facerect.height * scale)); int W = 18; diff --git a/src/preprocess/gdts.cpp b/src/preprocess/gdts.cpp index 5b405d6..251bfe0 100644 --- a/src/preprocess/gdts.cpp +++ b/src/preprocess/gdts.cpp @@ -65,7 +65,7 @@ int generate_gdts() { cv::Mat imageProcess(cv::Mat img) { int width = img.size().width; int height = img.size().height; - cv::Rect rect(width * 0.01, height * 0.01, width * 0.99, height * 0.99); + cv::Rect_ rect(width * 0.01, height * 0.01, width * 0.99, height * 0.99); cv::Mat dst = img(rect); //GaussianBlur( dst, dst, Size(1, 1), 0, 0, BORDER_DEFAULT ); From 856c3fe71bffdef485da44bb83f04575e2c531fe Mon Sep 17 00:00:00 2001 From: Micooz Date: Thu, 11 Jun 2015 19:40:36 +0800 Subject: [PATCH 13/21] Fixed all warnings by Visual Studio 2013. --- src/core/chars_segment.cpp | 8 ++++---- src/core/core_func.cpp | 2 +- src/core/plate.cpp | 12 +++++------- src/core/plate_detect.cpp | 4 ++-- src/core/plate_locate.cpp | 28 ++++++++++++++-------------- test/accuracy.hpp | 28 ++++++++++++++++++++++------ 6 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/core/chars_segment.cpp b/src/core/chars_segment.cpp index 5ad7edd..b2563c2 100644 --- a/src/core/chars_segment.cpp +++ b/src/core/chars_segment.cpp @@ -101,7 +101,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { int w = input_grey.cols; int h = input_grey.rows; - Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); // utils::imwrite("E:/img_inputgray2.jpg", input_grey); @@ -116,7 +116,7 @@ int CCharsSegment::charsSegment(Mat input, vector& resultVec) { img_threshold = input_grey.clone(); int w = input_grey.cols; int h = input_grey.rows; - Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); utils::imwrite("resources/image/tmp/inputgray2.jpg", input_grey); @@ -270,13 +270,13 @@ int CCharsSegment::SortRect(const vector& vecRect, vector& out) { orderIndex.push_back(i); xpositions.push_back(vecRect[i].x); } - + int min = xpositions[0]; int minIdx = 0; for (size_t i = 0; i < xpositions.size(); i++) { min = xpositions[i]; minIdx = i; - for (size_t j = i; j < xpositions.size(); j++) { + for (size_t j = i; j < xpositions.size(); j++) { if (xpositions[j] < min) { min = xpositions[j]; minIdx = j; diff --git a/src/core/core_func.cpp b/src/core/core_func.cpp index e9b09eb..c625a7b 100644 --- a/src/core/core_func.cpp +++ b/src/core/core_func.cpp @@ -290,7 +290,7 @@ bool plateColorJudge(const Mat& src, const Color r, const bool adaptive_minsv, float& percent) { // 判断阈值 const float thresh = 0.45f; - + Mat src_gray; colorMatch(src, src_gray, r, adaptive_minsv); diff --git a/src/core/plate.cpp b/src/core/plate.cpp index 9ce711e..8492233 100644 --- a/src/core/plate.cpp +++ b/src/core/plate.cpp @@ -3,12 +3,10 @@ /*! \namespace easypr Namespace where all the C++ EasyPR functionality resides */ -namespace easypr{ +namespace easypr { - CPlate::CPlate() - { - //cout << "CPlate" << endl; - bColored = true; - } +CPlate::CPlate() { + bColored = true; +} -} /*! \namespace easypr*/ \ No newline at end of file +} /*! \namespace easypr*/ \ No newline at end of file diff --git a/src/core/plate_detect.cpp b/src/core/plate_detect.cpp index 4e7d82b..faa137a 100644 --- a/src/core/plate_detect.cpp +++ b/src/core/plate_detect.cpp @@ -83,7 +83,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector& resultVec, sobel_result_Plates.push_back(sobel_Plates[i]); }*/ - for (size_t i = 0; i < sobel_result_Plates.size(); i++) { + for (size_t i = 0; i < sobel_result_Plates.size(); i++) { CPlate plate = sobel_result_Plates[i]; if (0) { @@ -110,7 +110,7 @@ int CPlateDetect::plateDetectDeep(Mat src, vector& resultVec, int CPlateDetect::showResult(const Mat& result) { namedWindow("EasyPR", CV_WINDOW_AUTOSIZE); - const int RESULTWIDTH = 640; // 640 930 + const int RESULTWIDTH = 640; // 640 930 const int RESULTHEIGHT = 540; // 540 710 Mat img_window; diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index cf7981a..1faec5d 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -7,7 +7,7 @@ using namespace std; Namespace where all the C++ EasyPR functionality resides */ namespace easypr { - + const float DEFAULT_ERROR = 0.9f; // 0.6 const float DEFAULT_ASPECT = 3.75f; // 3.75 @@ -322,8 +322,8 @@ int CPlateLocate::sobelSecSearchPart(Mat& bound, Point2f refpoint, //找到两个边界后进行连接修补处理 if (posRight != 0 && posLeft != 0 && posLeft < posRight) { int posY = int(bound_threshold.rows * 0.5); - for (int i = posLeft + (int)(bound_threshold.rows * 0.1); i < posRight - 4; - i++) { + for (int i = posLeft + (int)(bound_threshold.rows * 0.1); + i < posRight - 4; i++) { bound_threshold.data[posY * bound_threshold.cols + i] = 255; } } @@ -504,7 +504,7 @@ void DeleteNotArea(Mat& inmat) { Mat img_threshold; if (BLUE == plateType) { img_threshold = input_grey.clone(); - Mat tmp = input_grey(Rect_(w * 0.15, h * 0.15, w * 0.7, h * 0.7)); + Mat tmp = input_grey(Rect_(w * 0.15, h * 0.15, w * 0.7, h * 0.7)); int threadHoldV = ThresholdOtsu(tmp); threshold(input_grey, img_threshold, threadHoldV, 255, CV_THRESH_BINARY); @@ -515,7 +515,7 @@ void DeleteNotArea(Mat& inmat) { } else if (YELLOW == plateType) { img_threshold = input_grey.clone(); - Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); + Mat tmp = input_grey(Rect_(w * 0.1, h * 0.1, w * 0.8, h * 0.8)); int threadHoldV = ThresholdOtsu(tmp); threshold(input_grey, img_threshold, threadHoldV, 255, @@ -963,7 +963,7 @@ int CPlateLocate::deskewOld(Mat src, vector& inRects, plTri[1] = Point2f(middle_crop.cols - 1.f, 0); plTri[2] = Point2f(0 + (float)xdiff, middle_crop.rows - 1.f); } - + dstTri[0] = Point2f(0, 0); dstTri[1] = Point2f(WIDTH - 1, 0); dstTri[2] = Point2f(0, HEIGHT - 1); @@ -1141,11 +1141,11 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, Point2f refpoint(bound_rect.x, bound_rect.y); float x = bound_rect.x > 0 ? bound_rect.x : 0; - float y = bound_rect.y > 0 ? bound_rect.y : 0; + float y = bound_rect.y > 0 ? bound_rect.y : 0; - float width = + float width = x + bound_rect.width < src.cols ? bound_rect.width : src.cols - x; - float height = + float height = y + bound_rect.height < src.rows ? bound_rect.height : src.rows - y; Rect_ safe_bound_rect(x, y, width, height); @@ -1159,15 +1159,15 @@ int CPlateLocate::plateSobelLocate(Mat src, vector& candPlates, Rect_ bound_rect = bound_rects[i]; Point2f refpoint(bound_rect.x, bound_rect.y); - float x = bound_rect.x > 0 ? bound_rect.x : 0; - float y = bound_rect.y > 0 ? bound_rect.y : 0; + float x = bound_rect.x > 0 ? bound_rect.x : 0; + float y = bound_rect.y > 0 ? bound_rect.y : 0; - float width = + float width = x + bound_rect.width < src.cols ? bound_rect.width : src.cols - x; - float height = + float height = y + bound_rect.height < src.rows ? bound_rect.height : src.rows - y; - Rect_ safe_bound_rect(x, y, width, height); + Rect_ safe_bound_rect(x, y, width, height); Mat bound_mat = src(safe_bound_rect); // Sobel第二次精细搜索 diff --git a/test/accuracy.hpp b/test/accuracy.hpp index 0e4cf16..775ff4a 100644 --- a/test/accuracy.hpp +++ b/test/accuracy.hpp @@ -40,6 +40,8 @@ int accuracyTest(const char* test_path) { int count_err = 0; // 未识别的图片数量 int count_norecogin = 0; + // not recognized pictures + std::list not_recognized_files; // 总的字符差距 float diff_all = 0; @@ -76,7 +78,10 @@ int accuracyTest(const char* test_path) { if (num == 0) { cout << "无车牌" << endl; - if (plateLicense != "无车牌") count_norecogin++; + if (plateLicense != "无车牌") { + not_recognized_files.push_back(plateLicense); + count_norecogin++; + } } else if (num > 1) { // 多车牌使用diff最小的那个记录 int mindiff = 10000; @@ -142,11 +147,15 @@ int accuracyTest(const char* test_path) { float count_recogin = float(count_all - (count_err + count_norecogin)); float count_rate = count_recogin / count_all; - // float count_norate = 1 - count_rate; cout << "定位率:" << count_rate * 100 << "% " << endl; - diff_avg = diff_all / count_recogin; - match_rate = match_count / count_recogin * 100; + if (count_recogin > 0) { + diff_avg = diff_all / count_recogin; + } + + if (count_recogin > 0) { + match_rate = match_count / count_recogin * 100; + } cout << "平均字符差距:" << diff_avg << "个, "; cout << "完全匹配数:" << match_count << "张, "; @@ -156,7 +165,14 @@ int accuracyTest(const char* test_path) { double avgsec = seconds / double(count_all); cout << "总时间:" << seconds << "秒, "; - cout << "平均执行时间:" << avgsec << "秒 " << endl; + cout << "平均执行时间:" << avgsec << "秒" << endl; + + cout << "未识出图片:" << endl; + + for (auto it = not_recognized_files.begin(); it != not_recognized_files.end(); + ++it) { + cout << *it << endl; + } cout << endl; @@ -178,7 +194,7 @@ int accuracyTest(const char* test_path) { myfile << "完全匹配数:" << match_count << "张, "; myfile << "完全匹配率:" << match_rate << "% " << endl; myfile << "总时间:" << seconds << "秒, "; - myfile << "平均执行时间:" << avgsec << "秒 " << endl; + myfile << "平均执行时间:" << avgsec << "秒" << endl; myfile.close(); } else { cout << "Unable to open file"; From d2cf462fe76b9a2b99928d1241c68f3b0cdf879b Mon Sep 17 00:00:00 2001 From: liuruoze Date: Fri, 12 Jun 2015 20:23:56 +0800 Subject: [PATCH 14/21] 1.3 README --- accuracy.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/accuracy.txt b/accuracy.txt index 4713c12..a47bc4c 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1077,3 +1077,11 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.482143个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:152秒, 平均执行时间:0.878613秒 +2015-06-12 09:50:24 +总图片数:1张, 未识出图片:0张, 定位率:100% +平均字符差距:0个, 完全匹配数:1张, 完全匹配率:100% +总时间:0秒, 平均执行时间:0秒 +2015-06-12 09:52:50 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.482143个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:144秒, 平均执行时间:0.83237秒 From c5b6a62f95aff47acf500eec0af9cfc773907d00 Mon Sep 17 00:00:00 2001 From: liuruoze Date: Fri, 12 Jun 2015 20:33:05 +0800 Subject: [PATCH 15/21] 1.3 README --- accuracy.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accuracy.txt b/accuracy.txt index 21e5642..62fe189 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1085,3 +1085,7 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.47619个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:54秒, 平均执行时间:0.312139秒 +2015-06-12 20:30:57 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:132秒, 平均执行时间:0.763006秒 From 5870dcc924cab2f4d30b89a8a8b93e24d84038d3 Mon Sep 17 00:00:00 2001 From: liuruoze Date: Fri, 12 Jun 2015 20:39:16 +0800 Subject: [PATCH 16/21] 1.3 README --- accuracy.txt | 4 ++++ src/core/plate_locate.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/accuracy.txt b/accuracy.txt index 62fe189..041bd65 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1089,3 +1089,7 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:132秒, 平均执行时间:0.763006秒 +2015-06-12 20:37:48 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:129秒, 平均执行时间:0.745665秒 diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index 1faec5d..b3d0a85 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -669,7 +669,7 @@ int CPlateLocate::deskew(const Mat& src, const Mat& src_b, bool CPlateLocate::rotation(Mat& in, Mat& out, const Size rect_size, const Point2f center, const double angle) { Mat in_large; - in_large.create(in.rows * 1.5, in.cols * 1.5, in.type()); + in_large.create(int(in.rows * 1.5), int(in.cols * 1.5), in.type()); float x = in_large.cols / 2 - center.x > 0 ? in_large.cols / 2 - center.x : 0; float y = in_large.rows / 2 - center.y > 0 ? in_large.rows / 2 - center.y : 0; From 02eedbde55862f5a9bab81141bea8700c4c61687 Mon Sep 17 00:00:00 2001 From: Micooz Date: Tue, 16 Jun 2015 21:23:22 +0800 Subject: [PATCH 17/21] Fixed #41. --- include/easypr/util.h | 14 ++++----- src/train/svm_train.cpp | 64 ++++++++++++++++++++--------------------- src/util/util.cpp | 59 +++++++++++++++++++++---------------- 3 files changed, 72 insertions(+), 65 deletions(-) diff --git a/include/easypr/util.h b/include/easypr/util.h index bd27868..da7bce6 100644 --- a/include/easypr/util.h +++ b/include/easypr/util.h @@ -14,14 +14,6 @@ #define OS_LINUX #endif -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - namespace easypr { class Utils { public: @@ -104,6 +96,12 @@ class Utils { * if not, create it, then call cv::imwrite. */ static bool imwrite(const std::string& file, const cv::Mat& image); + + private: + /* + * Get the last slash from a path, compatible with Windows and *unix. + */ + static std::size_t get_last_slash(const std::string& path); }; typedef Utils utils; diff --git a/src/train/svm_train.cpp b/src/train/svm_train.cpp index 58e2afe..a756969 100644 --- a/src/train/svm_train.cpp +++ b/src/train/svm_train.cpp @@ -6,13 +6,13 @@ namespace easypr { Svm::Svm(const char* forward_data_folder, const char* inverse_data_folder) - : forward_(forward_data_folder), inverse_(inverse_data_folder) { + : forward_(forward_data_folder), inverse_(inverse_data_folder) { assert(forward_); assert(inverse_); } void Svm::divide(const char* images_folder, float percentage /* = 0.7 */) { - auto files = Utils::getFiles(images_folder); + auto files = utils::getFiles(images_folder); if (files.empty()) { std::cout << "No file found in " << images_folder << std::endl; return; @@ -25,14 +25,14 @@ void Svm::divide(const char* images_folder, float percentage /* = 0.7 */) { for (size_t i = 0; i < files.size(); ++i) { // TODO: Move files directly to improve efficiency. auto f = files[i]; - auto file_name = Utils::getFileName(f, true).c_str(); + auto file_name = utils::getFileName(f, true); auto image = cv::imread(f); char save_to[255] = {0}; assert(!image.empty()); if (i < split_index) { - sprintf(save_to, "%s/train/%s", images_folder, file_name); + sprintf(save_to, "%s/train/%s", images_folder, file_name.c_str()); } else { - sprintf(save_to, "%s/test/%s", images_folder, file_name); + sprintf(save_to, "%s/test/%s", images_folder, file_name.c_str()); } utils::imwrite(save_to, image); std::cout << f << " -> " << save_to << std::endl; @@ -62,7 +62,7 @@ void Svm::get_train() { features = features.reshape(1, 1); this->trainingData_.push_back(features); - labels.push_back(Label::kForward); // Note here + labels.push_back(Label::kForward); // Note here } // iterate inverse data @@ -84,7 +84,7 @@ void Svm::get_train() { features = features.reshape(1, 1); this->trainingData_.push_back(features); - labels.push_back(Label::kInverse); // Note here + labels.push_back(Label::kInverse); // Note here } // @@ -154,8 +154,10 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, // need to be trained first CvSVMParams SVM_params; SVM_params.svm_type = CvSVM::C_SVC; - //SVM_params.kernel_type = CvSVM::LINEAR; //CvSVM::LINEAR; 线型,也就是无核 - SVM_params.kernel_type = CvSVM::RBF; //CvSVM::RBF 径向基函数,也就是高斯核 + // SVM_params.kernel_type = CvSVM::LINEAR; //CvSVM::LINEAR; + // 线型,也就是无核 + SVM_params.kernel_type = + CvSVM::RBF; // CvSVM::RBF 径向基函数,也就是高斯核 SVM_params.degree = 0.1; SVM_params.gamma = 1; SVM_params.coef0 = 0.1; @@ -167,27 +169,25 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, std::cout << "Generating svm model file, please wait..." << std::endl; try { - //CvSVM svm(trainingData, classes, cv::Mat(), cv::Mat(), SVM_params); + // CvSVM svm(trainingData, classes, cv::Mat(), cv::Mat(), SVM_params); svm.train_auto(this->trainingData_, this->classes_, cv::Mat(), - cv::Mat(), - SVM_params, - 10, + cv::Mat(), SVM_params, 10, CvSVM::get_default_grid(CvSVM::C), CvSVM::get_default_grid(CvSVM::GAMMA), CvSVM::get_default_grid(CvSVM::P), CvSVM::get_default_grid(CvSVM::NU), CvSVM::get_default_grid(CvSVM::COEF), - CvSVM::get_default_grid(CvSVM::DEGREE), - true); + CvSVM::get_default_grid(CvSVM::DEGREE), true); } catch (const cv::Exception& err) { std::cout << err.what() << std::endl; } + utils::mkdir(out_svm_path); cv::FileStorage fsTo(out_svm_path, cv::FileStorage::WRITE); svm.write(*fsTo, "svm"); - std::cout << "Generate done! The model file is located at " << - out_svm_path << std::endl; + std::cout << "Generate done! The model file is located at " + << out_svm_path << std::endl; } else { // don't train, use ready-made model file try { @@ -196,10 +196,10 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, std::cout << err.what() << std::endl; } } - } // if train + } // if train // TODO Check whether the model file exists or not. - svm.load(out_svm_path, "svm"); // make sure svm model was loaded + svm.load(out_svm_path, "svm"); // make sure svm model was loaded // 30% testing procedure this->get_test(); @@ -220,17 +220,13 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, cv::Mat out; features.convertTo(out, CV_32FC1); - Label predict = ((int) svm.predict(out)) == 1 ? kForward : kInverse; + Label predict = ((int)svm.predict(out)) == 1 ? kForward : kInverse; Label real = test_labels_[label_index++]; - if (predict == kForward && real == kForward) - ptrue_rtrue++; - if (predict == kForward && real == kInverse) - ptrue_rfalse++; - if (predict == kInverse && real == kForward) - pfalse_rtrue++; - if (predict == kInverse && real == kInverse) - pfalse_rfalse++; + if (predict == kForward && real == kForward) ptrue_rtrue++; + if (predict == kForward && real == kInverse) ptrue_rfalse++; + if (predict == kInverse && real == kForward) pfalse_rtrue++; + if (predict == kInverse && real == kInverse) pfalse_rfalse++; } std::cout << "count_all: " << count_all << std::endl; @@ -244,7 +240,8 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, precise = ptrue_rtrue / (ptrue_rtrue + ptrue_rfalse); std::cout << "precise: " << precise << std::endl; } else { - std::cout << "precise: " << "NA" << std::endl; + std::cout << "precise: " + << "NA" << std::endl; } double recall = 0; @@ -252,7 +249,8 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, recall = ptrue_rtrue / (ptrue_rtrue + pfalse_rtrue); std::cout << "recall: " << recall << std::endl; } else { - std::cout << "recall: " << "NA" << std::endl; + std::cout << "recall: " + << "NA" << std::endl; } double Fsocre = 0; @@ -260,9 +258,9 @@ void Svm::train(bool divide /* = true */, float divide_percentage /* = 0.7 */, Fsocre = 2 * (precise * recall) / (precise + recall); std::cout << "Fsocre: " << Fsocre << std::endl; } else { - std::cout << "Fsocre: " << "NA" << std::endl; + std::cout << "Fsocre: " + << "NA" << std::endl; } - } -} // namespace easypr +} // namespace easypr diff --git a/src/util/util.cpp b/src/util/util.cpp index 782b282..0cac440 100644 --- a/src/util/util.cpp +++ b/src/util/util.cpp @@ -6,6 +6,13 @@ #include #include #define PATH_DELIMITER '\\' +#ifdef min +#undef min +#endif + +#ifdef max +#undef max +#endif #elif defined(OS_LINUX) || defined(OS_UNIX) #include @@ -53,24 +60,7 @@ long Utils::getTimestamp() { std::string Utils::getFileName(const std::string& path, const bool postfix /* = false */) { if (!path.empty()) { -#ifdef OS_WINDOWS - size_t last_slash_1 = path.find_last_of("\\"); - size_t last_slash_2 = path.find_last_of("/"); - size_t last_slash; - - if (last_slash_1 != std::string::npos && - last_slash_2 != std::string::npos) { - // C:/path\\to/file.postfix - last_slash = max(last_slash_1, last_slash_2); - } else { - // C:\\path\\to\\file.postfix - // C:/path/to/file.postfix - last_slash = - (last_slash_1 == std::string::npos) ? last_slash_2 : last_slash_1; - } -#else - size_t last_slash = path.find_last_of('/'); -#endif + size_t last_slash = utils::get_last_slash(path); size_t last_dot = path.find_last_of('.'); if (last_dot < last_slash || last_dot == std::string::npos) { @@ -150,7 +140,7 @@ std::vector Utils::getFiles(const std::string& folder, } } else { // it's a file - std::string file_path; + std::string file_path; // current_folder.pop_back(); file_path.assign(current_folder.c_str()).pop_back(); file_path.append(file_info.name); @@ -234,13 +224,13 @@ bool Utils::mkdir(const std::string folder) { if (c == PATH_DELIMITER || it == folder.end() - 1) { folder_builder.append(sub); #ifdef OS_WINDOWS - if (0 != ::_access(folder_builder.c_str(), 0)) { + if (0 != ::_access(folder_builder.c_str(), 0)) { #else if (0 != ::access(folder_builder.c_str(), 0)) { #endif - // this folder not exist +// this folder not exist #ifdef OS_WINDOWS - if (0 != ::_mkdir(folder_builder.c_str())) { + if (0 != ::_mkdir(folder_builder.c_str())) { #else if (0 != ::mkdir(folder_builder.c_str(), S_IRWXU)) { #endif @@ -255,9 +245,30 @@ bool Utils::mkdir(const std::string folder) { } bool Utils::imwrite(const std::string& file, const cv::Mat& image) { - auto folder = file.substr(0, file.find_last_of(PATH_DELIMITER)); + auto folder = file.substr(0, utils::get_last_slash(file)); Utils::mkdir(folder); return cv::imwrite(file, image); } -} // namespace easypr \ No newline at end of file +std::size_t Utils::get_last_slash(const std::string& path) { +#ifdef OS_WINDOWS + size_t last_slash_1 = path.find_last_of("\\"); + size_t last_slash_2 = path.find_last_of("/"); + size_t last_slash; + + if (last_slash_1 != std::string::npos && last_slash_2 != std::string::npos) { + // C:/path\\to/file.postfix + last_slash = std::max(last_slash_1, last_slash_2); + } else { + // C:\\path\\to\\file.postfix + // C:/path/to/file.postfix + last_slash = + (last_slash_1 == std::string::npos) ? last_slash_2 : last_slash_1; + } +#else + size_t last_slash = path.find_last_of('/'); +#endif + return last_slash; +} + +} // namespace easypr \ No newline at end of file From e79027816d9591a7818e7c4490b0b2d3735f0c1e Mon Sep 17 00:00:00 2001 From: Micooz Date: Tue, 16 Jun 2015 21:42:59 +0800 Subject: [PATCH 18/21] Enhance: c++11 support check when using CMake. --- CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index daa5d7e..eaa0f76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,17 @@ cmake_minimum_required(VERSION 2.8) project (easypr) # c++11 required -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) +CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) + +if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +elseif(COMPILER_SUPPORTS_CXX0X) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +else() + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} doesn鈥檛 support C++11. Please upgrade or use a different C++ compiler.") +endif() # opencv package required find_package(OpenCV REQUIRED) From 152008966ca29415d9343eee6deddb396b737c2a Mon Sep 17 00:00:00 2001 From: liuruoze Date: Wed, 17 Jun 2015 07:31:32 +0800 Subject: [PATCH 19/21] 1.3 README --- accuracy.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accuracy.txt b/accuracy.txt index 041bd65..7659c10 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1093,3 +1093,7 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:129秒, 平均执行时间:0.745665秒 +2015-06-17 07:28:05 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:153秒, 平均执行时间:0.884393秒 From af0a19624055c5ab2579ee9edee22b4837d4dfad Mon Sep 17 00:00:00 2001 From: liuruoze Date: Wed, 17 Jun 2015 07:39:08 +0800 Subject: [PATCH 20/21] 1.3 README --- accuracy.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accuracy.txt b/accuracy.txt index 7659c10..7c53142 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1097,3 +1097,7 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:153秒, 平均执行时间:0.884393秒 +2015-06-17 07:37:42 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:245秒, 平均执行时间:1.41618秒 From 6898b2dca327ee25facb57459af251d18c867054 Mon Sep 17 00:00:00 2001 From: liuruoze Date: Wed, 17 Jun 2015 07:47:59 +0800 Subject: [PATCH 21/21] 1.3 README --- accuracy.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accuracy.txt b/accuracy.txt index 7c53142..376f847 100644 --- a/accuracy.txt +++ b/accuracy.txt @@ -1101,3 +1101,7 @@ 总图片数:173张, 未识出图片:5张, 定位率:97.1098% 平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% 总时间:245秒, 平均执行时间:1.41618秒 +2015-06-17 07:44:25 +总图片数:173张, 未识出图片:5张, 定位率:97.1098% +平均字符差距:0.458333个, 完全匹配数:130张, 完全匹配率:77.381% +总时间:214秒, 平均执行时间:1.23699秒