ios开发,app调用资源文件到C++的方法

为了读取资源文件到cpp。供opencv处理,采取的方式是把之前的cpp文件的后缀改成:.mm

然后会出现各种报错,原因是因为命名冲突,前面加上cv::就行。

  const char* imagePath = [[[NSBundle mainBundle] pathForResource:@"GlassMaterial/eye_brow_mask_03" ofType:@"png"] UTF8String];
      std::string  target_brow_filename(imagePath);
     Mat mask = cv::imread(target_brow_filename, cv::IMREAD_UNCHANGED);
    

 

posted @ 2018-03-22 16:34  Anita-ff  阅读(815)  评论(0编辑  收藏  举报