Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/143.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在dlib正面人脸检测器中分离级联电平?_C++_Dlib - Fatal编程技术网

C++ 如何在dlib正面人脸检测器中分离级联电平?

C++ 如何在dlib正面人脸检测器中分离级联电平?,c++,dlib,C++,Dlib,后续行动: 我正在尝试将dlib正面人脸检测器中的五级级联分解为三级(前、前视但向左旋转,前视但向右旋转) 建议在C++中分割检测器。我不熟悉C++。当我查看时,get_serialized_frontial_faces返回一个base64编码的对象 我学习了如何将现有检测器保存到.svm文件中: #包括 #包括 使用名称空间dlib; 使用名称空间std; int main() { 正面探测器=获取正面探测器(); dlib::serialize(“new_detector.svm”)只

后续行动:

我正在尝试将dlib正面人脸检测器中的五级级联分解为三级(前、前视但向左旋转,前视但向右旋转)

建议在C++中分割检测器。我不熟悉C++。当我查看时,

get_serialized_frontial_faces
返回一个base64编码的对象

我学习了如何将现有检测器保存到
.svm
文件中:

#包括
#包括
使用名称空间dlib;
使用名称空间std;
int main()
{   
正面探测器=获取正面探测器();
dlib::serialize(“new_detector.svm”)只要阅读,您就会找到解释。
以下代码将探测器拆分为多个部分,重建原始图像并限制金字塔级别:

#include <dlib/image_processing/frontal_face_detector.h>
#include <iostream>
#include <string>

using namespace dlib;
using namespace std;

int main()
{   
    frontal_face_detector detector = get_frontal_face_detector(); 

    dlib::serialize("current.svm") << detector;

    std::vector<frontal_face_detector> parts;
    // Split into parts and serialize to disk
    for (unsigned long i = 0; i < detector.num_detectors(); ++i)
    {
        dlib::frontal_face_detector part(detector.get_scanner(), detector.get_overlap_tester(), detector.get_w(i));
        dlib::serialize("part" + std::to_string(i) + ".svm") << part;
        parts.push_back(part);
    }

    // Reconstruct original detector
    frontal_face_detector reconstructed(parts);
    dlib::serialize("reconstructed.svm") << reconstructed;

    // Create detector that will work only on one level of pyramid
    typedef dlib::scan_fhog_pyramid<dlib::pyramid_down<6> > image_scanner_type;
    image_scanner_type scanner;
    scanner.copy_configuration(detector.get_scanner());
    scanner.set_max_pyramid_levels(1); //try setting to 2, 3...
    frontal_face_detector one_level_detector = dlib::object_detector<image_scanner_type>(scanner, detector.get_overlap_tester(), detector.get_w());

    std::cout<<"End of the Program"<<endl;
    return 0;   
}
#包括
#包括
#包括
使用名称空间dlib;
使用名称空间std;
int main()
{   
正面探测器=获取正面探测器();

dlib::序列化(“current.svm”)谢谢。这很有效。如果我错了,请纠正我:1.根据这一点,第0部分是前视的,第2部分是左视的,第3部分是右视的,依此类推。2.如果我只想左视和右视,我需要将第1部分和第2部分推回到零件向量并重建它。另外,默认正面fac中的最大棱锥层次是多少e探测器?对我来说,设置的最大金字塔等级(8)是有效的,而且相对而言。@vijayenthiransubramaniam,我记得,它是无限的(1000左右)