Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haiqiang-qv opened this issue Apr 18, 2024 · 1 comment
Open

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

haiqiang-qv opened this issue Apr 18, 2024 · 1 comment

Comments

@haiqiang-qv
Copy link

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

问题代码显示

CharsIdentify::CharsIdentify() {
LOAD_ANN_MODEL(ann_, kDefaultAnnPath);//问题:ann_ = ml::ANN_MLP::load(kDefaultAnnPath);
LOAD_ANN_MODEL(annChinese_, kChineseAnnPath);
LOAD_ANN_MODEL(annGray_, kGrayAnnPath);

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

extractFeature = getGrayPlusProject;
}

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

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

@haiqiang-qv
Copy link
Author

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

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::loadml::SVM(path);
#define LOAD_ANN_MODEL(model, path)
model = ml::ANN_MLP::loadml::ANN_MLP(path);
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant