捕获图像时,输出图像的颜色与我在预览图层上看到的颜色不同。出于某种原因,颜色略有变化。有没有人遇到过这个问题?我怎样才能解决这个问题?
当我从 didFinishProcessingPhotoSampleBuffer
获取图像时,绿色有点暗
最佳答案
阅读 AVCapturePhotoOutput 的官方文档我找到了这个:
The AVCapturePhotoOutput class implicitly supports wide-gamut color photography. If the source AVCaptureDevice object’s activeColorSpace value is P3_D65, the capture output produces photos with wide color information (unless your AVCapturePhotoSettings object specifies an output format that does not support wide color).
这也是 activeColorSpace :
By default, a capture session automatically enables wide-gamut capture for supported devices and capture workflows...
所以也许你的设备默认支持它,这就是为什么在输出中你会看到不同颜色的图像。尝试更改
activeColorSpace
看看这是否有所作为。
关于avfoundation - AVCapturePhotoOutput 颜色与预览层不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46574282/