liuruoze / EasyPR

(CGCSTCD'2017) An easy, flexible, and accurate plate recognition project for Chinese licenses in unconstrained situations. CGCSTCD = China Graduate Contest on Smart-city Technology and Creative Design
Apache License 2.0
6.36k stars 2.51k forks source link

未能找到重载函数匹配,求助各位大佬 #332

Open haiqiang-qv opened 7 months ago

haiqiang-qv commented 7 months ago

编译报错: 严重性 代码 说明 项目 文件 行 禁止显示状态 详细信息 错误 C2672 “cv::Algorithm::load”: 未找到匹配的重载函数 libeasypr C:\Users\Codegod、\Desktop\EasyPR-master\EasyPR-master\src\core\chars_identify.cpp 22

问题代码显示

CharsIdentify::CharsIdentify() { LOAD_ANNMODEL(ann, kDefaultAnnPath);//问题:ann_ = ml::ANN_MLP::load(kDefaultAnnPath); LOAD_ANNMODEL(annChinese, kChineseAnnPath); LOAD_ANNMODEL(annGray, kGrayAnnPath);

kv_ = std::sharedptr(new Kv); kv->load(kChineseMappingPath);

extractFeature = getGrayPlusProject; }

void CharsIdentify::LoadModel(std::string path) { if (path != std::string(kDefaultAnnPath)) { if (!ann->empty()) ann->clear(); LOAD_ANNMODEL(ann, path); } }

void CharsIdentify::LoadChineseModel(std::string path) { if (path != std::string(kChineseAnnPath)) { if (!annChinese->empty()) annChinese->clear(); LOAD_ANNMODEL(annChinese, path); } }

haiqiang-qv commented 7 months ago

问题已解决:发布出来,给大家点信心。

Problem solved: Publish it, give everyone some confidence.

在libeasypr项目中,找到头文件中的easypr文件夹,找到config.h文件。 In the libeasypr project, locate the easypr folder in the header file and locate the config.h file.

//#ifdef CV_VERSION_THREE_TWO,做出下面的修改,解决未找到匹配的重载函数问题 //直接将#ifdef CV_VERSION_THREE_TWO替换成#if ((CV_MAJOR_VERSION > 3) || (CV_MAJOR_VERSION==3 && //CV_MINOR_VERSION>=2))

//#ifdef CV_VERSION_THREE_TWO, make the following changes to solve the problem of not finding a matching overloaded //function // Replace #ifdef CV_VERSION_THREE_TWO with #if ((CV_MAJOR_VERSION > 3) || (CV_MAJOR_VERSION==3 && //CV_MINOR_VERSION>=2))

if ((CV_MAJOR_VERSION > 3) || (CV_MAJOR_VERSION==3 && CV_MINOR_VERSION>=2))

define LOAD_SVM_MODEL(model, path) \

model = ml::SVM::load(path);

define LOAD_ANN_MODEL(model, path) \

model = ml::ANN_MLP::load(path);

else

define LOAD_SVM_MODEL(model, path) \

model = ml::SVM::load<ml::SVM>(path);

define LOAD_ANN_MODEL(model, path) \

model = ml::ANN_MLP::load<ml::ANN_MLP>(path);

endif