-
Fig. 1 shows a schematic of the ASM-SHWS. An adaptive segmentation process based on nearest-neighbor matching was performed on the spot image acquired from the sensor, as shown in Fig. 1b. This process produces a set of detected points, labeled as G. Following this, a global matching optimization algorithm is used to accurately seek the incident wavefront that best approximates the distribution of the detected points in set G. To achieve spot matching, the estimated spot positions corresponding to each microlens are determined through the SHWS paraxial imaging model, depicted in Fig. 1c. The slopes within each microlens region were calculated to reconstruct the measured wavefront accurately (Fig. 1a).
Fig. 1 Principle and schematic of ASM-SHWS. a Schematic of ASM-SHWS. b Segmentation and centroid extraction of spots from the original image. c Paraxial imaging model of SHWS. d Flowchart showing the implementation of ASM-SHWS using PSO.
The method for obtaining centroid coordinates from a spot image is illustrated in Fig. 1b. To account for the stark contrast in brightness between the spots and background, initial segmentation was conducted using Otsu’s method32. This was followed by identification of the connected components of the spots, which clarified the distribution of each individual spot. The centroid extraction process allows the determination of the set of detected points, G.
To search for the optimal incident wavefront corresponding to the detected spots, the ASM-SHWS requires a characterization that describes the distribution of the incident wavefront. One technique involves characterizing the incident wavefront with Zernike coefficients Ck (k = 1, 2, …, K, where K stands for the number of Zernike coefficients). With the SHWS paraxial imaging model (Fig. 1c), the positions of the spots aligned with each microlens can be calculated by
$$ \left\{\begin{array}{l} x_{e}^{(i)}=x_{r}^{(i)}+L \displaystyle\sum C_{k} \dfrac{\partial Z_{k}}{\partial x} \\ y_{e}^{(i)}=y_{r}^{(i)}+L \displaystyle\sum C_{k} \dfrac{\partial Z_{k}}{\partial y} \end{array}\right. $$ (1) Here, $ \left(x_{e}^{(i)}, y_{e}^{(i)}\right) $ denotes the centroid coordinates of the i-th spot (i = 1, 2, …, M, and M is the total count of microlens within the MLA); $ \left(x_{r}^{(i)}, y_{r}^{(i)}\right) $ represents the imaging position of the i-th microlens optical axis on the sensor, which is previously calibrated and considered as a reference position; Zk denotes the k-th Zernike polynomial term; and L denotes the distance between the MLA and sensor. To create the global matching cost function, the difference between the estimated and detected positions of the spots is initially calculated. To obtain a set of estimated points $ E=\left\{\left(x_{e}^{(1)}, y_{e}^{(1)}\right),\left(x_{e}^{(2)}, y_{e}^{(2)}\right) \ldots,\left(x_{e}^{(M)}, y_{e}^{(M)}\right)\right\} $, the centroid coordinate of all spots is computed. Next, the Hausdorff distance dH is calculated between sets E and G by
$$ \left\{\begin{array}{l} d_{\mathrm{FH}}(\boldsymbol{E}, \boldsymbol{G})=\sup _{e \in \boldsymbol{E}} \inf _{\boldsymbol{g} \in \boldsymbol{G}} d(e, g) \\ d_{\mathrm{BH}}(\boldsymbol{E}, \boldsymbol{G})=\sup _{g \in {\boldsymbol G} \in {\boldsymbol E}} \inf _{e \in \boldsymbol{E}} d(e, g) \\ d_{\mathrm{H}}=\max \left\{d_{\mathrm{FH}}, d_{\mathrm{BH}}\right\} \end{array}\right. $$ (2) Here, dFH and dBH denote the forward and backward Hausdorff distances, respectively; sup and inf denote the supremum and infimum, respectively; and $ d(\cdot) $ quantifies the distance from a point $ e \in \boldsymbol{E} $ to another $ g \in \boldsymbol{G} $. When calculating dH, it is necessary to establish point-to-point correspondences within sets E and G, using the nearest-neighbor principle. Consequently, two K-dimensional (K-D) trees were created based on the two-dimensional distribution of these points. The points associated with nodes within the corresponding K-D trees are selected as neighboring points, effectively reducing the temporal complexity. A penalty term was included in the cost function to maintain the accuracy of optimization direction. This safeguards against a single point serving as the nearest neighbor for multiple points.
Fig. 1d depicts the employment of Particle Swarm Optimization (PSO) for optimizing the incident wavefront via the Zernike coefficients Ck. PSO emulates bird flocking behavior through particle representations to obtain an optimal solution33. This is achieved by the particle adaptation of position and velocity based on population and individual experience, facilitating the estimation of the incident wavefront. Unlike gradient-based methods, PSO does not require gradient information related to the cost function and possesses strong global search capability, thereby avoiding localized optimization traps. Assuming a swarm size of N, the initial positions xn(0) (n = 1, 2, …, N) and initial velocities vn(0) are assigned to the N particles, where xn and vn are K-dimensional vectors. Throughout each iteration, it is necessary to compute the cost function for every particle to update the positions and velocities of the particle swarm.
$$ \left\{\begin{aligned} &\begin{aligned}v_{n, k}(t+1)=&w v_{n, k}(t)+c_{1} r_{1}\left[P_{b e s t}-x_{n, k}(t)\right]+\\& c_{2} F_{2}\left[G_{b \text { bess }}-x_{n, k}(t)\right] \end{aligned}\\ &x_{n, k}(t+1)=x_{n, k}(t)+v_{n, k}(t+1) \end{aligned}\right. $$ (3) Here, $ x_{n, k}(t) $ and $ v_{n, k}(t) $ represent the values of the k-th dimension of xn and vn after t iterations. The inertia weight (w) controls the effect of the previous velocity on the current velocity. The cognitive coefficient (c1) and social coefficient (c2) determine the influence of the best-known positions of the particle (Pbest) and swarm (Gbest). Generally, the inertia weight w is selected empirically within the range of 0–1, whereas the coefficients c1 and c2 are set within the range of 0–4. These coefficients were then multiplied by random numbers (0 < r1 < 1 and 0 < r2 < 1) to introduce stochasticity.
Using PSO, it is possible to attain the optimal estimation of Ck, which consequently makes it feasible to calculate the points within the estimated point set E. By establishing the correspondence between each point in set E and the microlenses, the correspondence between spots and microlenses can be deduced. Consequently, the slopes can be computed, and the incident wavefront can be reconstructed using a wavefront reconstruction algorithm such as modal decomposition or an iterative local reconstruction algorithm.
-
To validate the practical accuracy of the ASM-SHWS, we constructed an SHWS sensor using an MLA (MLA150-7AR, Thorlabs, Inc.) and a CMOS sensor (IMX249, Sony, Corp.). The SHWS was characterized by a pixel size of 5.86 µm and a microlens pitch of 150 µm. The distance between the MLA and the CMOS sensor, calibrated using the spherical wavefront calibration method38, was 5.42 mm. Given these parameters, the conventional SHWS demonstrated the ability to detect a maximum displacement of a single spot at 12.8 pixels, correlating to a maximum local slope of 13.84 mrad. The wavefront measurement setup is shown in Fig. 5a. The spherical wave emitted from the optical fiber was collimated and converged using a lens with a focal length of 100 mm. The SHWS was positioned both anterior and posterior to the focal point of the lens, allowing for the capture of highly curved converging and diverging spherical waves. The left sides of Fig. 5b, c show the spot images acquired at these positions. We reconstructed spherical waves using the ASM-SHWS and Zernike modal wavefront reconstruction algorithms. The reconstructed results after 41 and 47 iterations are shown on the right sides of Fig. 5b, c, respectively. Within our computing environment (MATLAB 2021a, CPU i7-10700), the computation time for the ASM-SHWS was 0.36 s and 0.41 s, respectively, which translates to ~8.8 ms per iteration. Subsequently, a spherical fitting procedure was performed on the reconstructed wavefronts, and their evaluation was quantified in terms of the Mean Relative Fitting Error (MRFE).
Fig. 5 Experimental results of wavefront measurement. a Experimental setup for the measurement of large curvature spherical waves using SHWS. b,c Spot matching and reconstruction results of ASM-SHWS for large curvature diverging b and converging c spherical waves. d,e Spot matching and reconstruction results of ASM-SHWS for large curvature diverging d and converging e spherical waves in the presence of missing spots.
$$ \operatorname{MRFE}=\frac{1}{N} \sum_{n=1}^{N} \frac{\left|W_{n}-S_{n}\right|}{\mathrm{PV}} $$ (4) Here, Wn and Sn denote the phase values of the n-th (n = 1, 2, 3, …, N) reconstruction point and the fitted sphere point, respectively. The MRFE values corresponding to the reconstructed diverging and converging spherical waves were 0.104% and 0.063%, respectively, compared with the fitted sphere (Fig. 5b, c). Notably, for the reconstructed diverging spherical wave, the farthest matched spot exhibited displacements of 47.50 and 47.76 pixels along the x and y directions, respectively. It manifested a local slope of 72.83 mrad, exceeding the conventional SHWS limit by a factor of 5.26 (Fig. 5b). Similarly, for the converging spherical wave, the farthest displacements in the x and y directions were 131.48 and 136.59 pixels, respectively, along a local slope of 204.98 mrad, exceeding those of the conventional SHWS by a factor of 14.81 (Fig. 5c).
Finally, we experimentally tested the measurement capability of the ASM-SHWS in the presence of missing spots. To induce missing spots in the image, we partially occluded the effective aperture, resulting in the configuration shown on the left sides of Fig. 5d, e. To counteract the centroid calculation errors caused by partially occluded spots, we implemented a threshold during image segmentation that ensured that only spots with sizes exceeding the threshold were considered for matching and subsequent reconstruction calculations. Consequently, the ASM-SHWS achieved accurate spot matching for the remaining spots in the scenarios with 32 missing spots (8.9%) and 45 missing spots (12.5%). Under these conditions, the MRFE values associated with the reconstructed diverging and converging spherical waves were 0.010% and 0.048%, respectively, compared with the fitted sphere (Fig. 5d, e). With 8.9% missing spots, the farthest matched spot in the reconstructed diverging spherical wave had a displacement of 47.56 and 47.82 pixels along the x and y directions, respectively. It also had a local slope of 72.91 mrad, exceeding the conventional SHWS limit by a factor of 5.27 (Fig. 5d). Similarly, for the converging spherical wave and with 12.5% missing spots, the farthest displacement in the x and y directions was 131.43 and 136.62 pixels, respectively. This was accompanied by a local slope of 204.97 mrad, which exceeds the conventional SHWS limit by a factor of 14.81 (Fig. 5e).
Large dynamic range Shack-Hartmann wavefront sensor based on adaptive spot matching
- Light: Advanced Manufacturing 5, Article number: (2024)
- Received: 16 September 2023
- Revised: 29 December 2023
- Accepted: 08 January 2024 Published online: 16 March 2024
doi: https://doi.org/10.37188/lam.2024.007
Abstract: The Shack-Hartmann wavefront sensor (SHWS) is widely used for high-speed, precise, and stable wavefront measurements. However, conventional SHWSs encounter a limitation in that the focused spot from each microlens is restricted to a single microlens, leading to a limited dynamic range. Herein, we propose an adaptive spot matching (ASM)-based SHWS to extend the dynamic range. This approach involves seeking an incident wavefront that best matches the detected spot distribution by employing a Hausdorff-distance-based nearest-distance matching strategy. The ASM-SHWS enables comprehensive spot matching across the entire imaging plane without requiring initial spot correspondences. Furthermore, due to its global matching capability, ASM-SHWS can maintain its capacity even if a portion of the spots are missing. Experiments showed that the ASM-SHWS could measure a high-curvature spherical wavefront with a local slope of 204.97 mrad, despite a 12.5% absence of spots. This value exceeds that of the conventional SHWS by a factor of 14.81.
Research Summary
Adaptive spot matching empowers Shack-Hartmann sensors for high-curvature wavefront measurements
Traditional Shack-Hartmann sensors face a limitation that the focused spot from each microlens is restricted to a single microlens, resulting in a limited dynamic range. Qiao-Zhi He from China’s Shanghai Jiao Tong University and colleagues report a development that extends the dynamic range of the Shack-Hartmann wavefront sensor by an order of magnitude without increasing system complexity shows promise. Their approach introduces an adaptive spot matching method, utilizing a nearest-distance matching strategy to identify the incident wavefront that best matches the detected spot distribution. This method can achieve comprehensive spot matching across the entire imaging plane without requiring initial spot correspondences, even when some spots are missing. The team demonstrated measuring a high-curvature spherical wavefront with a high slope of 204.97 mrad despite a 12.5% absence of spots, exceeding the capability of traditional Shack-Hartmann sensors by a factor of 14.81.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article′s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article′s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.