我下载了面部检测的Dlib示例:http://dlib.net/face_detection_ex.cpp.html
并且只改变了三行,我的库在哪里:
在:
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_io.h>
#include <iostream>
using namespace dlib;
using namespace std;
后:
#include <~/dlib/image_processing/frontal_face_detector.h>
#include <~/dlib/gui_widgets.h>
#include <~/dlib/image_io.h>
#include <iostream>
using namespace dlib;
using namespace std;
但由于某种原因,g++
无法找到它们:
$ g++ face_detection_ex.cpp -o face_detection_ex
face_detection_ex.cpp:40:59: fatal error: ~/dlib/image_processing/frontal_face_detector.h: No such file or directory
#include <~/dlib/image_processing/frontal_face_detector.h>
^
compilation terminated.
尽管所有库都在该文件夹中:
[me]@[me]-Dell-ProBook-6760g:~$ cat ~/dlib/image_processing/frontal_face_detector.h
// Copyright (C) 2013 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_FRONTAL_FACE_DETECTOr_Hh_
#define DLIB_FRONTAL_FACE_DETECTOr_Hh_
#include "frontal_face_detector_abstract.h"
#include "../image_processing/object_detector.h"
#include "../image_processing/scan_fhog_pyramid.h"
#include <sstream>
#include "../compress_stream.h"
#include "../base64.h"
namespace dlib
为什么这不起作用?我在这里做错了什么?