gpt4 book ai didi

iOS:AVFoundation:焦点

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:03:57 28 4
gpt4 key购买 nike

有没有办法在自动对焦完成后随时获取对焦点?

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

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com