Reputation: 236
I have trouble with an app that I am developing right now. There's a similar question already out there (Core Image face detection broken on 64 bit iOS?) but it doesn't cover what I'm looking for. I have an cocos2d app using CIDetectorTypeFace which is not working because of the following ERROR,
"FaceCore: Throwing runtime error exception: dlopen(/System/Library/PrivateFrameworks/FaceCore.framework/fcl-fc-3.dat, 2): no suitable image found. Did find: /System/Library/PrivateFrameworks/FaceCore.framework/fcl-fc-3.dat: mach-o, but wrong architecture",
on my 64-bit iPhone 5s. The problem is that face detection is working with OpenGL and SpriteKit also running on my iPhone 5s with 64-bit architecture. Any idea what is going?
- (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 setup
NSString *accuracy = CIDetectorAccuracyHigh;
NSDictionary *options = [NSDictionary dictionaryWithObject:accuracy forKey:CIDetectorAccuracy];
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:nil options:options];
NSArray *features = [detector featuresInImage:currentImage];
And currentImage is the image I'm using for the face detection part.
Thanks in advance!
Upvotes: 0
Views: 1789
Reputation: 237
I've changed the Architectures(click the app ->Build Settings) in project to “Standard Architectures (including 64-bit)(armv7, armv7s, arm64).”, and then it works.
Upvotes: 0
Reputation: 236
I continued my search around the web looking for answers. Did find one stating that the issue would be solved in iOS 7.1. I recently installed iOS 7.1, and now CIDetector is working fine.
Upvotes: 1