Figure 1 illustrates the basic principle of OADH. By introducing a specific spatial carrier frequency between the reference light and the object light, the complex amplitude information of the object light can be migrated to the ±1st-order diffraction regions in the frequency domain. Under ideal optical conditions, the 0th-order (DC component) of the spectrum is located at the center of the frequency domain, while the ±1st-order (diffraction components) are symmetrically distributed on both sides of the off-axis direction. The typical model is as follows:
where
denotes the reference light,
represents the object light, and (
,
) stands for the spatial carrier frequency. Performing a two-dimensional Fourier transform on
yields
, where
{⋅} denotes the Fourier transform operator. The amplitude spectrum
is typically characterized by the 0th-order component concentrated at the center coordinates of the spectrum
, while the ±1st-order components are respectively localized near
.
When measuring wavefront distortions caused by atmospheric turbulence using an OADH measurement system in AO application scenarios, the spectrum spots of the holographic interferometric fringes often exhibit irregular distributions. Furthermore, they are prone to multi-region interference due to the influence of noise and background stray light, as shown in
Figure 2. As the core component carrying valid information of the measured object, the accurate initial localization of the +1st-order spectrum is a prerequisite for the subsequent precise extraction of complex amplitude. Traditional +1st-order spectrum extraction methods rely on manual annotation of spectral regions and exhibit poor adaptability to irregularly distorted spots in AO scenarios, which easily leads to localization deviations or failures. Meanwhile, during the detection process, the camera’s readout noise, background photon noise, and signal photon noise in the spot region exert a significant adverse effect on the extraction accuracy of the +1st-order spectrum.
2.1. Peak Screening-Based +1st-Order Spectrum Region Estimation Algorithm
First, a peak screening-based +1st-order spectrum region estimation algorithm is proposed to process the holographic spectrum, thereby realizing the rough region estimation of the +1st-order spectrum and laying a solid foundation for subsequent refined processing. In practical AO scenarios, the holographic spectrum contains a large amount of high-frequency noise, and irregular light spots are prone to causing local pixel value fluctuations. Direct peak detection under such conditions would generate numerous false peaks, which severely degrades localization accuracy. To enhance the robustness of peak detection, Gaussian smoothing filtering is adopted to preprocess the spectral amplitude map, highlighting the true spectral peaks by suppressing noise and local fluctuations:
where
denotes the Gaussian standard deviation, which determines the smoothing degree. According to the characteristics of irregular light spots, with all other parameters kept constant, the test scenarios cover
of varying intensities, and its mathematical expression can be expressed as follows:
Among them,
denotes the peak value of the spot signal,
the gray-scale mean value of the background region, and
the variance.
= 8 to 500. The results demonstrate that the centroid estimation error of the algorithm remains consistently stable for
. In this paper,
is set to 5 to achieve an optimal balance between noise suppression and peak preservation. After smoothing processing, 8-neighborhood [
15] connected component local maximum detection is adopted to extract local peak points in the spectrum. These peak points correspond to regions with relatively concentrated energy in the spectrum, providing a candidate set for +1st-order spectrum screening:
Peak intensity may be expressed as:
After regional maximum detection, the candidate peak set may contain a number of redundant false peaks that are relatively close to each other, which is particularly prominent in irregular light spot regions. These false peaks will increase the complexity of subsequent screening and reduce localization efficiency. To address this issue, redundancy elimination is performed based on the Euclidean distance between peaks [
16], retaining independent peak points with significant energy. Let
and
be any two peak points; the calculation formula for their Euclidean distance is:
A minimum peak spacing threshold is set. The screening rule is as follows: sort the candidate peaks in descending order of gray value and retain them sequentially. If the minimum Euclidean distance between a new peak point and the already retained peak points is greater than , the new peak is retained; otherwise, it is eliminated. Via this step, a redundancy-removed screened peak set is obtained, which effectively reduces the subsequent computational load and eliminates the interference of dense false peaks.
In the off-axis holographic spectrum, the 0th-order spectrums typically located at the spectrum center and has the highest energy. However, it is not the target valid signal and needs to be eliminated from the candidate peak set. First, the redundancy-removed peaks are sorted in descending order of gray value, and the top 10 peaks with the largest gray values are extracted. This is because the +1st-order spectrum, as a valid signal, exhibits high energy concentration and is highly likely to be included in these top 10 peaks. Let the center coordinates of the spectrum image be
(where
,
, and N and M denote the width and height of the spectrum image, respectively). For each strong peak point
, the Euclidean distance to the spectrum center is calculated as:
When all other parameters are fixed, is set to vary within the range of to . When ∈ [], the algorithm can accurately distinguish the +1st-order spectral order from the 0th-order/–1st-order spectral orders without localization deviation, and the spectral extraction performance remains stable. Therefore, the minimum central distance threshold is defined as ; If , the peak is determined to correspond to the 0th-order spectrum and eliminated; otherwise, it is retained, yielding a valid peak candidate set. If the valid peak candidate set is empty, the algorithm will prompt to adjust the threshold parameters, ensuring robustness in AO scenarios. This step achieves manual-intervention-free 0th-order spectrum elimination through quantitative distance measurement, addressing the limitation of traditional methods that require manual distinction between the 0th-order and +1st-order spectra.
Based on the characteristic that the +1st-order spectrum is typically located on the right side of the
x-axis relative to the spectrum center, directional screening is performed on the valid peak candidate set:
Finally, the rough center of the +1st-order spectrum is determined as the point with the largest peak value in the right half-plane:
The output serves as the rough center coordinates of the +1st-order spectrum. This step ultimately achieves the automatic rough localization of the +1st-order spectrum region.
2.2. Mask-Constrained +1st-Order Spectrum Enhancement and Binarization
After obtaining the rough center of the +1st-order spectrum through the
Section 2.1 steps, a mask-constrained frequency-domain filtering method for +1st-order spectrum enhancement and binarization is proposed to further enhance the signal in the +1st-order spectrum region. This method further improves the algorithm’s adaptability to irregular light spots.
First, with the rough center coordinates
of the +1st-order spectrum as the center, an adaptive circular mask is constructed to only process the +1st-order candidate region within the mask coverage. The mask radius sufficiently covers the maximum extension range of irregular light spots. Let the size of the spectrum image be M × N. The mask radius
is defined as:
Generate the two-dimensional coordinate grid of the spectrum image as
. For any pixel point
in the coordinate grid, the mask determination rule is:
After construction, the spectral region within the mask is first extracted via element-wise multiplication:
To enhance the local gray value differences of irregular light spots and make the energy distribution contour inside the spots more distinct,
needs to be normalized to the [0, 1] gray scale range to obtain a normalized spectral map. Although ambient light can degrade the localization accuracy and robustness of optical sensing systems [
17], the proposed method implements adaptive histogram equalization [
18] processing to eliminate the influence of ambient light. This method divides the image into multiple non-overlapping local sub-blocks, performs histogram equalization on each sub-block independently, and further avoids excessive noise amplification by limiting contrast. After processing, an enhanced spectral map
is obtained.
Then, the enhanced spectral map
is subjected to secondary Gaussian smoothing. The calculation formula for the secondary smoothing is consistent with the initial Gaussian smoothing, i.e.,
, with only the Gaussian standard deviation adjusted to
. Subsequently, the optimal binarization threshold T is calculated using Otsu’s method [
19] (maximum inter-class variance method), which maximizes the inter-class variance between the foreground and background. Then, binarization processing is performed based on the optimal threshold to obtain the binary map
of the +1st-order spectrum spot. The determination rule is:
In the binarized result, the regions with a value of 1 correspond to the distinct contour of the +1st-order spectrum spot. This region completely shields against noise interference while fully preserving the morphological characteristics of the irregular light spot, providing an accurate and reliable regional constraint for the subsequent precise extraction of the +1st-order complex amplitude.
2.3. Canny Operator-Based Spot Edge Detection and Region Filling
After obtaining the binary map of the +1st-order spectrum spot via adaptive threshold binarization, it is prone to issues such as edge breakages and discontinuous contours due to the distortion of irregular spots. Directly using this map as the complex amplitude extraction region will result in the loss of valid signals. To address this problem, a spot edge detection and region filling method based on the Canny operator is proposed to achieve the completion of the spot contour, providing an accurate and complete regional constraint for the subsequent precise extraction of the +1st-order complex amplitude.
To extract the contour edges of the irregular spot, the Canny edge detection algorithm [
20,
21] is adopted to obtain the edge image
, where pixel points with a value of 1 constitute the contour edges of the spot, and those with a value of 0 correspond to the background region. This algorithm achieves edge extraction with a low false detection rate and high localization accuracy through multi-stage processing, adapting to the complex contour characteristics of irregular spots. After Canny edge detection, minor edge breakages caused by uneven gray distribution of the spot may still exist. Therefore, morphological closing operation [
22] is used to repair the edge image, realizing the connection of broken edges and the closure of the contour. Morphological closing operation is defined as a composite morphological operation consisting of dilation followed by erosion, and its mathematical expression is:
where
A denotes the input edge image
, S represents the morphological structuring element, ⊕ denotes the morphological dilation operation, ⊖ denotes the morphological erosion operation, and “∙” denotes the morphological closing operation.
Considering the arc-shaped contour characteristics of irregular light spots, a disk structuring element with a radius of 2 is selected. The disk structuring element exhibits an isotropic property, enabling uniform repair of edge breakages in all directions while avoiding directional deviations caused by rectangular and cross-shaped structuring elements. This makes it better adapted to the irregular edge morphology of distorted light spots.
The closed edges form a complete closed contour. Subsequently, a regional hole-filling algorithm is employed to seamlessly fill all holes inside the closed edges. Taking the closed edges as boundaries, all connected regions within the edges are traversed. After filling, a fracture-free, hole-free, and complete-contour +1st-order spectrum spot region is obtained. This region accurately corresponds to the effective distribution range of the +1st-order complex amplitude, completely shielding against the interference of background noise and irrelevant regions while preserving the complete morphological characteristics of the irregular light spot.
2.4. Maximum Connected Region Selection-Based Precise Centroid Calculation of the +1st-Order Spectrum
First, connected region analysis [
23] is performed on the filled spot image, with the simultaneous extraction of two core features of each connected region. By quantifying the geometric features of connected regions, this step provides a quantifiable judgment basis for subsequent maximum region selection, avoiding the limitation of manual distinction between valid spots and false spots.
Based on the energy distribution characteristics of the OADH spectrum, the +1st-order spectrum spot, as the core region carrying the valid information of the measured object, exhibits the highest energy concentration and corresponds to the largest connected region area. Therefore, the valid spot region is screened using the area maximization criterion, and adaptive processing is performed in two scenarios:
- (a)
Multi-Connected Region Scenario:
When there are multiple connected regions in the filled image, first extract the areas of all regions to form an area array
, then find the maximum value in the array and its corresponding index. The mathematical description is:
where
denotes the area of the maximum connected region,
is the corresponding index of the maximum connected region, and
K represents the number of disjoint foreground regions in the filled image. The centroid
of this region is selected as the precise centroid coordinates of the +1st-order spectrum.
After identifying the maximum connected region corresponding to the +1st-order spectrum, the centroid of this region
is selected as the accurate centroid coordinate of the +1st-order spectrum. This selection is mathematically justified by the approximation of the continuous-domain energy centroid in the discrete domain of digital images, with the centroid calculation weighted by the spectral energy. The area maximization criterion is only used to screen the valid +1st-order spectral region (where Ω denotes the set of pixels in this maximum connected region), and the formula for its gray-value weighted centroid is given by:
- (b)
Simply Connected Region Scenario:
When only one connected region exists in the filled image, this region is exactly the +1st-order spectrum spot region. Its centroid
is directly extracted as the precise centroid coordinates. After selection, the centroid coordinates are decomposed into two-dimensional components, yielding the precise core coordinates of the +1st-order spectrum:
where (
) denotes the optimized precise centroid of the +1st-order spectrum. Compared with the previous rough center coordinates
, this coordinate more accurately reflects the geometric center of the +1st-order spectrum spot, providing a high-precision reference for the subsequent regional extraction of complex amplitude and phase correction.