这是禁用焦点的方法,它一直锁定它:
// Find a suitable capture device
AVCaptureDevice *cameraDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
// SETUP FOCUS MODE
if ([cameraDevice lockForConfiguration:nil]) {
[cameraDevice setFocusMode:AVCaptureFocusModeLocked];
[cameraDevice unlockForConfiguration];
}
else{
NSLog(@"error while configuring focusMode");
}
Run Code Online (Sandbox Code Playgroud)
你是什么意思"将焦点锁定在无穷大"?
小智 6
可悲的是没有.Artem说,你可以将相机设置为锁相模式.进入自动对焦模式(对焦,然后锁定)或连续自动对焦模式,但无法为相机指定特定的对焦距离.
我已经能够拿出最好的(曝光和白平衡控制,这是类似的限制)是让用户将相机对准合适的场景(在你的情况,事情远),让他/她按下锁定按钮.
在捕获设备API的细节,比如它是: https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html
| 归档时间: |
|
| 查看次数: |
9665 次 |
| 最近记录: |