Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么AVCaptureSessionPresetHigh';这幅画这么暗?_Ios_Cocoa Touch_Video Capture_Avcapturesession_Image Quality - Fatal编程技术网

Ios 为什么AVCaptureSessionPresetHigh';这幅画这么暗?

Ios 为什么AVCaptureSessionPresetHigh';这幅画这么暗?,ios,cocoa-touch,video-capture,avcapturesession,image-quality,Ios,Cocoa Touch,Video Capture,Avcapturesession,Image Quality,玩AVCapureSessions并尝试以不同的方式显示输出CMSampleBufferRef(使用AVCaptureVideoPreviewLayer,显示CGImage,并将其转换为UIImage),我还查看了您可以为自己设置的所有不同质量预设AVCaptureSession。 然后我注意到了它们之间的质量差异 AVCaptureSessionPresetLow AVCaptureSessionPresetMedium和 AVCaptureSessionPresetHigh 不仅是图像的

AVCapureSessions
并尝试以不同的方式显示输出
CMSampleBufferRef
(使用
AVCaptureVideoPreviewLayer
,显示
CGImage
,并将其转换为
UIImage
),我还查看了您可以为自己设置的所有不同质量预设
AVCaptureSession

然后我注意到了它们之间的质量差异

  • AVCaptureSessionPresetLow
  • AVCaptureSessionPresetMedium
  • AVCaptureSessionPresetHigh
不仅是图像的分辨率,还有它们的纵横比,最显著的是整体图像质量。在我的具体案例中,使用
AVCaptureSessionPresetLow/Medium
获得的帧比使用
AVCaptureSessionPresetHigh
获得的帧亮得多。为什么会这样

要设置会话并显示图像,我使用以下代码:

要设置预设值,请执行以下操作:

[self.captureSession setSessionPreset:AVCaptureSessionPresetHigh];
这里有两个
中等
质量的示例:


我向您保证,这两个屏幕截图是在相同的地点、相同的时间和相同的光线条件下拍摄的。

差异是由这些预设的目的造成的。虽然
AVCaptureSessionPresetHigh
基本上用于制作视频,但是
AVCaptureSessionPresetLow/Medium
也可以用于创建照片,因为它们与
AVCaptureSessionPresetPhoto
预设具有相同的行为。您可以尝试默认的照相机应用程序