龙电竞官网有米哪位大佬知道如何在QT Creator中布局opencl

2019-12-22 19:51栏目:龙竞技官网
TAG:

大学老师要求我将opencl代码集成到图形界面中,更好的感受GPU加速效果。查了查发现QT的编译器QTCreator很好上手。。但是网上竟然没什么人这么做过。。仅仅查到两篇文章说在工程文件中加入Include+=“包含路径”Libs+=“库路径”但是代码还是显示无“CL/cl.h”这怎么破。。哪位大佬教教我。。再弄不出来要被老师打死。。

龙电竞官网,简介:

图片的沙盒读存操作主要是增、删、查,一般不涉及改的操作,这里直接以代码演示

在写爬虫的时候总是遇到一些以图片的形式展示的信息,因此要怎么解析图片上的信息呢?在Google上查了一下,需要安装pytesseract和pillow(我用的python3.7)和Tesseract-OCR

常用代码:

  1.  /**
      *  存储缩略图到沙盒中
      */
     + (BOOL)saveImageToPath:(NSString *)imageFilePath image:(UIImage *)image{
         return [UIImageJPEGRepresentation(image, 0.5) writeToFile:imageFilePath  atomically:YES];
     }
    
  2.  /**
      *  删除沙盒里的缩略图
      */
     + (void)deleteImageWithPath:(NSString *)thumbnailPath{
         BOOL isHave = [[NSFileManager defaultManager] fileExistsAtPath:thumbnailPath];
    
         if (!isHave) {
             NSLog(@"no  have");
             return ;
         }else {
             NSError *error;
             BOOL isDeleteFinish = [[NSFileManager defaultManager] removeItemAtPath:thumbnailPath error:&error];
    
             if (!isDeleteFinish) {
                 NSLog(@"delete fail --- %@", error);
             }
         }
     }
    
  3.  UIImage *image = [UIImage imageWithContentsOfFile:thumbnailPath];
    
  4. 获取缩略图路径

     /**
      *  获取缩略图的路径
      */
     + (NSString *)getFilePath{
         NSString *libPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
         NSString *thumbnailPath = [NSString stringWithFormat:@"%@/Caches/AR/ARThumbnail", libPath];
         NSFileManager *fileManager = [NSFileManager defaultManager];
         if (![fileManager fileExistsAtPath:thumbnailPath]) {
             NSError *error;
             [fileManager createDirectoryAtPath:thumbnailPath withIntermediateDirectories:YES attributes:nil error:&error];
             if (error) {
                 NSLog(@"error");
                 return nil;
             }
         }        
         return thumbnailPath;
     }
    
  5. 获取沙盒根目录
    //获取沙盒根目录
    NSString *directory = NSHomeDirectory();
    NSLog(@"directory:%@", directory);

  6. 获取Document路径
    //获取Documents路径
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [paths objectAtIndex:0];
    NSLog(@"path:%@", path);

  7. 获取Library路径

      //获取Library路径
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
      NSString *path = [paths objectAtIndex:0];
      NSLog(@"path:%@", path);
    
  8. 获取tmp路径

      NSString *tmp = NSTemporaryDirectory();
      NSLog(@"tmp:%@", tmp);
    
  9. 获取Caches路径

      //获取Caches路径
      NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
      NSString *path = [paths objectAtIndex:0];
      NSLog(@"path:%@", path);
    
  1. 安装pytesseract

  pip insatll pytesseract

  1. 安装pillow

  pip install pillow

  1. 安装Tesseract-OCR()

  2. 安装完后将Tesseract-OCR的安装路径添加到环境变量中PATH和Path中都要添加

版权声明:本文由龙竞技官网发布于龙竞技官网,转载请注明出处:龙电竞官网有米哪位大佬知道如何在QT Creator中布局opencl