﻿ 哈特曼传感器子孔径光斑的局部自适应阈值分割方法
 光电工程  2018, Vol. 45 Issue (10): 170699      DOI: 10.12086/oee.2018.170699

1. 中国科学院自适应光学重点实验室，四川 成都 610209;
2. 中国科学院光电技术研究所，四川 成都 610209;
3. 中国科学院大学，北京 100049

Local adaptive threshold segmentation method for subapture spots of Shack-Hartmann sensor
Li Xuxu1,2,3, Li Xinyang1,2, Wang Caixia1,2
1. Key Laboratory of Adaptive Optics, Chinese Academy of Sciences, Chengdu, Sichuan 610209, China;
2. Institute of Optics and Electronics, Chinese Academy of Sciences, Chengdu, Sichuan 610209, China;
3. University of Chinese Academy of Sciences, Beijing 100049, China
Abstract: The accuracy of centroid estimation for Shcak-Hartmann wavefront sensor is highly dependent on noise, especially for the centre of gravity (CoG) method. Therefore, threshold selection is very important. This paper proposes a local adaptive threshold segmentation method based on statistical rank, which can reduce the influence of uneven background noise and decrease the wavefront reconstruction error more effectively, comparing with the traditional global threshold method. An experiment measuring static aberration was conducted, the accuracy of centroid estimation and wavefront reconstruction both testify the effectiveness of this method. Besides, we found that combing the local adaptive threshold method and intensity weighted centroiding (IWC) method can improve the performance of traditional centre of gravity method. It achieves higher centroiding accuracy under SNRp between 10~40 conditions.
Keywords: Shack-Hartmann sensor    point source spots    local adaptive threshold    centroiding    centre of gravity

1 引言

2 理论分析 2.1 夏克-哈特曼传感器原理及噪声分布

 $\left\{ \begin{array}{l} {g_x} = \tan {\theta _x} = \frac{{\Delta x}}{f}\\ {g_y} = \tan {\theta _y} = \frac{{\Delta y}}{f} \end{array} \right.。$ (1)
 图 1 夏克—哈特曼传感器原理图 Fig. 1 Principle diagram of Shack-Hartmann sensor

 $w = \frac{W}{p}{\rm{ = }}2\frac{{\lambda f}}{{pD}}。$ (2)

CCD在记录信号的同时，会引入多种噪声，包括：读出噪声、光子噪声、暗电流等[5]，且靶面的不同区域包含噪声的成分不同。图 2给出了相机靶面不同区域的噪声分布情况，其中外围正方形区域代表整个相机靶面，大圆形代表光束横截面，小圆形区域代表由卡塞克林结构的光路形成的中心遮拦，而虚线构成的一个个小正方形则代表光束被阵列透镜分割后对应的子孔径阵列。因此，图中区域1(靶面四角)主要包含的是读出噪声、暗电流等电噪声；区域2(中心遮拦)除电噪声外往往有少量信号光的散射形成背景光子噪声；区域3(光斑间隙)则包含了电噪声和更多的背景光子噪声，不同的间隙处光子噪声分布也是有差异的。

 图 2 相机靶面区域划分示意图 Fig. 2 Area division on a detector target surface
2.2 传统质心法及灰度加权质心法

 $\left\{ \begin{array}{l} x = \frac{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {j \cdot I{}_{ij}} } }}{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {I{}_{ij}} } }}\\ y = \frac{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {i \cdot I{}_{ij}} } }}{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {I{}_{ij}} } }} \end{array} \right.,$ (3)

 $\left\{ \begin{array}{l} x = \frac{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {j \cdot {I_{ij}}^q} } }}{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {{I_{ij}}^q} } }}\\ y = \frac{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {i \cdot {I_{ij}}^q} } }}{{\sum\nolimits_{i = 1}^n {\sum\nolimits_{j = 1}^n {{I_{ij}}^q} } }} \end{array} \right.。$ (4)

