【问题标题】:CIDetector iOS 64-bit "No suitable image found"CIDetector iOS 64 位“找不到合适的图像”
【发布时间】:2013-12-14 15:27:34
【问题描述】:

我现在正在开发的应用程序有问题。那里已经有一个类似的问题(Core Image face detection broken on 64 bit iOS?),但它没有涵盖我正在寻找的内容。我有一个使用 CIDetectorTypeFace 的 cocos2d 应用程序,由于以下错误而无法正常工作,

“FaceCore: Throwing runtime error exception: dlopen(/System/Library/PrivateFrameworks/FaceCore.framework/fcl-fc-3.dat, 2): 没有找到合适的图像。确实找到了:/System/Library/PrivateFrameworks/ FaceCore.framework/fcl-fc-3.dat: mach-o, but wrong architecture",

在我的 64 位 iPhone 5s 上。问题是人脸检测与 OpenGL 和 SpriteKit 一起工作,也运行在我的 64 位架构的 iPhone 5s 上。知道发生了什么吗?

- (void)updateTexture:(CMSampleBufferRef)sampleBuffer
{
    imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);


    uint8_t *baseAddress = (uint8_t *)CVPixelBufferGetBaseAddress(imageBuffer);

    width = CVPixelBufferGetWidth(imageBuffer);
    height = CVPixelBufferGetHeight(imageBuffer);

    if(!textureAtlas_.texture) {


       CCTexture2D *texture = [[[CCTexture2D alloc] initWithData:baseAddress
                                                  pixelFormat:kCCTexture2DPixelFormat_RGBA8888
                                                   pixelsWide:width
                                                   pixelsHigh:height
                                                  contentSize:CGSizeMake(width,height)
                             ] autorelease];

    [self setTexture:texture];
    }


    glBindTexture(GL_TEXTURE_2D, self.texture.name);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, baseAddress);

    if(!isProcessingImage) {

        pixelBuffer = (CVPixelBufferRef)CMSampleBufferGetImageBuffer(sampleBuffer);
        currentImage = [CIImage imageWithCVPixelBuffer:pixelBuffer];

        [self performSelectorInBackground:@selector(findFaces) withObject:nil];
    }
}

CIDetector 设置

NSString *accuracy = CIDetectorAccuracyHigh;
NSDictionary *options = [NSDictionary dictionaryWithObject:accuracy  forKey:CIDetectorAccuracy];
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:options];
NSArray *features = [detector featuresInImage:currentImage];

currentImage 是我用于人脸检测部分的图像。

提前致谢!

【问题讨论】:

  • 显示CIDetector 内容的代码在哪里?您是如何设置 AV 捕获的,像素格式是什么?
  • 当您收到错误消息时,发布所有消息。最好的猜测,听起来你正在链接一个不包含 arm64 切片的库。
  • @bbum,是的,没错。但为什么它与我的精灵套件和 opengl 示例一起使用?下次将发布所有错误消息并在明天编辑此消息! Tark,明天可以添加代码,但是 avcapture 和 cidetector 的设置都是 prettt 标准的。感谢两位的回复!
  • @Tark,不知道是否需要为我的 AVCaptureSession 提供设置,但我用于 videoDataOutput 的像素格式是:kCVPixelFormatType_32BGRA。还添加了 CIDetector 设置的代码。再次感谢!

标签: ios iphone objective-c cocos2d-iphone


【解决方案1】:

我继续在网上搜索以寻找答案。确实找到了一个说明该问题将在 iOS 7.1 中解决的问题。我最近安装了 iOS 7.1,现在 CIDetector 工作正常。

【讨论】:

  • 您安装了 7.1 吗?从哪里 ?我认为它还没有发布。
  • 嘿,奥马尔!我注册为苹果开发者,我可以下载 iOS 的 beta 版本!我相信它很快也会发布给其他所有人。
【解决方案2】:

我已经将项目中的架构(点击应用程序->构建设置)更改为“标准架构(包括64位)(armv7,armv7s,arm64)。”,然后它可以工作了。

【讨论】:

  • 感谢您的回复,瑞秋!是的,我也这样做了,但是 iOS 7.0 出现了问题。苹果说他们会在 7.1 中解决这个问题!不过还是谢谢。
【解决方案3】:

经过测试,它可以与 Xcode5.1 beta5 一起使用。

【讨论】:

    猜你喜欢
    • 2017-02-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-23
    • 2018-02-06
    • 2017-09-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多