AF 对焦分析

开启调试开关:

adb shell setprop debug.af.enable 1
adb shell setprop debug.af_mgr.enable 1
adb shell setprop debug.pd.enable 1
adb shell setprop debug.af.log.enable 1


从目前的log来看,对焦成功时,AE达到stable:
31792 01-01 19:16:09.218180 214 8202 D AfAlgo : [AppVAFC][INIT][fv]220291445 [g]17 [AEStbl]1 [ISO]250==========================
31793 01-01 19:16:09.218241 214 8202 D AfAlgo : [AfAlgo][cnt]28 [6]66098 [5]65994 [4]57094 [3]26114 [2]22521 [1]25519 [0]220291445 [TH]26434973 [StableCnt]0
31796 01-01 19:16:09.218359 214 8202 D af_mgr : [AFStatH]218596445 [AFStatV]565000 [moveMCUTG] 420
31829 01-01 19:16:09.245530 214 8202 D AfAlgo : [AppVAFC][INIT][fv]199159 [g]17 [AEStbl]1 [ISO]250==========================
31830 01-01 19:16:09.245591 214 8202 D AfAlgo : [AfAlgo][cnt]29 [6]65994 [5]57094 [4]26114 [3]22521 [2]25519 [1]220291445 [0]199159 [TH]23899 [StableCnt]0
31833 01-01 19:16:09.245704 214 8202 D af_mgr : [AFStatH]188917 [AFStatV]3414 [moveMCUTG] 420
31879 01-01 19:16:09.285641 214 8202 D AfAlgo : [AppVAFC][INIT][fv]32610 [g]17 [AEStbl]1 [ISO]250==========================
31880 01-01 19:16:09.285704 214 8202 D AfAlgo : [AfAlgo][cnt]30 [6]57094 [5]26114 [4]22521 [3]25519 [2]220291445 [1]199159 [0]32610 [TH]10000 [StableCnt]1
31883 01-01 19:16:09.285819 214 8202 D af_mgr : [AFStatH]29307 [AFStatV]1101 [moveMCUTG] 420
32043 01-01 19:16:09.325923 214 8202 D AfAlgo : [AppVAFC][INIT][fv]2532 [g]17 [AEStbl]1 [ISO]250==========================
32044 01-01 19:16:09.325986 214 8202 D AfAlgo : [AfAlgo][cnt]31 [6]26114 [5]22521 [4]25519 [3]220291445 [2]199159 [1]32610 [0]2532 [TH]10000 [StableCnt]0
32047 01-01 19:16:09.327435 214 8202 D af_mgr : [AFStatH]2400 [AFStatV]44 [moveMCUTG] 420
32167 01-01 19:16:09.376802 214 8202 D AfAlgo : [AppVAFC][INIT][fv]1553 [g]17 [AEStbl]1 [ISO]250==========================
32168 01-01 19:16:09.376870 214 8202 D AfAlgo : [AfAlgo][cnt]32 [6]22521 [5]25519 [4]220291445 [3]199159 [2]32610 [1]2532 [0]1553 [TH]10000 [StableCnt]1
32173 01-01 19:16:09.377002 214 8202 D af_mgr : [AFStatH]1463 [AFStatV]30 [moveMCUTG] 420
32315 01-01 19:16:09.427836 214 8202 D AfAlgo : [AppVAFC][INIT][fv]2980 [g]17 [AEStbl]1 [ISO]250==========================
32316 01-01 19:16:09.427900 214 8202 D AfAlgo : [AfAlgo][cnt]33 [6]25519 [5]220291445 [4]199159 [3]32610 [2]2532 [1]1553 [0]2980 [TH]10000 [StableCnt]2
32319 01-01 19:16:09.428034 214 8202 D af_mgr : [AFStatH]2881 [AFStatV]33 [moveMCUTG] 420
32606 01-01 19:16:09.485943 214 8202 D AfAlgo : [AppVAFC][INIT][fv]5034 [g]17 [AEStbl]1 [ISO]250==========================
32607 01-01 19:16:09.486014 214 8202 D AfAlgo : [AfAlgo][cnt]34 [6]220291445 [5]199159 [4]32610 [3]2532 [2]1553 [1]2980 [0]5034 [TH]10000 [StableCnt]3
32608 01-01 19:16:09.486057 214 8202 D AfAlgo : [AfAlgo]Vlu is Stable


