优化了测试过程,新增了测试数据集,更新了发布版本

dev
hzy 5 years ago
parent a01db1d12b
commit 5555b8735a

Binary file not shown.

Binary file not shown.

@ -571,7 +571,7 @@
<image>
<imageName>ÍîA30123</imageName>
<taggedRectangles>
<taggedRectangle x="292" y="1437" width="98" height="26" rotation="1" locateType="1">À¶ÅÆ:ÍîA30123</taggedRectangle>
<taggedRectangle x="292" y="1437" width="26" height="98" rotation="-89" locateType="1">À¶ÅÆ:ÍîA30123</taggedRectangle>
</taggedRectangles>
</image>
<image>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

@ -1,2 +1,27 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<tagset/>
<tagset>
<image>
<imageName>test1</imageName>
<taggedRectangles>
<taggedRectangle x="170" y="184" width="96" height="27" rotation="-1">À¶ÅÆ:ËÕA88888</taggedRectangle>
</taggedRectangles>
</image>
<image>
<imageName>test2</imageName>
<taggedRectangles>
<taggedRectangle x="220" y="207" width="87" height="26" rotation="0">À¶ÅÆ:ËÕA88888</taggedRectangle>
</taggedRectangles>
</image>
<image>
<imageName>test3</imageName>
<taggedRectangles>
<taggedRectangle x="222" y="214" width="113" height="39" rotation="-1">À¶ÅÆ:ËÕA88888</taggedRectangle>
</taggedRectangles>
</image>
<image>
<imageName>test4</imageName>
<taggedRectangles>
<taggedRectangle x="357" y="251" width="118" height="29" rotation="-48">À¶ÅÆ:ËÕA88888</taggedRectangle>
</taggedRectangles>
</image>
</tagset>

@ -3288,3 +3288,23 @@ Recall:85.1281%, Precise:80.5653%, Fscore:82.7839%.
Recall:0%, Precise:0%, Fscore:0%.
0-error:0%, 1-error:0%, Chinese-precise:0%
总共时间: 0秒, 平均执行时间:-nan(ind)秒
2020-08-13 22:06:56
总图片数:4, Plates count:0, 未定位车牌:0, 检出率:-nan(ind)%
Recall:0%, Precise:0%, Fscore:0%.
0-error:0%, 1-error:0%, Chinese-precise:0%
总共时间: 183秒, 平均执行时间:45.75秒
2020-08-13 22:15:40
总图片数:4, Plates count:0, 未定位车牌:0, 检出率:-nan(ind)%
Recall:0%, Precise:0%, Fscore:0%.
0-error:0%, 1-error:0%, Chinese-precise:0%
总共时间: 241秒, 平均执行时间:60.25秒
2020-08-13 22:23:51
总图片数:4, Plates count:0, 未定位车牌:0, 检出率:-nan(ind)%
Recall:0%, Precise:0%, Fscore:0%.
0-error:0%, 1-error:0%, Chinese-precise:0%
总共时间: 72秒, 平均执行时间:18秒
2020-08-13 22:31:30
总图片数:4, Plates count:4, 未定位车牌:4, 检出率:0%
Recall:6.41626%, Precise:2.92711%, Fscore:4.0202%.
0-error:0%, 1-error:0%, Chinese-precise:0%
总共时间: 84秒, 平均执行时间:21秒

@ -49,7 +49,7 @@ namespace easypr {
// score is the distance of marginbelow zero is plate, up is not
// when score is below zero, the samll the value, the more possibliy to be a plate.
plate.setPlateScore(score);
if (score < 0.5) return 0;
if (score < 0.5 && score > 0) return 0;
else return -1;
}

