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

QT整合EasyPR编译错误,cv::ml::SVMImpl不能实例化抽象类,求帮助 #320

Open
gitZGQ518 opened this issue Jun 27, 2021 · 1 comment

Comments

@gitZGQ518
Copy link

I'm submitting a ... (check one with "x")

[ ] bug report
[ x] help wanted
[ ] feature request

Current behavior
Compiling EasyPR in QT project, occur error :

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\memory:1801: error: C2259: “cv::ml::SVMImpl”: 不能实例化抽象类

QT 5.9.0
openCV 4.5.2
OS : win10
Build tool: Desktop QT5.9.0 MSVC2017 64bit

Expected/desired behavior

求各位大侠帮助,非常感谢

Reproduction of the problem

If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce.

What is the expected behavior?

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • System: Windown10

  • Compiler version/IDE: Desktop QT5.9.0 MSVC2017 64bit

  • CMake version: 3.20.2

  • **OpenCV version: 4.5.2

@Prowinter
Copy link

将下面虚函数添加到SVMImp1类public里面。

CV_WRAP virtual bool trainAuto(InputArray samples,
        int layout,
        InputArray responses,
        int kFold = 10,
        Ptr<ParamGrid> Cgrid = SVM::getDefaultGridPtr(SVM::C),
        Ptr<ParamGrid> gammaGrid = SVM::getDefaultGridPtr(SVM::GAMMA),
        Ptr<ParamGrid> pGrid = SVM::getDefaultGridPtr(SVM::P),
        Ptr<ParamGrid> nuGrid = SVM::getDefaultGridPtr(SVM::NU),
        Ptr<ParamGrid> coeffGrid = SVM::getDefaultGridPtr(SVM::COEF),
        Ptr<ParamGrid> degreeGrid = SVM::getDefaultGridPtr(SVM::DEGREE),
        bool balanced = false)
{
    return false;
}
 
CV_WRAP virtual Mat getUncompressedSupportVectors() const
{
    return getSupportVectors();
}

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

2 participants