You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
2.7 KiB
102 lines
2.7 KiB
//////////////////////////////////////////////////////////////////////////
|
|
// Name: CHARACTER Header
|
|
// Version: 1.0
|
|
// Date: 2016-06-14
|
|
// Author: liuruoze
|
|
// Copyright: liuruoze
|
|
// Desciption:
|
|
// An abstract class for car character in plate.
|
|
//////////////////////////////////////////////////////////////////////////
|
|
#ifndef EASYPR_CORE_CHARACTER_H_
|
|
#define EASYPR_CORE_CHARACTER_H_
|
|
|
|
#include "easypr/core/core_func.h"
|
|
|
|
/*! \namespace easypr
|
|
Namespace where all the C++ EasyPR functionality resides
|
|
*/
|
|
namespace easypr {
|
|
|
|
class CCharacter {
|
|
public:
|
|
CCharacter()
|
|
{
|
|
m_characterMat = Mat();
|
|
m_characterPos = Rect();
|
|
m_characterStr = "";
|
|
m_score = 0;
|
|
m_isChinese = false;
|
|
}
|
|
|
|
CCharacter(const CCharacter& other)
|
|
{
|
|
m_characterMat = other.m_characterMat;
|
|
m_characterPos = other.m_characterPos;
|
|
m_characterStr = other.m_characterStr;
|
|
m_score = other.m_score;
|
|
m_isChinese = other.m_isChinese;
|
|
}
|
|
|
|
inline void setCharacterMat(Mat param) { m_characterMat = param; }
|
|
inline Mat getCharacterMat() const { return m_characterMat; }
|
|
|
|
inline void setCharacterPos(Rect param) { m_characterPos = param; }
|
|
inline Rect getCharacterPos() const { return m_characterPos; }
|
|
|
|
inline void setCharacterStr(String param) { m_characterStr = param; }
|
|
inline String getCharacterStr() const { return m_characterStr; }
|
|
|
|
inline void setCharacterScore(double param) { m_score = param; }
|
|
inline double getCharacterScore() const { return m_score; }
|
|
|
|
inline void setIsChinese(bool param) { m_isChinese = param; }
|
|
inline bool getIsChinese() const { return m_isChinese; }
|
|
|
|
//inline void setIsStrong(bool param) { isStrong = param; }
|
|
inline bool getIsStrong() const { return m_score >= 0.9; }
|
|
|
|
//inline void setIsWeak(bool param) { isWeak = param; }
|
|
inline bool getIsWeak() const { return m_score < 0.9 && m_score >= 0.5; }
|
|
|
|
//inline void setIsLittle(bool param) { isLittle = param; }
|
|
inline bool getIsLittle() const { return m_score < 0.5; }
|
|
|
|
bool operator < (const CCharacter& other) const
|
|
{
|
|
return (m_score > other.m_score);
|
|
}
|
|
|
|
bool operator < (const CCharacter& other)
|
|
{
|
|
return (m_score > other.m_score);
|
|
}
|
|
|
|
private:
|
|
//! character mat
|
|
Mat m_characterMat;
|
|
|
|
//! character rect
|
|
Rect m_characterPos;
|
|
|
|
//! character str
|
|
String m_characterStr;
|
|
|
|
//! character likely
|
|
double m_score;
|
|
|
|
//! weather is chinese
|
|
bool m_isChinese;
|
|
|
|
////! m_score >= 0.9
|
|
//bool isStrong;
|
|
|
|
////! m_score < 0.9 && m_score >= 0.5
|
|
//bool isWeak;
|
|
|
|
////! m_score < 0.5
|
|
//bool isLittle;
|
|
};
|
|
|
|
} /*! \namespace easypr*/
|
|
|
|
#endif // EASYPR_CORE_PLATE_H_
|