|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Name: chars_recognise Header
|
|
|
|
|
// Version: 1.0
|
|
|
|
|
// Date: 2014-09-28
|
|
|
|
|
// Author: liuruoze
|
|
|
|
|
// Copyright: liuruoze
|
|
|
|
|
// Reference: Mastering OpenCV with Practical Computer Vision Projects
|
|
|
|
|
// Reference: CSDN Bloger taotao1233
|
|
|
|
|
// Desciption:
|
|
|
|
|
// Defines CCharsRecognise
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
#ifndef __CHARS_RECOGNISE_H__
|
|
|
|
|
#define __CHARS_RECOGNISE_H__
|
|
|
|
|
|
|
|
|
|
#include "easypr/chars_segment.h"
|
|
|
|
|
#include "easypr/chars_identify.h"
|
|
|
|
|
|
|
|
|
|
/*! \namespace easypr
|
|
|
|
|
Namespace where all the C++ EasyPR functionality resides
|
|
|
|
|
*/
|
|
|
|
|
namespace easypr {
|
|
|
|
|
|
|
|
|
|
class CCharsRecognise {
|
|
|
|
|
public:
|
|
|
|
|
CCharsRecognise();
|
|
|
|
|
|
|
|
|
|
~CCharsRecognise();
|
|
|
|
|
|
|
|
|
|
//! <20>ַ<EFBFBD><D6B7>ָ<EFBFBD><D6B8><EFBFBD>ʶ<EFBFBD><CAB6>
|
|
|
|
|
int charsRecognise(Mat, String&);
|
|
|
|
|
|
|
|
|
|
string charsRecognise(Mat plate);
|
|
|
|
|
|
|
|
|
|
//! װ<><D7B0>ANNģ<4E><C4A3>
|
|
|
|
|
void LoadANN(string s);
|
|
|
|
|
|
|
|
|
|
//! <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
|
|
|
|
|
inline void setCRDebug(int param) { m_charsSegment->setDebug(param); }
|
|
|
|
|
|
|
|
|
|
//! <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ģʽ״̬
|
|
|
|
|
inline int getCRDebug() { return m_charsSegment->getDebug(); }
|
|
|
|
|
|
|
|
|
|
//! <20><><EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD>ɫ
|
|
|
|
|
inline string getPlateColor(Mat input) const {
|
|
|
|
|
string color = "δ֪";
|
|
|
|
|
Color result = getPlateType(input, true);
|
|
|
|
|
if (BLUE == result) color = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
if (YELLOW == result) color = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
return color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//! <20><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD>
|
|
|
|
|
inline void setLiuDingSize(int param) {
|
|
|
|
|
m_charsSegment->setLiuDingSize(param);
|
|
|
|
|
}
|
|
|
|
|
inline void setColorThreshold(int param) {
|
|
|
|
|
m_charsSegment->setColorThreshold(param);
|
|
|
|
|
}
|
|
|
|
|
inline void setBluePercent(float param) {
|
|
|
|
|
m_charsSegment->setBluePercent(param);
|
|
|
|
|
}
|
|
|
|
|
inline float getBluePercent() const {
|
|
|
|
|
return m_charsSegment->getBluePercent();
|
|
|
|
|
}
|
|
|
|
|
inline void setWhitePercent(float param) {
|
|
|
|
|
m_charsSegment->setWhitePercent(param);
|
|
|
|
|
}
|
|
|
|
|
inline float getWhitePercent() const {
|
|
|
|
|
return m_charsSegment->getWhitePercent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
//<2F><><EFBFBD>ַ<EFBFBD><D6B7>ָ<EFBFBD>
|
|
|
|
|
CCharsSegment* m_charsSegment;
|
|
|
|
|
|
|
|
|
|
//! <20>ַ<EFBFBD>ʶ<EFBFBD><CAB6>
|
|
|
|
|
CCharsIdentify* m_charsIdentify;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} /* \namespace easypr */
|
|
|
|
|
|
|
|
|
|
#endif /* endif __CHARS_RECOGNISE_H__ */
|