我在使用GoogleMobileVision for iOS时遇到了一些问题。iOS版Google移动视觉对源图像大小有任何限制?
随着设置的UIImagePickerController这样
UIImagePickerController* picker = [[UIImagePickerController alloc]init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
[self presentViewController:picker animated:YES completion:^
{
self.faceImageView.layer.sublayers = nil; // drawing and re-drawing some lines...
}];
和检测器:
[super viewDidLoad];
NSDictionary* options = @{
GMVDetectorFaceLandmarkType : @(GMVDetectorFaceLandmarkAll),
GMVDetectorFaceClassificationType : @(GMVDetectorFaceClassificationAll),
GMVDetectorFaceTrackingEnabled : @(NO),
//GMVDetectorFaceMode : @(GMVDetectorFaceAccurateMode) // Accurate mode detects face, but with wrong orientation; Fast mode can't detect faces!
};
self.faceDetector = [GMVDetector detectorOfType:GMVDetectorTypeFace options:options];
但是,如果使用:picker.allowsEditing = YES;
一切完美!
问题:是图像大小的原因?在iPhone 6S尺寸750x750的picker.allowsEditing = YES;
回报图像和1932x2576为picker.allowsEditing
默认值的XCode诉8.1 iPhone 6S的iOS 9.1.1 GoogleMobileVision v 1.0.4
你有什么发现吗? –
它肯定不是大小,因为我尝试喂食较小的尺寸,但仍然无法使用。 –