-
在某镜面偏心测量设备测量头设计工作中,根据其光学设计以及自动调焦的时间要求,文中首先分析其光学函数变化曲线,然后根据光学变化曲线采用变步长两段式聚焦控制方式。并且采用以图像空间域梯度值作为图像清晰度的评价标准,根据图像清晰度评价结果对调焦机构进行控制,实现了研制目标。
-
为了满足设备测量需求,设计可自动调焦的光学镜头,其光学参数如表1所示。
Parameter Value Wave band/μm 7-15 Focal distance/mm 20-100 Rear intercept/mm 15.41 Incoming pupil diameter/mm 20-100 F/# 1.5 Imaging range/m 0.5- +∞ Transfer function > 0.2 Alignment plane +∞ Focusing rang/mm −25- +30 Table 1. Optical design parameters
光路图如图3 所示,通过驱动电机的控制,调教组镜片沿着光轴方向运动,调焦行程−25-30 mm,通过变倍和补偿组的配合运动,能够成像焦距达到0.5 m-+∞。图中,1为前固定组,2为变倍组,3为补偿组,4为后固定组,5为调焦组,6为CCD窗口,7为像面。
从理想清晰度评价曲线和光学传递函数变化曲线中可以看出它们具有相同的变化规律,具有单峰性和峰值两侧具有单调性,并且十字丝图像需要提取十字丝中心位置,只有调焦位置最佳才能提高十字丝中心提取的准确度。为了快速找到正焦位置范围以及最佳调焦位置,文中根据光学设计分析采用粗调和精细调焦相结合的快速搜索方式,首先利用粗调方式大步长找到最佳调焦位置附近,然后利用精调方式找到最佳调焦位置,这样既保证调焦速度,又能保证调焦精度,精准找到最佳调焦位置。
-
根据清晰度评价曲线和光学传函数递变化曲线,需要采用与之相匹配的搜索策略,为了提高搜索速度和准确度,文中采用变步长搜索策略。与传统爬山搜索方式相比,首先变步长搜索方式用大步长快速搜索到调焦目标附近,然后采用小步长精细搜索目标,防止错过目标。爬山搜索方式采用大步长搜索会错失调焦准确位置,采用小步长搜索速度不仅慢,而且在离焦状态下受到的环境噪声和光路噪声影响较大,不易聚焦。所以文中选用变步长搜索方式。具体实现步骤如下:
(1)首先,调焦系统起始位置位于离焦点 P ,设定调焦大步长为D(D>调焦精度),记录当前位置图像的调焦评价函数F;
(2)根据步骤(1)的位置P向前以步长D进行运行,获取两步的调焦函数F1、F2;
(3)如果不满足F<F1,F1>F2, 则沿着步长D继续运行,F、F1、F2分别为最后3个位置的调焦函数;
(4)如果满足F<F1,F1>F2,则调焦系统返回到调焦函数F的位置,以步长d(D>d)向前运行,直到满足F<F1,F1>F2,返回到调焦函数F1的位置P2;
(5) P1
的位置为正调焦位置,自动调焦结束。 -
为了验证文中4个方向Sobel算子梯度加权后的检测效果,文中在偏心测量设备上进行检测实验,使用自适应变步长两段式搜索策略与其他算法进行对比实验,归一化后图像清晰度评价曲线对比图见图4。
通过自动调焦系统,利用改进Sobel算子梯度加权的Tenengrad 评价函数与经典Sobel算子的Tenengrad 评价函数、Roberts评价函数、Laplacian评价函数、Prewitt评价函数、Canny评价函数和Log评价函数分别进行边缘检测和调焦控制,从边缘检测图像图5可以看出:文中算法进行边缘检测得到的边缘图像信息保留得最好,并在相同的离焦位置进行自动调焦,绘制出它们的图像清晰度评价函数曲线图,分别进行50次自动调焦实验,发现文中算法平均调焦时间是1 242 ms,自动调焦失败率是2%。通过绘制的图像清晰度评价函数曲线对比图和表2可知改进后的算法调焦位置更加准确,速度也更快,效果更好。
Algorithm Focusing time/ms Failure rate Proposed 1242 2% Roberts 1381 12% Laplacian 1410 10% Sobel 1332 8% Prewitt 1266 10% Canny 1120 12% Log 1258 8% Table 2. Algorithm comparison results
Image sharpness evaluation and variable-step fusion focusing method
doi: 10.3788/IRLA20220342
- Received Date: 2022-05-18
- Rev Recd Date: 2022-09-08
- Publish Date: 2023-01-18
-
Key words:
- auto focusing /
- sharpness evaluation function /
- variable-step /
- spatial domain /
- optical design
Abstract: The imaging of the cross wire target on the CCD is generally affected by the ambient light and the optical path. The cross wire image generated by the focal length of different positions will be blurred and out of focus, and the extraction of the center point of the cross wire target will be seriously affected. The traditional Sobel algorithm ignores the edge information and is easily affected by noise. Therefore, a two-stage fast search auto focusing method with variable-step size is proposed, which improves the image sharpness evaluation function of Sobel operator and combines the coarse and fine focusing. The method first evaluates the image sharpness by using the spatial domain of the image, and then selects the two-stage focusing mode according to the optical design. The first step is coarse adjustment. When the focus position is quickly found, fine adjustment is performed until the focus position is found. Experimental results show that compared with other algorithms, the auto focusing failure rate is 2%, the focusing time is 1242 ms, and the focusing stroke is −25-30 mm. The combination of the image sharpness evaluation function and the two-stage focusing mode through this algorithm has high accuracy and good real-time performance.