【问题标题】:About dlib::frontal_face_detector optimization关于 dlib::frontal_face_detector 优化
【发布时间】:2017-08-29 06:19:50
【问题描述】:

您好,我正在制作一个检测面部特征的应用程序(68 点)

我在优化系统时遇到了麻烦。我正在使用 HOG 方法检测人脸。

在,detector(cv_grayscale, face_detections, -0.2);输入“dlib::frontal_face_detector&detector”

里面有很多计算。所以,android cpu 无法覆盖它们。

那么,有谁解决了这个问题或相关问题?

bool DetectFacesHOG(vector<cv::Rect_<double> >& o_regions, const cv::Mat_<uchar>& intensity, dlib::frontal_face_detector& detector, std::vector<double>& o_confidences)
{

      double scaling = 1.3;
      cv::Mat_<uchar> upsampled_intensity;
      cv::resize(intensity, upsampled_intensity, cv::Size((int)(intensity.cols*scaling), (int)(intensity.rows*scaling)));

      dlib::cv_image<uchar> cv_grayscale(upsampled_intensity);
      std::vector<dlib::full_detection> face_detections;

      // millions of computation !!!!!!!!!!!!!!!!!!!!!!!!
      detector(cv_grayscale, face_detections, -0.2);
      ....
}

【问题讨论】:

    标签: android optimization android-ndk dlib


    【解决方案1】:

    从here.下载最新的opencv android SDK 它包含大量调试示例。其中之一是人脸检测,它在我的 Xperia-Z5 手机上以 22 帧每秒 的速度检测人脸。最后,如果 opencv 错误导致相机旋转,请使用this 代码。该代码非常清晰,可以为您的相机视图找到最佳帧分辨率。如果您还想要人脸识别,您可以下载 C++ 模块,但您必须使用 NDK(c++)。因为 Android SDK 不会有 face.h 或其他模块。您可以结合从 java 中检测面部并从 c++ 中识别它们。不要担心速度 opencv 会优化它。人脸检测 lpcascade 分类器 xmls 具有高性能。但是,如果您想要更多检测,请使用 haarcascade。

    【讨论】:

      猜你喜欢
      • 2017-12-02
      • 2020-12-04
      • 2017-09-21
      • 2012-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多