iOS:AVFoundation:焦点

标签 ios camera avfoundation autofocus

有没有办法在自动对焦完成后始终获得对焦点?

在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/

相关文章:

iphone - SQLite 或 Core Data 用于只有查询的大型数据库

ios - 我需要知道 firebase 观察何时完全完成

opengl - 无论相机位置如何,都以相同的尺寸渲染 3D 模型

ios - 进行实时 HTTP 流式传输时显示 AVPlayerItem 状态未知

iphone - 使用 AVFoundation 框架 iPhone 进行视频录制?

iphone - 裁剪后的图像在iPhone中放大了吗?

ios - UISearchController 位置错误,因为带有 tableview 插入

java libgdx 移动透视相机

Android 在运行时将按钮放在 surfaceview 上以捕获图像

ios - 在 iOS 上导出视频 : understanding and setting frame duration property?