3.1. Experimental System and Evaluation Metrics
We validated the centroid extraction approach—combining multi-scale Gaussian fitting with subpixel edge reconstruction—using both simulations and experiments on real spot images. The simulation studies quantified localization accuracy across a range of noise levels, while experiments with measured spot images evaluated the algorithm’s stability and practical performance under realistic imaging conditions. In addition, the method was applied to determine optical system parameters (MTF and EFL) to demonstrate its utility for improving optical measurements. For benchmarking, three standard centroid extraction algorithms served as comparisons: the GC method, the EF method, and the GF method. To enable a quantitative comparison of their performance, we used the following metrics.
RMSE was used to quantify the deviation between the estimated positions and the true centroid, and is defined as:
where
N denotes the number of test samples,
represents the centroid coordinates extracted in the
i-th instance, and
denotes the true centroid coordinates.
Repeatability STD was used to assess the dispersion of multiple extraction results for the same static speckle target, reflecting the level of random error of the algorithm. It is defined as:
where
denotes the mean of
N computation results; a smaller STD value indicates better algorithmic repeatability.
Trajectory smoothness (TS) was used to assess the fluctuation magnitude of centroid displacements between consecutive frames, indirectly reflecting the algorithm’s capability to suppress vibrations. It is quantified by the variance of displacements between adjacent frames and is defined as:
where
denotes the centroid displacement between frame
i and frame
i + 1, and
represents the mean of
. A smaller
value indicates that the inter-frame displacement changes more smoothly, reflecting a higher trajectory smoothness of the algorithm.
3.2. Experiment on Centroid Extraction of Simulated Spot Images
We evaluated the algorithm using simulated circular Gaussian spots generated in MATLAB R2024a to represent ideal point sources. Each image measured 512 × 512 pixels, and the spot centroid was randomly positioned at (256.3, 256.7). To mimic realistic imaging conditions, we contaminated the simulations with an equal mixture of random Gaussian noise, shot noise, and salt-and-pepper noise (power ratio 1:1:1). Noise intensity was expressed as signal-to-noise ratio (SNR). For each SNR value of 5 dB, 10 dB, 15 dB, 20 dB, 25 dB, and ∞ (noise-free), fifty spot images were generated for each SNR level. The simulated spot images are shown in
Figure 2.
Figure 3 plots the localization RMSE for each method. All methods show decreasing RMSE as SNR increases. In the noiseless case, the proposed method (MSGF-SER) achieves an RMSE of 0.03 pixels, outperforming GC (0.04 pixels), EF (0.05 pixels), and GF (0.05 pixels). As SNR falls to 5 dB, the errors of the conventional methods rise sharply; by contrast, MSGF-SER maintains subpixel accuracy, with an RMSE of 0.84 pixels, demonstrating strong noise robustness.
To evaluate the execution efficiency of the proposed method, we conducted comparative experiments against conventional centroid extraction techniques and recorded the average processing time for a single 512 × 512 synthetic image. The results are presented in
Table 1. The grayscale centroid method is the fastest, requiring only 0.422 ms; the elliptical fitting and Gaussian fitting methods have similar runtimes, approximately 0.83 ms; the proposed method, due to the construction of a three-level multi-scale pyramid and subpixel edge reconstruction using a 7 × 7 Zernike template, requires 1.671 ms, which is approximately four times that of the grayscale centroid method and twice that of the elliptical and Gaussian fitting methods.
Combining the data in
Figure 3 shows that the proposed method significantly improves accuracy compared to conventional approaches. This enhancement comes with increased computational time, representing a trade-off between processing speed and precision. However, this trade-off allows for better management of complex scenarios and uncertainties, demonstrating greater robustness in practical applications. In engineering, high-precision data are essential for accurate decision-making. Therefore, the careful sacrifice of computation time to achieve more precise results holds substantial practical value in precision measurement applications.
3.3. Real Spot Image Centroid Extraction Experiment
To validate the proposed method, we built an optical imaging experimental system; a schematic of its components appears in
Figure 4. The system comprises five principal modules: the target generation module, the collimation optics, the image analyzer, the computation, processing and control module, and the rotation stage module. The target generator creates a star-point test pattern that the collimator renders into a collimated beam and projects onto the image analyzer’s sensor plane. The image analyzer captures these images in real time and relays them via a data interface to the computation, processing and control module. Simultaneously, the rotation stage is actuated to shift the target off the optical axis, intentionally distorting the imaged spot and thereby emulating noncircular spot morphologies.
Figure 5 shows the experimental setup for centroid extraction of the optical system. The software runtime environment is CPU Intel
® Core™ i7-10700@2.9GHz (Intel, Santa Clara, CA, USA), RAM 32 GB, Qt 5.14.2.
Figure 6 shows a schematic of the experimental platform, and
Table 2 summarizes the parameters of the principal components of the experimental system.
We evaluated the centroid extraction performance of the proposed method under varied imaging conditions using three standard lenses coupled to detectors with different spectral sensitivities; photographs of the devices are shown in
Figure 7. The LWIR detector was uncooled and therefore produced very high imaging noise, whereas the mid-wave detector was Stirling-cooled and exhibited small spot vibrations in the frames. In contrast, the visible-light detector yielded high-quality images approximating ideal Gaussian spots. To induce asymmetric, noncircular spot shapes, we introduced an off-axis field by rotating the stage to create a 3° field offset. In total, four image sequences were acquired: 50 on-axis visible-band frames, 50 off-axis visible-band frames with a 3° field offset, 50 on-axis LWIR-band frames, and 50 on-axis mid-wave-band frames. Representative images for each condition are shown in
Figure 8. The mid-wave and LWIR images have a resolution of 640 × 512 pixels, while the visible images are 1920 × 1200 pixels.
We extracted spot centroids from each frame of three static image sets—visible axis, off-visible axis, and LWIR band—using GC, EF, GF, and the proposed MSGF-SER method. For each technique, we computed the STD of the X and Y coordinates and generated 50-point scatter plots of the extracted centroids; the results are presented in
Figure 9. Because spot positions and shapes are constant within each image set, observed centroid variations mainly reflect algorithmic stochastic errors and detector noise.
On-axis visible-light conditions: When spot morphology is highly symmetric and imaging noise is minimal, all methods reliably recover the centroid. Nonetheless, the MSGF-SER method yields a substantially smaller STD—0.10 pixels in X and Y—compared with GC (0.25/0.26 pixels), EF (0.28/0.30 pixels) and GF (0.31/0.32 pixels). Moreover, the intrinsic convergence behavior of MSGF-SER produces identical subpixel coordinates far more often under repeated processing of the same frame: 21 out of 50 independent extractions versus 8, 6 and 3 for GC, EF and GF, respectively. This higher frequency of identical outcomes—2.6, 3.5 and 7 times those of GC, EF and GF—demonstrates the exceptional numerical repeatability of MSGF-SER in ideal conditions and indicates that the combined multi-scale Gaussian fitting and subpixel edge reconstruction effectively suppress residual random error, driving repeated computations to converge to nearly the same location.
Visible off-axis distortion condition: Asymmetry in the spot shape markedly degrades the repeatability of conventional methods, yielding GC STDs of 0.87/0.92 pixels, EF of 1.18/0.98 pixels, and GF of 1.23/1.10 pixels. In contrast, MSGF-SER, which uses an adaptive weighted fusion strategy, preserves shape adaptability and reduces variability, with STDs of 0.41 pixels and 0.28 pixels in the X and Y directions, respectively.
Under LWIR, in high-noise conditions, all methods showed increased STDs. However, the X/Y STDs for MSGF-SER (0.88/0.92 pixels) remained roughly half to two-fifths of those for conventional approaches (GC: 1.65/1.78; EF: 1.69/1.84; GF: 2.03/2.16), demonstrating markedly greater noise resilience. These findings therefore confirm the proposed method’s high repeatability and robustness across different static imaging conditions.
Figure 9d presents the extracted centroids from 50 consecutive frames under MWIR vibration. Because the cooler-induced micro-vibrations primarily propagate along the image Y-axis, the analysis concentrates on the Y-coordinate variation produced by each method. Note that the true spot-center position is unavailable in these real vibration conditions; accordingly, this experiment aims to evaluate the relative positional stability of different algorithms in a vibrating environment rather than their absolute localization accuracy. Given the cooler’s fixed structural and frequency characteristics, the actual spot motion should be continuous and smooth; therefore, the random jitter and occasional jumps observed in the extracted trajectories are largely attributable to centroid extraction errors.
Figure 9d shows that MSGF-SER produces the smallest fluctuations in the Y-direction centroid coordinates and the smoothest trajectory. By contrast, the Y-direction traces from GC, EF, and GF display pronounced random jitter and occasional jumps. Quantitatively, the standard deviation (STD) of MSGF-SER in Y is 0.098, markedly lower than GC (0.395), EF (0.548), and GF (0.657). When examining inter-frame displacement variance in Y only, MSGF-SER attains 0.0037—more than an order of magnitude smaller than GC (0.0312), EF (0.0458), and GF (0.0522)—indicating a substantially smoother and more stable centroid trajectory under vibration. These improvements in trajectory stability also translate into better optical measurements. As detailed in the MTF and EFL experiments (see
Section 3.4), MSGF-SER produces an MTF curve closest to the theoretical prediction and exhibits the smallest EFL measurement error and best repeatability. Together, the trajectory statistics and measurement results confirm that MSGF-SER yields more stable and reliable centroid localization in complex MWIR operating conditions.
3.4. Optical-Parameter Measurement Experiments
MTF was measured using the star-point method. In this approach, the image-plane intensity distribution of a star-point target (the point spread function) is acquired, and a two-dimensional Fourier transform is applied to yield the modulus of the optical transfer function, i.e., the MTF curve. The procedure is as follows: locate the spot centroid, extract a subregion centered on that centroid, compute and normalize the two-dimensional Fourier transform, and then perform a radial averaging to obtain the MTF as a function of spatial frequency. The detailed calculation is provided in reference [
25].
EFL was determined with the rotary-angle method. The lens under test is mounted on a high-precision rotary stage and rotated by a known angle
ω while the displacement Δ
y (pixels) of the spot centroid on the image plane is recorded. The focal length is then calculated as
f = Δ
y·
d/tan(
ω), where
d is the pixel size. Detailed experimental procedures are given in reference [
26].
To assess how centroid extraction accuracy influences downstream optical-parameter measurements, we used the centroid coordinates obtained under the four test conditions described above to compute MTF and EFL. Experiments employed three standard lenses covering visible, MWIR, and LWIR bands; photographs of the physical devices appear in
Figure 10, and their specifications are listed in
Table 3. When the visible-band spot is on-axis and otherwise ideal, image quality is high, and differences among centroid extraction methods have negligible impact on the resulting MTF and EFL. By contrast, under the three non-ideal conditions—visible-band off-axis distortion, elevated noise in the LWIR, and vibration in the MWIR—errors in centroid localization propagate through the analysis and measurably affect the computed MTF and EFL. The remainder of this section compares the accuracy of optical-parameter measurements obtained with our method to those produced by alternative centroid extraction approaches under these three challenging conditions. Detailed MTF and EFL results are reported in
Section 3.4.1 and
Section 3.4.2, respectively.
3.4.1. MTF Measurement Experiment
We evaluated how centroid extraction accuracy affects MTF measurements by performing tests in four representative configurations: on-axis visible, off-axis visible, LWIR, and MWIR. For each lens and spatial frequency, MTF values were computed using the star-field method. We then compared the proposed MSGF-SER centroiding algorithm with three conventional techniques: GC, EF, and GF. The theoretical MTF curves—generated by optical design software—served as benchmarks and correspond to a visible lens (66.3 mm focal length, F/2.5) and the MWIR and LWIR lenses (50 mm focal length, F/1.2).
Figure 11 shows the MTF curves measured by different methods under four typical conditions: on-axis visible ideal spots, off-axis visible distorted spots, long-wave infrared high-noise spots, and mid-wave infrared vibration spots. As shown in
Figure 11a, under the on-axis visible ideal condition, all methods yield MTF curves that are in excellent agreement with the theoretical curve, with the maximum deviation being less than 0.005, indicating that centroid localization error has a negligible effect on MTF when the spot is ideal. However, under the off-axis visible distorted condition (
Figure 11b), the spot exhibits an asymmetric shape. The MTF curves obtained by the GC, EF, and GF methods are notably lower than the theoretical curve in the mid-to-high frequency range (above 50 lp/mm), with maximum deviations of 0.036, 0.033, and 0.042, respectively. In contrast, the proposed MSGF-SER method, leveraging its adaptive fusion strategy, limits the full-band deviation to within 0.01, demonstrating excellent adaptability to asymmetric spots.
Under the LWIR high-noise condition (
Figure 11c), the MTF curves of the GC, EF, and GF methods exhibit irregular fluctuations in the 30–70 lp/mm range, with maximum deviations of 0.045, 0.040, and 0.056, respectively, showing poor repeatability. The MSGF-SER method, however, maintains a smooth curve with a maximum deviation of only 0.009, indicating significantly better noise-suppression capability than the conventional methods. Under the MWIR vibration condition (
Figure 11d), the Y-direction micro-vibration induced by the Stirling cooler causes periodic fluctuations in the MTF curves of the conventional methods in the 40–60 lp/mm range, with deviations of 0.032, 0.028, and 0.038 for GC, EF, and GF, respectively. Benefiting from the high smoothness of its centroid trajectory, the MSGF-SER method controls the full-band deviation within 0.008, verifying its excellent vibration suppression capability. In summary, the proposed method significantly improves MTF measurement accuracy under various challenging conditions, consistently limiting the deviation between the measured MTF and the theoretical value to within 0.01, thereby providing a reliable guarantee for the precise evaluation of the modulation transfer function of optical systems.
3.4.2. EFL Measurement Experiment
Because an ideal spot on the visible-light axis has negligible effect on focal-length measurements, we evaluated the proposed method under more realistic, non-ideal conditions by measuring the visible-light lens EFL with off-axis distortion. Centroid coordinates extracted from three scenarios—visible-light off-axis distortion, LWIR, and MWIR—were used separately to compute the EFL, allowing assessment of how centroid extraction accuracy influences effective focal length estimates. The resulting EFL values are plotted in
Figure 12, and their means and STDs are reported in
Table 4.
The EFL measurements across the three operating conditions show notable differences in accuracy and robustness among the tested methods. Under off-axis visible-light distortion (nominal focal length 66.30 mm), the conventional GC and EF methods produced mean focal lengths of 66.16 mm, while the GF method yielded 66.07 mm; their STDs ranged from 0.019 to 0.028 mm. The GF method showed the largest bias from nominal, 0.23 mm. By contrast, the proposed MSGF-SER method returned a mean of 66.28 mm—only 0.02 mm from nominal—with a STD of 0.009 mm, roughly one-half to one-third that of the conventional approaches, indicating markedly improved shape adaptability. Under high-noise LWIR conditions (nominal focal length 50.00 mm), noise markedly increased the measurement bias of conventional methods: GC, EF, and GF deviated from the nominal value by 0.34 mm, 0.37 mm, and 0.69 mm, respectively. In contrast, MSGF-SER limited the deviation to 0.05 mm and produced an STD of 0.019 mm—approximately one-third that of the conventional approaches. Similarly, under MWIR vibration conditions (nominal focal length 50.00 mm), conventional methods suffered large fluctuations driven by Y-direction centroid jitter; the GF method alone showed a 0.46 mm deviation from the nominal value. By comparison, MSGF-SER produced a smooth centroid trajectory that constrained the deviation to 0.03 mm and yielded a STD of only 0.018 mm, substantially outperforming the conventional techniques. In summary, the method presented in this study markedly improves the accuracy and repeatability of EFL measurements under complex operating conditions. Across all tests, the deviation of the measured mean from the nominal focal length was better than 0.05 mm (relative deviation better than 2‰), and the repeatability STD was below 0.02 mm, fully validating the critical supporting role of high-precision centroid localization for focal length measurement.