【发布时间】:2018-02-01 21:42:28
【问题描述】:
我正在开发一个 iOs 应用程序,在该应用程序中我实现了 Dlib 库来获取图像中的面部标志点。下面是我实现的代码。
dlib::frontal_face_detector detector = dlib::get_frontal_face_detector();
dlib::shape_predictor shapePredictor;
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *landmarkdat = [[NSString alloc] initWithFormat:@"%@/%s",
mainBundle.bundlePath,"shape_predictor_68_face_landmarks.dat"];
dlib::deserialize(landmarkdat.UTF8String) >> shapePredictor;
dlib::array2d<dlib::rgb_pixel> img;
dlib::load_image(img,"001.png" );
但是当我在 xcode 8.3 中运行代码时,我得到了error.dlib::image_load_error: Unable to open file
【问题讨论】:
-
确保在导入文件时选中如果需要则复制项目
-
我已将文件复制到项目文件夹中