2.3 阈值法去噪声

 ${{I'}_{ij}} = \left\{ {\begin{array}{*{20}{c}} {{I_{ij}} - T,}&{{I_{ij}} \ge T}\\ 0&{{I_{ij}} < T} \end{array}} \right.,$ (5)

2.3.1 全局阈值和迭代阈值

 ${T_l} = {\mu _l} + k{\sigma _l},$ (6)

1) 首先，估计主光斑所占的像素个数ms

 ${m_{\rm{s}}} = \left\lceil {{\rm{\pi }}{{\left( {w/2} \right)}^2}} \right\rceil ,$ (7)

2) 然后，将该子孔径内的所有像素灰度按照从大到小排序；

3) 对于n×n像素的子孔径，取最小的${n^2}-{m_{\rm{s}}}$个像素灰度估计均值${\mu _l}$和标准差${\sigma _l}$

2.3.3 自适应阈值的处理效果

 图 3 经过不同阈值处理的光斑阵列图。(a)全局阈值Tn1；(b)全局阈值Tn3；(c)局部自适应阈值 Fig. 3 Spot array pattern obtained by different thresholding methods. (a) Gloabal thresholding Tn1; (b) Gloabal thresholding Tn3; (c) Local adaptive thresholding

3 实验设计及参数指标 3.1 实验光路设计

 图 4 静态相差测量实验光路图 Fig. 4 The light path schematic of static aberration measuring experiment

