commit
50de5ed2d6
Before Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 76 KiB |
File diff suppressed because it is too large
Load Diff
@ -1,50 +1,50 @@
|
|||||||
#include "../include/chars_recognise.h"
|
#include "../include/chars_recognise.h"
|
||||||
|
|
||||||
/*! \namespace easypr
|
/*! \namespace easypr
|
||||||
Namespace where all the C++ EasyPR functionality resides
|
Namespace where all the C++ EasyPR functionality resides
|
||||||
*/
|
*/
|
||||||
namespace easypr{
|
namespace easypr{
|
||||||
|
|
||||||
CCharsRecognise::CCharsRecognise()
|
CCharsRecognise::CCharsRecognise()
|
||||||
{
|
{
|
||||||
//cout << "CCharsRecognise" << endl;
|
//cout << "CCharsRecognise" << endl;
|
||||||
m_charsSegment = new CCharsSegment();
|
m_charsSegment = new CCharsSegment();
|
||||||
m_charsIdentify = new CCharsIdentify();
|
m_charsIdentify = new CCharsIdentify();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCharsRecognise::LoadANN(string s)
|
|
||||||
{
|
|
||||||
m_charsIdentify->LoadModel(s.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
int CCharsRecognise::charsRecognise(Mat plate, string& plateLicense)
|
|
||||||
{
|
|
||||||
//车牌字符方块集合
|
|
||||||
vector<Mat> matVec;
|
|
||||||
|
|
||||||
string plateIdentify = "";
|
void CCharsRecognise::LoadANN(string s)
|
||||||
|
{
|
||||||
|
m_charsIdentify->LoadModel(s.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
int result = m_charsSegment->charsSegment(plate, matVec);
|
int CCharsRecognise::charsRecognise(Mat plate, string& plateLicense)
|
||||||
if (result == 0)
|
|
||||||
{
|
{
|
||||||
int num = matVec.size();
|
//车牌字符方块集合
|
||||||
for (int j = 0; j < num; j++)
|
vector<Mat> matVec;
|
||||||
{
|
|
||||||
Mat charMat = matVec[j];
|
|
||||||
bool isChinses = false;
|
|
||||||
|
|
||||||
//默认首个字符块是中文字符
|
string plateIdentify = "";
|
||||||
if (j == 0)
|
|
||||||
isChinses = true;
|
|
||||||
|
|
||||||
string charcater = m_charsIdentify->charsIdentify(charMat, isChinses);
|
int result = m_charsSegment->charsSegment(plate, matVec);
|
||||||
plateIdentify = plateIdentify + charcater;
|
if (result == 0)
|
||||||
|
{
|
||||||
|
int num = matVec.size();
|
||||||
|
for (int j = 0; j < num; j++)
|
||||||
|
{
|
||||||
|
Mat charMat = matVec[j];
|
||||||
|
bool isChinses = false;
|
||||||
|
|
||||||
|
//默认首个字符块是中文字符
|
||||||
|
if (j == 0)
|
||||||
|
isChinses = true;
|
||||||
|
|
||||||
|
string charcater = m_charsIdentify->charsIdentify(charMat, isChinses);
|
||||||
|
plateIdentify = plateIdentify + charcater;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
plateLicense = plateIdentify;
|
plateLicense = plateIdentify;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /*! \namespace easypr*/
|
} /*! \namespace easypr*/
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue