資源簡介
HyperLPR是一個使用深度學習針對對中文車牌識別的實現,開源地址:https://github.com/zeusees/HyperLPR,在windows下,使用vs2013編譯成功,編譯前需要修改opencv340的include和lib路徑。
代碼片段和文件信息
#include?“Pipeline.h“
std::vector?CH_PLATE_CODE{?“京“?“滬“?“津“?“渝“?“冀“?“晉“?“蒙“?“遼“?“吉“?“黑“?“蘇“?“浙“?“皖“?“閩“?“贛“?“魯“?“豫“?“鄂“?“湘“?“粵“?“桂“
???????????????????????????????????????“瓊“?“川“?“貴“?“云“?“藏“?“陜“?“甘“?“青“?“寧“?“新“?“0“?“1“?“2“?“3“?“4“?“5“?“6“?“7“?“8“?“9“?“A“
??????????????????????????????????????“B“?“C“?“D“?“E“?“F“?“G“?“H“?“J“?“K“?“L“?“M“?“N“?“P“?“Q“?“R“?“S“?“T“?“U“?“V“?“W“?“X“
???????????????????????????????????“Y“?“Z““港““學““使““警““澳““掛““軍““北““南““廣““沈““蘭““成““濟““海““民““航““空“};
using?namespace?std;
template
static?unsigned?int?levenshtein_distance(const?T?&s1?const?T?&s2)?{
const?size_t?len1?=?s1.size()?len2?=?s2.size();
std::vector?col(len2?+?1)?prevCol(len2?+?1);
for?(unsigned?int?i?=?0;?i? for?(unsigned?int?i?=?0;?i? col[0]?=?i?+?1;
for?(unsigned?int?j?=?0;?j? col[j?+?1]?=?min(
min(prevCol[1?+?j]?+?1?col[j]?+?1)
prevCol[j]?+?(s1[i]?==?s2[j]???0?:?1));
col.swap(prevCol);
}
return?prevCol[len2];
}
void?TEST_ACC(){
pr::PipelinePR?prc(“model/cascade.xml“
“model/HorizonalFinemapping.prototxt“?“model/HorizonalFinemapping.caffemodel“
“model/Segmentation.prototxt“?“model/Segmentation.caffemodel“
“model/CharacterRecognization.prototxt“?“model/CharacterRecognization.caffemodel“
“model/SegmentationFree.prototxt“?“model/SegmentationFree.caffemodel“
);
ifstream?file;
string?imagename;
int?n?=?0?correct?=?0?j?=?0?sum?=?0;
char?filename[]?=?“E:\\general_test\\1.txt“;
string?pathh?=?“E:\\general_test\\“;
file.open(filename?ios::in);
// cout?< while?(!file.eof())
{
file?>>?imagename;
string?imgpath?=?pathh?+?imagename;
// cout?< std::cout?<“------------------------------------------------“?< cout?<“圖片名:“?< cv::Mat?image?=?cv::imread(imgpath);
// cv::imshow(“image“?image);
// cv::waitKey(0);
std::vector?res?=?prc.RunPiplineAsImage(image?pr::SEGMENTATION_FREE_METHOD);
float?conf?=?0;
vector?con;
vector?name;
for?(auto?st?:?res)?{
if?(st.confidence?>?0.1)?{
//std::cout?< con.push_back(st.confidence);
name.push_back(st.getPlateName());
//conf?+=?st.confidence;
}
else
cout?<“no?string“?< }
// std::cout?< int?num?=?con.size();
float?max?=?0;
string?platestr?chpr?ch;
int?diff?=?0?dif?=?0;
for?(int?i?=?0;?i?
if?(con.at(i)?>?max)
{
max?=?con.at(i);
platestr?=?name.at(i);
}
}
// cout?<“max:“< cout?<“string:“?< chpr?=?platestr.substr(0?2);
ch?=?imagename.substr(0?2);
diff?=?levenshtein_distance(imagename?platestr);
dif?=?diff?-?4;
cout?<“差距:“?< sum?+=?dif;
if?(ch?!=?chpr
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????43912??2017-11-15?04:56??lpre2e\A88888.jpg
?????文件????????492??2018-01-30?11:00??lpre2e\include\CNNRecognizer.h
?????文件????????326??2018-01-30?11:00??lpre2e\include\FastDeskew.h
?????文件????????630??2018-01-30?11:00??lpre2e\include\FineMapping.h
?????文件???????3983??2018-01-30?11:00??lpre2e\include\niBlackThreshold.h
?????文件???????2107??2018-01-31?08:27??lpre2e\include\Pipeline.h
?????文件????????812??2018-01-30?11:00??lpre2e\include\PlateDetection.h
?????文件???????3847??2018-01-30?11:00??lpre2e\include\PlateInfo.h
?????文件???????1211??2018-01-30?11:00??lpre2e\include\PlateSegmentation.h
?????文件????????581??2018-01-30?11:00??lpre2e\include\Recognizer.h
?????文件????????637??2018-01-30?11:00??lpre2e\include\SegmentationFreeRecognizer.h
?????文件???????5583??2018-01-31?10:59??lpre2e\lpre2e\e2e.cpp
?????文件???????7401??2018-01-31?10:36??lpre2e\lpre2e\lpre2e.vcxproj
?????文件???????2969??2018-01-31?08:12??lpre2e\lpre2e\lpre2e.vcxproj.filters
?????文件????????165??2018-01-31?10:29??lpre2e\lpre2e\lpre2e.vcxproj.user
?????文件?????356611??2018-01-30?11:00??lpre2e\lpre2e\model\cascade.xm
?????文件?????930906??2018-01-30?11:00??lpre2e\lpre2e\model\CharacterRecognization.caffemodel
?????文件???????1830??2018-01-30?11:00??lpre2e\lpre2e\model\CharacterRecognization.prototxt
?????文件??????47608??2018-01-30?11:00??lpre2e\lpre2e\model\HorizonalFinemapping.caffemodel
?????文件???????1337??2018-01-30?11:00??lpre2e\lpre2e\model\HorizonalFinemapping.prototxt
?????文件?????276969??2018-01-30?11:00??lpre2e\lpre2e\model\Segmentation.caffemodel
?????文件???????1719??2018-01-30?11:00??lpre2e\lpre2e\model\Segmentation.prototxt
?????文件????9415241??2018-01-30?11:00??lpre2e\lpre2e\model\SegmentationFree.caffemodel
?????文件???????4935??2018-01-30?11:00??lpre2e\lpre2e\model\SegmentationFree.prototxt
?????文件????3542646??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\CNNRecognizer.obj
?????文件????3708681??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\e2e.obj
?????文件????3425153??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\FastDeskew.obj
?????文件????3572362??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\FineMapping.obj
?????文件????????993??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\lpre2e.Build.CppClean.log
?????文件??????12219??2018-02-01?08:17??lpre2e\lpre2e\x64\Release\lpre2e.log
............此處省略45個文件信息
- 上一篇:基于ssm的權限管理系統
- 下一篇:Authorware----自制簡歷
評論
共有 條評論