add LoadModel

1.3
Fenix 11 years ago
parent aa0b2f98b5
commit c4cea7de77

@ -0,0 +1,215 @@
<<<<<<< HEAD
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
=======
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
>>>>>>> 9d203677f87c74ec5ed612a8fe7bf0f940e22461

@ -66,6 +66,12 @@ void CCharsIdentify::LoadModel()
ann.load(m_path.c_str(), "ann");
}
void CCharsIdentify::LoadModel(string s)
{
ann.clear();
ann.load(s.c_str(), "ann");
}
//create the accumulation histograms,img is a binary image, t is ˮƽ»ò´¹Ö±
Mat CCharsIdentify::ProjectedHistogram(Mat img, int t)
{

@ -12,6 +12,11 @@ CCharsRecognise::CCharsRecognise()
m_charsIdentify = new CCharsIdentify();
}
void CCharsRecognise::LoadModel(string s)
{
m_charsIdentify->LoadModel(s.c_str());
}
int CCharsRecognise::charsRecognise(Mat plate, string& plateLicense)
{
//车牌字符方块集合

@ -12,6 +12,11 @@ CPlateDetect::CPlateDetect()
m_plateJudge = new CPlateJudge();
}
void CPlateDetect::LoadModel(string s)
{
m_plateJudge->LoadModel(s.c_str());
}
int CPlateDetect::plateDetect(Mat src, vector<Mat>& resultVec)
{
//可能是车牌的图块集合

@ -18,6 +18,12 @@ void CPlateJudge::LoadModel()
svm.load(m_path.c_str(), "svm");
}
void CPlateJudge::LoadModel(string s)
{
svm.clear();
svm.load(s.c_str(), "svm");
}
//! 直方图均衡
Mat CPlateJudge::histeq(Mat in)
{

@ -12,6 +12,30 @@ CPlateRecognize::CPlateRecognize()
m_charsRecognise = new CCharsRecognise();
}
//! ×°ÔØSVMÄ£ÐÍ
void CPlateRecognize::LoadSVM(string strSVM)
{
m_plateDetect->LoadModel(strSVM.c_str());
}
//! ×°ÔØANNÄ£ÐÍ
void CPlateRecognize::LoadANN(string strANN)
{
m_charsRecognise->LoadModel(strANN.c_str());
}
int CPlateRecognize::plateDetect(Mat src, vector<Mat>& resultVec)
{
int result = m_plateDetect->plateDetect(src, resultVec);
return result;
}
int CPlateRecognize::charsRecognise(Mat plate, string& plateLicense)
{
int result = m_charsRecognise->charsRecognise(plate, plateLicense);
return result;
}
int CPlateRecognize::plateRecognize(Mat src, vector<string>& plateVec)
{
//车牌方块集合

@ -39,6 +39,9 @@ public:
//! ×°ÔØANNÄ£ÐÍ
void LoadModel();
//! ×°ÔØANNÄ£ÐÍ
void LoadModel(string s);
//! ÉèÖÃÓë¶ÁÈ¡Ä£ÐÍ·¾¶
inline void setModelPath(string path){ m_path = path; }
inline string getModelPath() const{ return m_path; }

@ -29,6 +29,9 @@ public:
//! 字符分割与识别
int charsRecognise(Mat, String&);
//! ×°ÔØANNÄ£ÐÍ
void LoadModel(string s);
private:
//!字符分割
CCharsSegment* m_charsSegment;

@ -29,6 +29,9 @@ public:
//! 车牌定位与判断
int plateDetect(Mat, vector<Mat>&);
//! ×°ÔØSVMÄ£ÐÍ
void LoadModel(string s);
private:
//!车牌定位
CPlateLocate* m_plateLocate;

@ -33,6 +33,9 @@ public:
//! ×°ÔØSVMÄ£ÐÍ
void LoadModel();
//! ×°ÔØSVMÄ£ÐÍ
void LoadModel(string s);
//! ÉèÖÃÓë¶ÁÈ¡Ä£ÐÍ·¾¶
inline void setModelPath(string path){ m_path = path; }
inline string getModelPath() const{ return m_path; }

@ -29,6 +29,18 @@ public:
//! 车牌检测与字符识别
int plateRecognize(Mat, vector<string>& );
//! 车牌定位与判断
int plateDetect(Mat, vector<Mat>&);
//! 字符分割与识别
int charsRecognise(Mat, String&);
//! 装载SVM
void LoadSVM(string s);
//! 装载ANN模型
void LoadANN(string s);
private:
//!车牌检测
CPlateDetect* m_plateDetect;

Loading…
Cancel
Save