3.2 质心误差评价指标及信噪比度量

 $\left\{ \begin{array}{l} {\sigma _x} = \sqrt {\left\langle {{{\left( {x-\bar x} \right)}^{\rm{2}}}} \right\rangle } \\ {\sigma _y} = \sqrt {\left\langle {{{\left( {y-\bar y} \right)}^{\rm{2}}}} \right\rangle } \end{array} \right.。$ (8)

 $\left\{ \begin{array}{l} \Delta {x_{{\rm{CEE}}}} = \sqrt {\left\langle {{{(x-{x_0})}^{\rm{2}}}} \right\rangle } \\ \Delta {y_{{\rm{CEE}}}} = \sqrt {\left\langle {{{(y-{y_0})}^2}} \right\rangle } \end{array} \right.。$ (9)

 $SN{R_{\rm{p}}}{\rm{ = }}\frac{{{I_{\rm{p}}}-{\mu _{\rm{n}}}}}{{{\sigma _{\rm{n}}}}},$ (10)

4 实验结果及分析 4.1 背景噪声及信噪比估计

 信噪比等级 四角 中心 间隙 靶面上最高信噪比 衰减片 曝光时间/ms μn1 σn1 Tn1 μn2 σn2 Tn2 μn3 σn3 Tn3 lp SNRp L1 1 10 100.9 4.1 114 109.4 6.4 129 120.4 9.8 150 4566 465 L2 1 5 99.4 3.8 111 103.3 5.0 119 108.8 6.4 128 2238 349 L3 1 2 98.8 3.1 109 99.9 4.1 113 102.1 4.6 116 882 191 L4 1 1 98.2 3.0 108 98.9 3.5 110 100.0 3.9 112 481 123 L5 2 10 98.5 3.4 109 98.8 3.7 110 99.3 4.4 113 307 69 L6 2 5 98.1 3.4 109 98.6 3.5 110 99.0 4.1 112 153 37 L7 2 2 98.2 3.2 108 98.2 3.1 108 98.5 3.2 109 67 20

4.2 质心偏移误差

 阈值方法 10 ms 5 ms 2 ms 1ms RMS-σx RMS-σy RMS-σx RMS-σy RMS-σx RMS-σy RMS-σx RMS-σy Tn1 0.024 0.022 0.034 0.031 0.049 0.044 0.064 0.059 Tn3 0.021 0.019 0.031 0.026 0.044 0.038 0.059 0.053 自适应阈值 0.019 0.016 0.029 0.023 0.041 0.035 0.056 0.050

 阈值方法 5 ms 2 ms 1ms ΔxCEE ΔyCEE ΔxCEE ΔyCEE ΔxCEE ΔyCEE Tn1 0.121 0.106 0.099 0.072 0.095 0.068 Tn3 0.066 0.042 0.074 0.046 0.082 0.057 自适应阈值 0.047 0.030 0.061 0.043 0.076 0.054
4.3 波前复原误差

 图 5 测量得到的标准波面 Fig. 5 The estimated standard wavefront

 图 6 采用不同阈值方法时的复原误差。(a)全局阈值Tn1；(b)全局阈值Tn3；(c)局部自适应阈值 Fig. 6 Wavefront reconstruction error using different threshold methods. (a) Gloabal thresholding Tn1; (b) Gloabal thresholding Tn3; (c) Local adaptive thresholding
4.4 灰度加权质心法的参数优化

 图 7 不同信噪比下参数q与质心测量起伏的关系 Fig. 7 Relationship between q and deviation of centroiding error under different SNR levels
5 结论

 [1] Lukin V P, Botygina N N, Emaleev O N, et al. Wavefront sensors for adaptive optical systems[J]. Proceedings of SPIE, 2010, 7828: 78280P. [Crossref] [2] Vargas J, González-Fernandez L, Quiroga J A, et al. Shack-Hartmann centroid detection method based on high dynamic range imaging and normalization techniques[J]. Applied Optics, 2010, 49(13): 2409-2416. [Crossref] [3] Rao C H, Zhu L, Zhang L Q, et al. Development of solar adaptive optics[J]. Opto-Electronic Engineering, 2018, 45(3): 170733. 饶长辉, 朱磊, 张兰强, 等. 太阳自适应光学技术进展[J]. 光电工程, 2018, 45(3): 170733 [Crossref] [4] Jiang W H. Overview of adaptive optics development[J]. Opto-Electronic Engineering, 2018, 45(3): 170489. 姜文汉. 自适应光学发展综述[J]. 光电工程, 2018, 45(3): 170489 [Crossref] [5] Ares J, Arines J. Effective noise in thresholded intensity distribution: influence on centroid statistics[J]. Optics Letters, 2001, 26(23): 1831-1833. [Crossref] [6] Shen F, Jiang W H. A method for improving the centroid sensing accuracy threshold of Hartmann wavefront sensor[J]. Opto-Electronic Engineering, 1997, 24(3): 1-8. 沈锋, 姜文汉. 提高Hartmann波前传感器质心探测精度的阈值方法[J]. 光电工程, 1997, 24(3): 1-8 [Crossref] [7] Ma X Y, Rao C H, Zheng H Q. Error analysis of CCD-based point source centroid computation under the background light[J]. Optics Express, 2009, 17(10): 8525-8541. [Crossref] [8] Thomas S, Fusco T, Tokovinin A, et al. Comparison of centroid computation algorithms in a Shack-Hartmann sensor[J]. Monthly Notices of the Royal Astronomical Society, 2006, 371(1): 323-336. [Crossref] [9] Yin X M, Li X, Zhao L P, et al. Adaptive thresholding and dynamic windowing method for automatic centroid detection of digital Shack-Hartmann wavefront sensor[J]. Applied Optics, 2009, 48(32): 6088-6098. [Crossref] [10] Vyas A, Roopashree M B, Prasad B R. Centroid detection by Gaussian pattern matching in adaptive optics[J]. International Journal of Computer Applications, 2010, 1(26): 32-37. [Crossref] [11] Baker K L, Moallem M M. Iteratively weighted centroiding for Shack-Hartmann wave-front sensors[J]. Optics Express, 2007, 15(8): 5147-5159. [Crossref] [12] Ren J F, Rao C H, Li M Q. An adaptive threshold selection method for Hartmann-Shack wavefront sensor[J]. Opto-Electronic Engineering, 2002, 29(1): 1-5. 任剑峰, 饶长辉, 李明全. 一种Hartmann-Shack波前传感器图像的自适应阈值选取方法[J]. 光电工程, 2002, 29(1): 1-5 [Crossref] [13] Li X X, Li X Y, Wang C X. Optimum threshold selection method of centroid computation for Gaussian spot[J]. Proceedings of SPIE, 2015, 9675: 967517. [Crossref]