如何转发声明dlib :: frontal_face_detector?

时间:2020-08-17 05:52:07

标签: c++ dlib

我正在尝试转发声明几个dlib类,但是看来我在做什么是错误的。目前,我已经尝试过:

"myheader.h"

namespace dlib 
{
    class frontal_face_detector;
    class shape_predictor;
    class full_object_detection;
}

class MyClass:
{
public: 
    void start();

private:
    void test(dlib::full_object_detection* result);

dlib::fronta_face_detector* detector;
dlib::shape_predictor predictor;
dlib:: full_object_detection result;
};

和在myheader.cpp中:

#include <dlib/image_io.h>
#include <dlib/opencv.h>
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing/render_face_detections.h>
#include "myheader.h"

MyClass::MyClass()
{
    this->detector = new dlib::frontal_face_detector();
    this->predictor = new dlib::shape_predictor();
}
void MyClass:test(dlib::full_object_detection * result)
{
  //...
}

但这显然不起作用,我在这里想念什么?是不是因为它不是定义为类而是定义为typedef?

    typedef object_detector<scan_fhog_pyramid<pyramid_down<6> > > frontal_face_detector;

如果是这样,除了pimpl设置MyClass之外,我还应该怎么做?

0 个答案:

没有答案