微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

swift – 如何改变AVCaptureSession的亮度,对比度,白平衡,曝光,焦点和清晰度?

我正在快速一个MAC应用程序,我能够在NSView上预览相机现在我想改变亮度/对比度/白平衡和所有相机相关的设置.

我正在使用AVFoundation框架预览相机,我有滑块来更改值,如何更改所有这些设置与用户值.

这个AVFondations如何与IOKit链接..我发现一个UVCCamera控制link更改手动相机控制,我可以使用这种格式???

在另一个网站我发现了

‘IOKit — Low-level framework for communicating with the kernel and
hardware. Apple advises not to use this framework directly and will
reject it from the AppStore.’

谢谢

解决方法

如果要更改已捕获图像的属性,您似乎需要查看与更改图像相关的CIFilter类.见 https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/QuartzCoreFramework/Classes/CIFilter_Class/index.html#//apple_ref/doc/constant_group/Filter_Parameter_Keys,其中提到的内容如下:

  • kCIInputSharpnessKey
    A key for a scalar value (NSNumber) that specifies the amount of sharpening to apply.
  • kCIInputIntensityKey — A key for a scalar value (NSNumber) that specifies an intensity value.
  • kCIInputEVKey — A key for a scalar value (NSNumber) that specifies how many F-stops brighter or darker the image should be.
  • kCIInputBrightnessKey — A key for a scalar value (NSNumber) that specifies a brightness level.

在同一页面上,还有一些指向相关代码示例的链接.

希望这可以帮助您改变想要更改的设置.如果您正在构建用户界面,您可能还需要查看Core Imaging内容,它们具有单独的Core Image Views以添加到您自己的应用程序中.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