5、相机的其它参数设置

- //AVCaptureFlashMode 闪光灯
- //AVCaptureFocusMode 对焦
- //AVCaptureExposureMode 曝光
- //AVCaptureWhiteBalanceMode 白平衡
- //闪光灯和白平衡可以在生成相机时候设置
- //曝光要根据对焦点的光线状况而决定,所以和对焦一块写
- //point为点击的位置
- - (void)focusAtPoint:(CGPoint)point{
- CGSize size = self.view.bounds.size;
- CGPoint focusPoint = CGPointMake( point.y /size.height ,1-point.x/size.width );
- NSError *error;
- if ([self.device lockForConfiguration:&error]) {
- //对焦模式和对焦点
- if ([self.device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
- [self.device setFocusPointOfInterest:focusPoint];
- [self.device setFocusMode:AVCaptureFocusModeAutoFocus];
- }
- //曝光模式和曝光点
- if ([self.device isExposureModeSupported:AVCaptureExposureModeAutoExpose ]) {
- [self.device setExposurePointOfInterest:focusPoint];
- [self.device setExposureMode:AVCaptureExposureModeAutoExpose];
- }
- [self.device unlockForConfiguration];
- //设置对焦
- _focusView.center = point;
- _focusView.hidden = NO;
- [UIView animateWithDuration:0.3 animations:^{
- _focusView.transform = CGAffineTransformMakeScale(1.25, 1.25);
- }completion:^(BOOL finished) {
- [UIView animateWithDuration:0.5 animations:^{
- _focusView.transform = CGAffineTransformIdentity;
- } completion:^(BOOL finished) {
- _focusView.hidden = YES;
- }];
- }];
- }
- }
6、遇到的一些坑和解决办法
1) 前后置的切换
前后值不能切换,各种尝试找了半天没找到有原因。后来发现我在设置图片尺寸的时候设置为1080P [self.session canSetSessionPreset: AVCaptureSessionPreset1920x1080] ,前置并不支持这么大的尺寸,所以就不能切换前置。我验证了下 前置最高支持720P,720P以内可自由切换。ios 切换
当然也可以在前后置切换的时候,根据前后来设置不同的尺寸,这里不在赘述。ios 切换

2)焦点位置
rectangle(image, point(rect.x, rect.y), point(rect.x + rect.width, rect.y + rect.height ), green, 2)。07 point p2 = new point(bounds.x + bounds.width, bounds.y + bounds.height)。rec.view.center=cgpointmake(rec.view.center.x+point.x,rec.view.center.y+point.y)。
1)盘左(正镜)观测 瞄m,记录 m左= 0°00′36″瞄n,记录 n左= 68°42′48″上半测回的角值:β左= n左- m左= 68°42′12″ ②盘右(倒镜)观测 瞄n, 记录 n右= 248°42′30″瞄m, 记录 m右= 180°00′24″下半测回角值:β右= n右- m右= 68°42′06″ ④一测回角值 ③检核 对于dj6经纬仪,上下半测回角度之差应满足:否则,应重测。前轮最大转向角左/右49°,前轮最大倾斜角左/右17°,前桥最大摆动角上/下15°,平衡箱最大摆动角前/后15°,车架最大转向角左/右27°,最小转弯半径12.4m。 以上两步称盘右半测回或下半测回 2、记录与计算(见表3.1) ①盘左(正镜)观测 瞄a,记录 a左= 0°00′36″ 瞄b,记录 b左= 68°42′48″ 上半测回的角值: β左= b左- a左= 68°42′12″ ②盘右(倒镜)观测 瞄b, 记录 b右= 248°42′30″ 瞄a, 记录 a右= 180°00′24″ 下半测回角值: β右= b右- a右= 68°42′06″ ④一测回角值 ③检核 对于dj6经纬仪,上下半测回角度之差应满足: ,否则,应重测。
The value of this property is a CGPoint that determines the receiver's focus point of interest, if it has one. A value of (0,0) indicates that the camera should focus on the top left corner of the image, while a value of (1,1) indicates that it should focus on the bottom right. The default value is (0.5,0.5).
我也试了按这个来但位置就是不对,只能按上面的写法才可以。前面是点击位置的y/PreviewLayer的高度,后面是1-点击位置的x/PreviewLayer的宽度

3)对焦和曝光
af-s是单次自动对焦,采用这种对焦模式进行对焦时,只要对焦完成了就会自动锁定焦平面位置。详实讲授了相机的外观结构,播放菜单、拍摄菜单、自定义设定菜单、设定菜单、修饰菜单、我的菜单等的设置方法,和全自动拍摄模式、场景模式、高级拍摄模式、对焦模式、测光模式、光圈、自平衡、感光度、快门速度、晖光补偿、暴光锁定、对焦锁定等实拍设置技能。详尽讲解了相机的外观结构,播放菜单、拍摄菜单、自定义设定菜单、设定菜单、润饰菜单、我的菜单等的设置方法,以及全自动拍摄模式、场景模式、高级拍摄模式、对焦模式、测光模式、光圈、自平衡、感光度、快门速度、晖光补偿、曝光锁定、对焦锁定等实拍设置技巧。
曝光同上
7、写在最后
附上demo:https://github.com/nanshanyi/photographDemo
常用到的基本就这么多,写的并不完善,有什么不对的,欢迎大家批评指正,共同学习。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-97820-2.html
就是经济下滑加快
说明美帝也是不想事件升级
全中国人民都坚持