有没有办法在自动对焦完成后始终获得对焦点?
在Apple的示例代码中,他们使用:
- (void)subjectAreaDidChange:(NSNotification *)notification
{
CGPoint devicePoint = CGPointMake(.5, .5);
[self focusWithMode:AVCaptureFocusModeContinuousAutoFocus exposeWithMode:AVCaptureExposureModeContinuousAutoExposure atDevicePoint:devicePoint monitorSubjectAreaChange:NO];
}
上面的代码仅适用于“点击聚焦”。它还强制相机聚焦在屏幕中央。我想在自动对焦完成后随时获得对焦点。
最佳答案
看起来你可以直接阅读focusPointOfInterest
属性来获取当前焦点:
- (void)subjectAreaDidChange:(NSNotification *)notification
{
CGPoint devicePoint = device.focusPointOfInterest;
}
关于iOS:AVFoundation:焦点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25690549/