#include <dlib/image_processing.h>
#include <dlib/image_io.h>
#include <dlib/array2d.h>
#include <iostream>
using namespace dlib;
- (void)loadDlibImage{
NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"si" ofType:@"jpg"];
array2d<rgb_pixel> img;
std::string fileName =[imagePath UTF8String];
load_image(img,fileName);
NSArray *docPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsPath = [docPath objectAtIndex:0];
documentsPath = [documentsPath stringByAppendingPathComponent:@"test.png"];
const char *savePath = [documentsPath UTF8String];
save_jpeg(img, savePath);
}