找回密码
 注册
搜索
查看: 3546|回复: 15

[讨论] 如何实现 AF 的控制功能

[复制链接]
发表于 2006-9-28 12:47:00 | 显示全部楼层 |阅读模式
现在有些高端手机具有AF的功能,除了CAMERA MODULE 要有VCM 或STEPPER之外, 在基带或图象处理芯片要有AF的控制功能,原理是根据物体的反光在IMAGE SENSOR上呈现的亮度来调整VCM或STEPPER。但实际它是硬件IC算法,还是软件就行? 请问它是如何实现的?SENSOR这端要做那些配合?
发表于 2006-9-28 13:04:00 | 显示全部楼层
这个问题,三言两语似乎说不完,目前数码相机有普通DC,是用通过镜头成像实现的,也就是根据镜头的实际成像判断是否正确结焦,判断的依据一般是反差检测式,具体原理相当复杂。我也不清楚算法。大致就是根据不同的距离去成象,在比较,在取一个合适的距离点![br]<p align=right><font color=red>+3 RD币</font></p>
点评回复

使用道具 举报

发表于 2006-9-29 10:35:00 | 显示全部楼层
是否类似计算MTF值, 来判断解析度, 也就是判断图像的对比度啊, 我也想了解啊
点评回复

使用道具 举报

发表于 2006-10-8 10:41:00 | 显示全部楼层
我也很希望了解这方面的知识。
点评回复

使用道具 举报

发表于 2006-10-16 15:54:00 | 显示全部楼层
是有一定的算法的,通过firmware来控制的。如果你做camera开发,可以咨询FAE。这个方面他们应该是保密的。咱们做软件的看不懂!!!
[br]<p align=right><font color=red>+1 RD币</font></p>
点评回复

使用道具 举报

 楼主| 发表于 2006-10-18 16:05:00 | 显示全部楼层
如果失去焦点,AF是如何控制LENS前移还是后移?
点评回复

使用道具 举报

发表于 2006-10-31 23:38:00 | 显示全部楼层
具体是通过软件计算图片的MTF来实现清晰与否的判断的。但是驱动镜头的移动需要硬件的Driver IC实现(GPIO那一点电流是不可能驱动线圈运动的)。下面稍微解释一下过程(只是简单的示意,事实上其间有很多动作要做的)。
如果刚开始启动AF,或者失去焦点后重新对焦,它就会给镜头定义一个方向进行运动(比如先后退)。如果越后退越模糊,那就开始往前运动,而且边前进边比较清晰度,等经过最清晰的顶峰的时候(黑圆点的位置,其实模组自己并不知道此时就是登峰造极了),镜头还在继续往前进,这时候画面就会得越来越模糊。模糊一定程度时停下来(黑正方形点,第60步)准备再后退,经过比较,就可以得出最清晰的一个点,并计算出是在这之前的第N步(第40步)是最清晰的位置,然后后退20步到达最清晰点。至此,AF结束。
[upload=jpg]UploadFile/2006-10/061031@52RD_AF_process.JPG[/upload][br]<p align=right><font color=red>+5 RD币</font></p>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
点评回复

使用道具 举报

发表于 2006-11-4 20:12:00 | 显示全部楼层
请假GPIO是什么??
点评回复

使用道具 举报

发表于 2006-11-6 08:42:00 | 显示全部楼层
General Purpose Input Output
点评回复

使用道具 举报

发表于 2008-12-7 16:12:00 | 显示全部楼层
[em13][em14]
点评回复

使用道具 举报

发表于 2008-12-8 08:57:00 | 显示全部楼层
[em06]
点评回复

使用道具 举报

发表于 2008-12-8 08:58:00 | 显示全部楼层
[em08]
点评回复

使用道具 举报

发表于 2008-12-8 09:07:00 | 显示全部楼层
[em08]
点评回复

使用道具 举报

发表于 2008-12-12 18:38:00 | 显示全部楼层
Algorithm:
The auto focus algorithm implemented in the sensor firmware seeks to maximize
sharpness of vertical lines in images output by the sensor, by guiding an external lens
actuator to the position of best lens focus. The algorithm is actuator-independent,
providing guidance by means of an abstract 1-dimensional position variable, leaving the
translation of its changes into physical lens movements to a separate AF mechanics
(AFM) driver.
For measuring line sharpness, the AF algorithm relies on focus measurement engine in
the color pipeline, which is a programmable vertical-edge-filtering module. The module
convolves two preprogrammed 1-dimensional digital filters with luminance (Y) data it
receives row by row from the color interpolation module. In every interpolated image,
the pixels whose Y values are used in the convolution form a rectangular block that can
be arbitrarily positioned and sized, and in addition divided into up to 16 equal-size subblocks,
referred to as AF windows or zones. The absolute values of convolution results
are summed separately for each filter over each of the AF windows, yielding up to 32
sums per frame.
There are several motion sequences through which the MT9D112 AF algorithm can
bring a lens to best focus position. All these sequences begin with a jump to a preselected
start position, for example, the infinity focus position. This jump is referred to asthe first flyback. It is followed by a unidirectional series of steps that puts the lens at up
to 19 preselected positions different from the start position. This series of steps is called
the first scan.
During the scan, the AF algorithm stops the lens at each preselected position long
enough to obtain valid sharpness scores. The normalized score for each AF window is
stored along with information on how many zones had a high sharpness score and the
position with the maximum sharpness score is determined taking into account the zone
information. This way the algorithm can handle scenes with objects at different
distances.
After the first scan, the AF algorithm provides a number of ways to proceed with final
lens positioning. The user should select a way that best fits the magnitude of lens actuator
hysteresis and desired lens proximity to the truly optimal position. Actuators with
large, unknown or variable hysteresis should do a second flyback and either jump or
retrace the steps of the first scan to the best scanned position. Actuators with constant
hysteresis (like stepper motors) can be moved to that position directly from the end
position of the scan-the AF algorithm offers an option to automatically increase the
length of this move by a preprogrammed backlash-compensating step. Finally, if the first
scan is coarse relative to the positioning precision of the lens actuator and depth of field
of the lens, an optional second fine scan can be performed around the lens position
voted best after the first scan. This second scan is done in the same way as the first,
except that the positions it covers are not preselected. Instead, the AF algorithm user
must set step size and number of steps for the second scan. The second scan must be
followed by the same hysteresis-matching motion sequence as the first scan, for
example, a third flyback and jump to the best position.
The AF driver is disabled on power-up. If AF is desired, it must be explicitly enabled after
every power up or reset before it can be used. This can be accomplished by:
Establish AF motor type
&#8226; set afm.type (0x002) = 129 (for helimorph AF)
afm.type (0x002) = 130 (for stepper motor AF)
afm.type (0x002) = 131 (for AD5398)
&#8226; turn on AF in preview mode seq.previewPar.af=1
&#8226; call "refresh" sequencer command seq.cmd=5
点评回复

使用道具 举报

发表于 2008-12-13 09:51:00 | 显示全部楼层
曾经这样做过这样一个算法并做过DEMO:求相邻像素亮度差的积分和,驱动镜头对焦,如果愈接近理想的焦点,那这个积分值愈高。
点评回复

使用道具 举报

发表于 2011-10-14 11:59:00 | 显示全部楼层
我有针对OV2640写过一个AF DEMO,准确率99.6%
现在高像素的sensor都内置AF功能了
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-1-26 14:36 , Processed in 0.049076 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表