我在使用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
你有什麼發現嗎? –
它肯定不是大小,因爲我嘗試餵食較小的尺寸,但仍然無法使用。 –