Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 3.1 KB

File metadata and controls

71 lines (59 loc) · 3.1 KB

Class PlateJudge

Properties

Functions


static PlateJudge* instance_

  • 静态变量instance_,用于单例模式

static PlateJudge* instance()

  • 单例模式初始化方法,当instance_nullptr时,初始化一个PlateJudge
  • 返回instance_

PlateJudge()

  • 加载svm的模型,在config.h中配置模型路径
  • 可选择是否使用LBP模型,因为暂时没有这个模型,所以使用的是Hist

void LoadModel(std::string path)

  • 输入参数为路径path
  • 如果path与默认kDefaultSvmPath路径不同,则加载path下的模型,如果相同,那么加载的模型和kDefaultSvmPath路径下的相同

int plateSetScore(CPlate& plate)

  • 这个函数通过SVM为输入的CPlate计算分数,小于0且越小为车牌的可能性越大
  • 方法判定score大于0.5CPlate为不是车牌
  • 返回值为0表示是车牌,返回值为-1表示不是车牌

int plateJudge(const Mat& plateMat)

  • 调用plateSetScore得到0/-1并返回,0代表是车牌,1表示不是车牌

int plateJudge(const std::vector &inVec,std::vector &resultVec)

  • 输入为Mat的集合inVec,代表了需要判断的Mat的集合
  • 输出为resultVec,代表了所有可能是车牌的集合
  • return 0

int plateJudge(const std::vector &inVec,std::vector &resultVec)

  • 输入为CPlate的集合inVec,代表了需要判断的CPlate的集合
  • 输出为resultVec,代表了所有可能是车牌的集合
  • int plateJudge(const std::vector<Mat> &inVec,std::vector<Mat> &resultVec)不同的是,在这个方法中会进行一次矩形的缩小再判断
  • return 0

void NMS(std::vector &inVec, std::vector &resultVec, double overlap)

int PlateJudge::plateJudgeUsingNMS(const std::vector &inVec, std::vector &resultVec, int maxPlates)