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

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

Open gitZGQ518 opened 3 years ago

gitZGQ518 commented 3 years ago

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:

Prowinter commented 2 years ago

将下面虚函数添加到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();
}