を使用CIDetector
して画像内の顔を検出するには、ドキュメントに従ってTIFFおよびEXIF仕様で指定されている画像の向きを指定する必要があります。これは、とは異なることを意味しUIImageOrientation
ます。グーグルは私のために以下の機能を見つけました、私はそれを試しましたが、それが間違っているように見えるか、または時々方向がずれているので、私はおそらく何か他のものを逃しました。誰が何が起こっているのか知っていますか?写真がiDeviceからエクスポートされ、次に別のiDeviceにインポートされるとすぐに、向きの情報が失われたり変更されたりするため、向きの不一致が発生するようです。
- (int) metadataOrientationForUIImageOrientation:(UIImageOrientation)orientation
{
switch (orientation) {
case UIImageOrientationUp: // the picture was taken with the home button is placed right
return 1;
case UIImageOrientationRight: // bottom (portrait)
return 6;
case UIImageOrientationDown: // left
return 3;
case UIImageOrientationLeft: // top
return 8;
default:
return 1;
}
}