@ -125,7 +125,7 @@ int CPlateLocate::colorSearch(const Mat &src, const Color r, Mat &out,
const int color_morph_width = 10;
const int color_morph_height = 2;
colorMatch(src, match_grey, r, false);
colorMatch(src, match_grey, r, true);
SHOW_IMAGE(match_grey, 1);
Mat src_threshold;

@ -25,6 +25,9 @@ int CPlateRecognize::plateRecognize(const Mat& src, std::vector<CPlate> &plateVe
for (size_t j = 0; j < num; j++) {
CPlate& item = plateVec.at(j);
Mat plateMat = item.getPlateMat();
int w = plateMat.cols;
int h = plateMat.rows;
Mat tmpMat = plateMat(Rect_<double>(w * 0.1, h * 0.1, w * 0.8, h * 0.8));
SHOW_IMAGE(plateMat, 0);
if (1) {
namedWindow("Detect_plate", 0);
@ -41,7 +44,7 @@ int CPlateRecognize::plateRecognize(const Mat& src, std::vector<CPlate> &plateVe
// get plate color
Color color = item.getPlateColor();
if (color == UNKNOWN) {
color = getPlateType(plateMat, true);
color = getPlateType(tmpMat, true);
item.setPlateColor(color);
}
std::string plateColor = getPlateColor(color);

@ -1,6 +1,5 @@
#include "easypr/util/kv.h"
#include "easypr/util/util.h"
namespace easypr {
Kv::Kv() { }
@ -9,7 +8,6 @@ void Kv::load(const std::string &file) {
this->clear();
std::ifstream reader(file);
assert(reader);
if (reader.is_open()) {
while (!reader.eof()) {
std::string line;

@ -107,9 +107,9 @@ namespace easypr {
// set the parameters of CPlateRecognize
CPlateRecognize pr;
pr.setResultShow(false);
pr.setResultShow(true);
pr.setLifemode(true);
pr.setDetectType(PR_DETECT_COLOR | PR_DETECT_CMSER);
pr.setDetectType(PR_DETECT_COLOR | PR_DETECT_SOBEL);
pr.setMaxPlates(4);
// load the maching learning model

@ -75,8 +75,16 @@ int test_chars_identify() {
int test_chars_recognise() {
std::cout << "test_chars_recognise" << std::endl;
string in;
cout << "please input picture name:" << endl;
cin >> in;
cv::Mat src = cv::imread("resources/image/new_car.jpg");
cv::Mat src = cv::imread("resources/image/"+in);
if (src.empty())
{
cout << "picture not exeist!" << endl;
return 0;
}
CCharsRecognise cr;
std::string plateLicense = "";
int result = cr.charsRecognise(src, plateLicense);

@ -4,7 +4,8 @@
#include "accuracy.hpp"
#include "chars.hpp"
#include "plate.hpp"
#include<iostream>
#include<direct.h>
// %OPENCV%\x86\vc12\lib opencv_world300d.lib;
namespace easypr {
@ -117,8 +118,7 @@ int trainChineseMain() {
int testMain() {
std::shared_ptr<easypr::Kv> kv(new easypr::Kv);
kv->load("resources/text/chinese_mapping");
kv->load("./resources/text/chinese_mapping");
bool isExit = false;
while (!isExit) {
Utils::print_file_lines("resources/text/test_menu");
@ -413,7 +413,7 @@ void command_line_handler(int argc, const char* argv[]) {
}
int main(int argc, const char* argv[]) {
std::shared_ptr<easypr::Kv> kv(new easypr::Kv);
std::shared_ptr<easypr::Kv> kv(new easypr::Kv);
kv->load("./resources/text/chinese_mapping");
if (argc > 1) {
// handle command line execution.

@ -151,17 +151,17 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>F:\OpenCV\opencv\build\include;$(SolutionDir)include</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4819</DisableSpecificWarnings>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(SolutionDir)lib;</AdditionalLibraryDirectories>
<AdditionalDependencies>libopencv_mini64.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>F:\OpenCV\opencv\build\x64\vc15\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world346.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

@ -136,7 +136,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>C:\Users\Micooz\Documents\opencv3\build\include;$(SolutionDir)include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>F:\OpenCV\opencv\build\include;$(SolutionDir)include</AdditionalIncludeDirectories>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Loading…
Cancel
Save