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"
|
||||
|
||||
/*! \namespace easypr
|
||||
Namespace where all the C++ EasyPR functionality resides
|
||||
Namespace where all the C++ EasyPR functionality resides
|
||||
*/
|
||||
namespace easypr{
|
||||
|
||||
CCharsRecognise::CCharsRecognise()
|
||||
{
|
||||
//cout << "CCharsRecognise" << endl;
|
||||
m_charsSegment = new CCharsSegment();
|
||||
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;
|
||||
CCharsRecognise::CCharsRecognise()
|
||||
{
|
||||
//cout << "CCharsRecognise" << endl;
|
||||
m_charsSegment = new CCharsSegment();
|
||||
m_charsIdentify = new CCharsIdentify();
|
||||
}
|
||||
|
||||
string plateIdentify = "";
|
||||
void CCharsRecognise::LoadANN(string s)
|
||||
{
|
||||
m_charsIdentify->LoadModel(s.c_str());
|
||||
}
|
||||
|
||||
int result = m_charsSegment->charsSegment(plate, matVec);
|
||||
if (result == 0)
|
||||
int CCharsRecognise::charsRecognise(Mat plate, string& plateLicense)
|
||||
{
|
||||
int num = matVec.size();
|
||||
for (int j = 0; j < num; j++)
|
||||
{
|
||||
Mat charMat = matVec[j];
|
||||
bool isChinses = false;
|
||||
//车牌字符方块集合
|
||||
vector<Mat> matVec;
|
||||
|
||||
//默认首个字符块是中文字符
|
||||
if (j == 0)
|
||||
isChinses = true;
|
||||
string plateIdentify = "";
|
||||
|
||||
string charcater = m_charsIdentify->charsIdentify(charMat, isChinses);
|
||||
plateIdentify = plateIdentify + charcater;
|
||||
int result = m_charsSegment->charsSegment(plate, matVec);
|
||||
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*/
|
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