而对焦失败时,AE一直未能stable:
55341 01-01 19:16:19.697523 214 8202 D AfAlgo : [AppVAFC][INIT][fv]12349447 [g]22 [AEStbl]0 [ISO]215==========================
55342 01-01 19:16:19.697585 214 8202 D AfAlgo : [AfAlgo][cnt]26 [6]207898 [5]225428 [4]226395 [3]206595 [2]195496 [1]161509 [0]12349447 [TH]1481933 [StableCnt]0
55345 01-01 19:16:19.697715 214 8202 D af_mgr : [AFStatH]12097012 [AFStatV]84145 [moveMCUTG] 424
55380 01-01 19:16:19.736650 214 8202 D AfAlgo : [AppVAFC][INIT][fv]4736640 [g]22 [AEStbl]0 [ISO]215==========================
55381 01-01 19:16:19.736778 214 8202 D AfAlgo : [AfAlgo][cnt]27 [6]225428 [5]226395 [4]206595 [3]195496 [2]161509 [1]12349447 [0]4736640 [TH]568396 [StableCnt]0
55384 01-01 19:16:19.737036 214 8202 D af_mgr : [AFStatH]4024314 [AFStatV]237442 [moveMCUTG] 424
55430 01-01 19:16:19.786623 214 8202 D AfAlgo : [AppVAFC][INIT][fv]462356 [g]22 [AEStbl]0 [ISO]215==========================
55431 01-01 19:16:19.786750 214 8202 D AfAlgo : [AfAlgo][cnt]28 [6]226395 [5]206595 [4]195496 [3]161509 [2]12349447 [1]4736640 [0]462356 [TH]55482 [StableCnt]0
55434 01-01 19:16:19.786997 214 8202 D af_mgr : [AFStatH]402137 [AFStatV]20073 [moveMCUTG] 424
55559 01-01 19:16:19.837463 214 8202 D AfAlgo : [AppVAFC][INIT][fv]99976 [g]22 [AEStbl]0 [ISO]215==========================
55560 01-01 19:16:19.837594 214 8202 D AfAlgo : [AfAlgo][cnt]29 [6]206595 [5]195496 [4]161509 [3]12349447 [2]4736640 [1]462356 [0]99976 [TH]11997 [StableCnt]0
55565 01-01 19:16:19.837839 214 8202 D af_mgr : [AFStatH]88153 [AFStatV]3941 [moveMCUTG] 424
55770 01-01 19:16:19.939312 214 8202 D AfAlgo : [AppVAFC][INIT][fv]102548 [g]22 [AEStbl]0 [ISO]215==========================
55771 01-01 19:16:19.939375 214 8202 D AfAlgo : [AfAlgo][cnt]30 [6]195496 [5]161509 [4]12349447 [3]4736640 [2]462356 [1]99976 [0]102548 [TH]12305 [StableCnt]0

C、AF相关log如下:
1、类似如下log表示发送AFUpdate消息:
aaa_hal : [Hal3A::AFThreadFunc] AF waitIrq done
aaa_hal : [Hal3A::AFThreadFunc] StateMgr::sendCmd(ECmd_AFUpdate) done

2、在Preview界面,在aaa_state_camera_preview.cpp的StateCameraPreview::sendIntent(intent2type<eIntent_AFUpdate>)中,会执行setAE2AFInfo将AE信息更新给AFAlgo,然后调用doAF进行对焦:
IAfMgr::getInstance().setAE2AFInfo(m_pHal3A->getSensorDev(), rAEInfo);
IAfMgr::getInstance().doAF(m_pHal3A->getSensorDev(), reinterpret_cast<MVOID *>(rBufInfo.virtAddr));

3、在Video界面,在aaa_state_camcorder_preview.cpp的StateCamcorderPreview::sendIntent(intent2type<eIntent_AFUpdate>)中,仅执行doAF的操作:
IAfMgr::getInstance().doAF(m_pHal3A->getSensorDev(), reinterpret_cast<MVOID *>(rBufInfo.virtAddr));

4、由于StateCamcorderPreview::sendIntent(intent2type<eIntent_AFUpdate>)不会更新AE info给AFAlgo,导致AFAlgo得不到AE stable为1的结果,因此不能实现FV stable。

5、目前的修改是在StateCamcorderPreview::sendIntent(intent2type<eIntent_AFUpdate>)中更新AE info给AFAlgo,实现FV stable,最终对焦成功。



  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
1) Basic concepts of Auto Focus Algorithm 1.1) AF Detection methods There are two focus detection (AF) methods. 1) Distance detection method. 2) Contrast detection method. 1.1.1) Distance detection method The distance detection method is that the camera use AF module for detecting distance for main objects. If the camera is used this AF method, it will not need to use CCD to detect object’s contrast. There are three types of AF modules. 1. Active AF module 2. Passive AF module 3. TTL AF module 1.1.1.1) Active AF module Active AF systems measure distance to the subject independently of the optical system, and subsequently adjust the optical system for correct focus. There are various ways to measure distance, including ultrasonic sound waves and infrared light. In the first case, sound waves are emitted from the camera, and by measuring the delay in their reflection, distance to the subject is calculated. Polaroid cameras were known for successfully applying this system. In the latter case, infrared light is usually used to triangulate the distance to the subject. An exception to the two-step approach is the mechanical autofocus provided in some enlargers, which adjust the lens directly. 1.1.1.2) Passive AF module Passive AF systems determine correct focus by performing passive analysis of the image that is entering the optical system. They generally do not direct any energy, such as ultrasonic sound or infrared light waves, toward the subject. (However, an autofocus assist beam of usually infrared light is required when there is not enough light to take passive measurements.) Passive autofocusing can be achieved by phase detection or contrast measurement.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值