|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Name: chars_identify Header
|
|
|
|
|
// Version: 1.0
|
|
|
|
|
// Date: 2014-09-25
|
|
|
|
|
// Author: liuruoze
|
|
|
|
|
// Copyright: liuruoze
|
|
|
|
|
// Reference: Mastering OpenCV with Practical Computer Vision Projects
|
|
|
|
|
// Reference: CSDN Bloger taotao1233
|
|
|
|
|
// Desciption:
|
|
|
|
|
// Defines CCharsIdentify
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
#ifndef __CHARS_IDENTIFY_H__
|
|
|
|
|
#define __CHARS_IDENTIFY_H__
|
|
|
|
|
|
|
|
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
|
|
|
|
|
|
using namespace cv;
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
/*! \namespace easypr
|
|
|
|
|
Namespace where all the C++ EasyPR functionality resides
|
|
|
|
|
*/
|
|
|
|
|
namespace easypr {
|
|
|
|
|
|
|
|
|
|
class CCharsIdentify {
|
|
|
|
|
public:
|
|
|
|
|
CCharsIdentify();
|
|
|
|
|
|
|
|
|
|
//! <20>ַ<EFBFBD><D6B7>ָ<EFBFBD>
|
|
|
|
|
string charsIdentify(Mat, bool, bool);
|
|
|
|
|
string charsIdentify(Mat input);
|
|
|
|
|
|
|
|
|
|
//! <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int classify(Mat, bool, bool);
|
|
|
|
|
int classify(Mat f);
|
|
|
|
|
|
|
|
|
|
//! װ<><D7B0>ANNģ<4E><C4A3>
|
|
|
|
|
void LoadModel();
|
|
|
|
|
|
|
|
|
|
//! װ<><D7B0>ANNģ<4E><C4A3>
|
|
|
|
|
void LoadModel(string s);
|
|
|
|
|
|
|
|
|
|
//! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡģ<C8A1><C4A3>·<EFBFBD><C2B7>
|
|
|
|
|
inline void setModelPath(string path) { m_path = path; }
|
|
|
|
|
inline string getModelPath() const { return m_path; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
//<2F><>ʹ<EFBFBD>õ<EFBFBD>ANNģ<4E><C4A3>
|
|
|
|
|
CvANN_MLP ann;
|
|
|
|
|
|
|
|
|
|
//! ģ<>ʹ洢·<E6B4A2><C2B7>
|
|
|
|
|
string m_path;
|
|
|
|
|
|
|
|
|
|
//! <20><><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD>
|
|
|
|
|
int m_predictSize;
|
|
|
|
|
|
|
|
|
|
//! ʡ<>ݶ<EFBFBD>Ӧmap
|
|
|
|
|
std::map<string, string> m_map;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} /* \namespace easypr */
|
|
|
|
|
|
|
|
|
|
#endif /* endif __CHARS_IDENTIFY_H__ */
|