Spot Invalid Point Repair Algorithm of Detector Array Measurement System Based on Image Correlation Coefﬁcient

: The detector array method has been widely used in the ﬁeld of high-energy laser far-ﬁeld spot parameter measurement due to its ability to directly measure the far-ﬁeld spot of high-energy lasers, wide dynamic range of the detectors, high system sampling frequency, good real-time performance, and suitability for various testing environment requirements. However, during the measurement process, the irradiation of strong lasers or damage to other hardware systems can result in invalid points in the acquired spot images, thereby reducing the measurement accuracy of the system. In order to achieve accurate measurement of laser far-ﬁeld spot parameters, this paper establishes an experimental model based on the analysis of the sampling spacing of the detector array target and proposes a laser far-ﬁeld spot invalid point repair algorithm based on image correlation coefﬁcient. Experimental results demonstrate that the algorithm proposed in this paper effectively reduces the impact of invalid points in the measurement system on the measurement accuracy, and achieves accurate measurement of high-energy laser measurement systems.


Introduction
The detector array method is used to arrange the detectors sensitive to specific wavelengths according to certain rules to form a detector array target.The detectors distributed on the target surface generate electrical signals through the photoelectric effect after being irradiated with the incident laser, and then perform digital conversion processing on the electrical signals to obtain the measurement data of the temporal and spatial distribution of laser intensity [1][2][3].The laser intensity distribution parameters mainly include total laser power, spot center of mass position coordinates, spot diameter, beam quality factor β, and so on.By obtaining these parameters, on the one hand, the experimental data can be used to carry out the study of the laser atmospheric transmission effect; on the other hand, analysis of the laser far-field spot parameters can be used to evaluate the performance parameters of the laser launching system.The detector array method is more and more widely used in laser parameter measurement technology because of its direct measurement of the spot, wide dynamic range of the detector, high system sampling frequency, and good real-time performance, and can be applied to various test environment requirements [4][5][6].The hardware architecture is shown in Figure 1.It can be seen from Figure 1 that a large number of photodetectors are installed on the surface of the detector array target, and each detector is independent of the other on the target surface; that is, when one detector fails, other detectors will not be affected.Several detectors are connected to a first-stage analog switch (generally 16 to 1).When the first-stage analog switch fails, the 16 detectors connected to it cannot work normally, and 16 failure points are generated at 1 time.The signal passing through the first-order analog switch enters the second-order analog switch through the operational amplifier.A secondorder analog switch controls 256 detectors.When the second-order analog switch fails, 256 failure points will be generated on the target surface, which is fatal to the measurement accuracy of the system.Therefore, the reliability of the system is often improved by backup on the second-order analog switch.On the other hand, when the high-energy laser irradiates the surface of the measurement system to generate a failure point, the failure point model generated at this time is also a continuous regional failure point in most cases.Therefore, only the continuous failure point problem of adjacent regions is discussed in this paper.When the measurement system contains regional failure points, the generation of failure points obtained with the measurement system will lead to a decrease in the accuracy of the measurement data.Therefore, in this case, it is necessary to repair and reconstruct the data at the failure point position in the system.
At present, image inpainting technology is divided into two categories.One is digital image inpainting technology for repairing image defects in small-scale space [7][8][9][10][11].This method uses the edge information of the area to be repaired in the damaged image.At the same time, it also uses the method from rough calculation to accurate calculation to It can be seen from Figure 1 that a large number of photodetectors are installed on the surface of the detector array target, and each detector is independent of the other on the target surface; that is, when one detector fails, other detectors will not be affected.Several detectors are connected to a first-stage analog switch (generally 16 to 1).When the first-stage analog switch fails, the 16 detectors connected to it cannot work normally, and 16 failure points are generated at 1 time.The signal passing through the first-order analog switch enters the second-order analog switch through the operational amplifier.A second-order analog switch controls 256 detectors.When the second-order analog switch fails, 256 failure points will be generated on the target surface, which is fatal to the measurement accuracy of the system.Therefore, the reliability of the system is often improved by backup on the second-order analog switch.On the other hand, when the high-energy laser irradiates the surface of the measurement system to generate a failure point, the failure point model generated at this time is also a continuous regional failure point in most cases.Therefore, only the continuous failure point problem of adjacent regions is discussed in this paper.When the measurement system contains regional failure points, the generation of failure points obtained with the measurement system will lead to a decrease in the accuracy of the measurement data.Therefore, in this case, it is necessary to repair and reconstruct the data at the failure point position in the system.
At present, image inpainting technology is divided into two categories.One is digital image inpainting technology for repairing image defects in small-scale space [7][8][9][10][11].This method uses the edge information of the area to be repaired in the damaged image.At the same time, it also uses the method from rough calculation to accurate calculation to estimate the direction of the image's equal illuminance line and uses the propagation Photonics 2023, 10, 1105 3 of 12 mechanism to propagate the information of the intact area in the image to the area to be repaired, and finally realizes the image inpainting of the damaged area.The other is the image completion technology for filling in the lost information of large blocks in the image.At present, this kind of technology also includes the following two methods.One is the repair technology based on image decomposition.The main idea is to decompose the image into structural parts and texture parts.The structural part is repaired using the inpainting algorithm, and the texture part is filled using the texture synthesis method.The other is an image completion algorithm for repairing the image information of large area block damage points in the image [12][13][14][15][16].At present, this algorithm also includes two main methods.The first is the repair technology based on image decomposition.The main idea of this method is to decompose the image to be repaired to obtain the structural part of the image and the part of the image texture.The inpainting algorithm is used to repair the structural part, and the texture synthesis method is used to fill the texture part.Another method is to use texture synthesis technology based on image blocks to fill in the missing information [17][18][19][20][21].This algorithm first selects a pixel point from the boundary of the damaged image repair area that needs to be repaired, and then takes this pixel point as the center to select the appropriate size of the texture block according to the texture features of the image.Finally, the closest texture matching block around the damaged area must be found to replace the texture block in this area, and completion of the repair of the damaged area can take place.

Calculation Method of Spot Parameters in Array Detection Method
According to the requirement of repair and reconstruction of failure points in highenergy laser far-field parameter measurement systems, this paper first introduces the relevant theoretical basis of laser parameter measurements based on the detector array method and the specific calculation method of spot parameters.Then, a digital simulation model is established to analyze the influence of failure points in the measurement system on the measurement accuracy of the system.Finally, according to the correlation of the image in the image sequence collected with the measurement system and the correlation of the energy coefficient, a failure point repair and reconstruction algorithm based on the combination of image structure similarity and spot energy coefficient is proposed.
In the detector array method, the total laser energy can be obtained with Formula (1).
where m represents the number of rows of the detector array, n represents the number of columns of the detector array, and A ij represents the area represented by the detection unit with rows and columns (i, j) (in cm 2 ).In the subsequent research work of this paper, the total power of the spot is characterized by the total ADU (Analog-to-Unit) of the system.The meaning of the diffraction limit factor β is the ratio of the far-field divergence angle of the measured actual laser beam to the far-field divergence angle of the ideal beam.In the detector array method measurement system, its expression can be expressed with Formula (2).
where θ_real is expressed as the far-field divergence angle of the laser beam actually measured, and θ_ideal is the divergence angle of the laser beam under ideal conditions.For the centroid position parameters of the spot, assuming that the acquisition resolution of the measurement system is X × Y, and the pixel value of each point on the image is represented by G(x,y), the position coordinates of the spot centroid can be obtained with Formula (3).

Failure Point Repair Algorithm
The flow chart of the region failure point repair and reconstruction algorithm based on image similarity is shown in Figure 2. Firstly, the position of the failure point is obtained and marked according to the position location algorithm of the failure point in the repair process, and then the template image of the failure point position is obtained by extending several pixels outward with the center position of the failure point.During the expansion process, all positions in the failure point area are included in the template image.Then, starting from the upper left corner of the first frame image of the spot image sequence, the matching template is obtained with the same size as the failure point template.In the internal area of the template, the pixel value is set to zero according to the position of the failure point, and the matching template is slid with a step size of one pixel until all areas of the original image are traversed.After obtaining the matching templates at different positions, the correlation coefficient between the template and the failure point template is calculated according to the image similarity calculation formula [22].The optimal matching block is found by calculating the correlation coefficient.The optimal matching block is filled according to the location area of the failure point found in the above steps to complete the repair of the failure point in the image of the failure block.This process starts from the first frame of the sequence image to the end of the last frame.

Failure Point Repair Algorithm
The flow chart of the region failure point repair and reconstruction algorithm based on image similarity is shown in Figure 2. Firstly, the position of the failure point is obtained and marked according to the position location algorithm of the failure point in the repair process, and then the template image of the failure point position is obtained by extending several pixels outward with the center position of the failure point.During the expansion process, all positions in the failure point area are included in the template image.Then, starting from the upper left corner of the first frame image of the spot image sequence, the matching template is obtained with the same size as the failure point template.In the internal area of the template, the pixel value is set to zero according to the position of the failure point, and the matching template is slid with a step size of one pixel until all areas of the original image are traversed.After obtaining the matching templates at different positions, the correlation coefficient between the template and the failure point template is calculated according to the image similarity calculation formula [22].The optimal matching block is found by calculating the correlation coefficient.The optimal matching block is filled according to the location area of the failure point found in the above steps to complete the repair of the failure point in the image of the failure block.This process starts from the first frame of the sequence image to the end of the last frame.For the repair and reconstruction of the failure point of the detector array target measurement system, the first step is to extract the position information of the failure point according to the image information.When the failure point is a static failure point, For the repair and reconstruction of the failure point of the detector array target measurement system, the first step is to extract the position information of the failure point according to the image information.When the failure point is a static failure point, the response value at its location is a fixed value, which is shown as a dark point or a saturation point on the image.When the failure point is a dynamic failure point, the response value is normal within a certain range, but when it exceeds a certain threshold, the response is not normal.In this paper, the dynamic threshold algorithm is used to detect the location of the failure point [23].First, the integral spot image is filled with two rows and two columns to the outside, and the image is traversed with a 3 × 3 template.At each position, the 8 pixel values around the center of the template are sorted, and the pixel values of the two points in the middle are taken as the weighted mean, which is recorded as Value0.Then, the 8 adjacent pixel values are reordered in the order from large to small.In the sorting process, the maximum value, the minimum value, and the middle two values are removed, which are recorded as value 1 , value 2 , value 3 , and value 4 , respectively.Then, the dynamic threshold k at this position can be calculated with Formula (4).
After obtaining the dynamic threshold k, according to Formula (5), it can be judged whether the point is a failure point.If the pixel value g (x,y) of this position is within its range, it can be considered as a normal response point; otherwise, it can be regarded as a failure point.
After obtaining the position information of the failure point with the above method, the failure point position template shown in step 1 of Figure 2 can be obtained by spreading a pixel outward from the center point, which is recorded as G1.The image is traversed with a template of the same size to obtain a matching template.Each matching template is assigned a value according to the pixel value at the position of its failure point, and the matching template in step 2 shown in Figure 2 can be obtained, denoted as G2.After obtaining the failure point position template G1 and the matching template, it is necessary to calculate the correlation between the two.The methods for calculating the image correlation mainly include an evaluation method based on the histogram correlation coefficient, evaluation method based on mean square error, evaluation method based on peak signalto-noise ratio and evaluation method based on image structure similarity.However, in the correlation calculation of the laser spot image, the similarity of the two images cannot be simply considered, and the difference in the total pixel value of the two images and the difference in the structure should be considered.The calculation method based on image structure similarity has this characteristic.Therefore, when calculating the correlation between the failure point location template and the matching template, the image structure similarity is used as a measure to evaluate its similarity.The evaluation method of image structural similarity fully considers the three-feature information of brightness, contrast, and structural degree between images.The structural information of images is defined as a structural attribute independent of image brightness and contrast, and the distortion model is used as a combination of image brightness, image contrast, and image structural degree.The calculation method is shown in Formulas ( 6)- (9).
where x represents the template image, y is the contrast image, µ x and µ y are the mean values of the two images, σ x and σ y are the standard deviations of the images, σ xy is the covariance of the two images, and C 3 = C 2 /2 is in the simplified mode.By calculating the failure point template and the matching template, the correlation coefficient matrix in step3 of Figure 2 can be obtained.Since the value range of x is between 0 and 1, the stronger the correlation between the two images, the closer the calculation result is to 1. Therefore, the restoration and reconstruction of the pixel value of the failure point position can be realized by retrieving the coefficient matrix.It is worth noting that when the failure point position in the image is not completely filled after one repair, the above steps need to be repeated until the pixel values at all failure point positions are completely filled.

System Sampling Resolution Analysis
The detector array method samples the incident laser beam through the detection unit, transforms the far-field spot image into a discrete dot matrix signal on the two-dimensional plane, and finally processes the discrete dot matrix signal through the data processing unit to obtain the spatial and temporal distribution intensity parameters of the incident beam.Due to the limitation of space physics and the development cost of the measurement system, the detector sampling units on the target surface cannot be closely arranged together.The spacing distance between two adjacent detectors in Figure 1 is expressed as the sampling resolution of the system.When the incident laser is irradiated on the target surface, the photoelectric response occurs at the position where the target surface contains the detector.The optical signal is converted into a digital signal and then stored and calculated in the form of an image matrix.Due to the limitation of research and development costs and physical size, there is a certain interval between detectors.Therefore, when analyzing the influence of failure points on measurement accuracy, it is necessary to establish a reasonable system sampling interval.
In this section, while aiming to investigate the influence of sampling resolution on the measurement accuracy of the system in the detector array target measurement system, a laser transmission model under three different turbulence intensities is constructed with the laser emission system output wavelength of 1064 nm; the laser transmission distance of L = 2 km; the laser emission aperture of D = 400 mm; the laser emission system transmission beam quality factor β 0 = 3 in vacuum; and the atmospheric coherence length of 2 cm, 4 cm, 6 cm, and 8 cm at the wavelength of 1064 nm.The far-field spot images under different turbulence intensities are sampled with different sampling intervals to obtain the sampled spot, and the sampled spot image is interpolated to make the resolution of the spot image the same as the resolution of the original spot.Finally, the spot parameters described in Section 2.1 of this paper are used for the calculations, respectively, and then the influence of the sampling interval of the measurement accuracy in the measurement system is analyzed.A total of 100 frames of original spot images are generated and transmitted through different turbulence intensity environments, and integral spot images under different turbulence intensities are obtained, as shown in Figure 3.The pixel resolution of the spot image is 512 pixels × 512 pixels.The pixel size of the single pixel is 0.92 mm.The original spot in the above image is downsampled according to different sampling intervals, and then the sampled discrete spot is interpolated to obtain the restored spot image.According to the calculation method described in Section 2.1 of this paper, the original spot and the restored spot are processed and compared to obtain the relationship between the system measurement accuracy and the detector array sampling resolution.Simulation experiments are carried out according to different sizes of spots and sampling resolutions.Therefore, the whole experiment is divided into spot downsampling processing, spot image restoration, and spot parameter calculation.
When sampling the spot images of different sizes, the influence of different sampling points on the calculation error of laser parameters must be considered.Under the premise of ensuring that the target surface can receive all the spots, the 100 frames of spot sequence images are downsampled at the sampling intervals of 3.68 mm, 4.66 mm, 5.52 mm, 6.44 mm, 7.36 mm, 8.28 mm, and 9.20 mm, respectively, to obtain the discrete sampling spots.After obtaining the spots with different sampling resolutions, the bilinear interpolation algorithm is used to interpolate the sampling spots.The pixel size of the interpolated image is consistent with that of the original spot.
After obtaining the restored spot images under different sampling resolutions, the original spot and the restored 100-frame spot images are calculated to obtain the relationship between the spot parameter error data under different turbulence intensities and the system sampling spacing.The instantaneous spot parameters of 100 frames calculated above are counted, and the statistical results are expressed as a standard deviation.The error relationship curve between the spot parameters and the sampling interval is shown in Figure 4.The original spot in the above image is downsampled according to different sampling intervals, and then the sampled discrete spot is interpolated to obtain the restored spot image.According to the calculation method described in Section 2.1 of this paper, the original spot and the restored spot are processed and compared to obtain the relationship between the system measurement accuracy and the detector array sampling resolution.Simulation experiments are carried out according to different sizes of spots and sampling resolutions.Therefore, the whole experiment is divided into spot downsampling processing, spot image restoration, and spot parameter calculation.
When sampling the spot images of different sizes, the influence of different sampling points on the calculation error of laser parameters must be considered.Under the premise of ensuring that the target surface can receive all the spots, the 100 frames of spot sequence images are downsampled at the sampling intervals of 3.68 mm, 4.66 mm, 5.52 mm, 6.44 mm, 7.36 mm, 8.28 mm, and 9.20 mm, respectively, to obtain the discrete sampling spots.After obtaining the spots with different sampling resolutions, the bilinear interpolation algorithm is used to interpolate the sampling spots.The pixel size of the interpolated image is consistent with that of the original spot.
After obtaining the restored spot images under different sampling resolutions, the original spot and the restored 100-frame spot images are calculated to obtain the relationship between the spot parameter error data under different turbulence intensities and the system sampling spacing.The instantaneous spot parameters of 100 frames calculated above are counted, and the statistical results are expressed as a standard deviation.The error relationship curve between the spot parameters and the sampling interval is shown in Figure 4.
It can be seen from Figure 4 that, when the turbulence intensity on the laser transmission path is constant, the spot parameter error calculated with the measurement system increases with the increase of the sampling interval.When the sampling interval of the system is less than 4 mm, the calculated spot ADU peak error, spot centroid position coordinate error, and spot total ADU error decrease with the decrease of turbulence intensity.When the sampling interval of the system is greater than 4 mm, the calculated parameter errors increase with the decrease in turbulence intensity.This is due to the fact that when the turbulence intensity is large, the spot diameter from the far field to the target spot is continuously expanded and the degree of fragmentation inside the spot is more intense.When the sampling spacing is small, the system can detect smaller speckles, thereby reducing the system measurement error.However, the calculated error is close to the real spot.From the above analysis, it can be seen that it is reasonable to select the sampling interval of 5.52 mm.

Failure Point Repair
Based on the above analysis, we sample the spot in Figure 3 with a sampling space of 5.5 mm, and add a failure point to the sampling spot.According to the algorithm proposed in this paper, the image containing the failed spot is repaired and reconstructed.In addition, the control group processes them with the mean filtering algorithm [24], respectively, and the obtained spot image is shown in Figure 5.
ordinate error, and spot total ADU error decrease with the decrease of turbulence intensity.When the sampling interval of the system is greater than 4 mm, the calculated parameter errors increase with the decrease in turbulence intensity.This is due to the fact that when the turbulence intensity is large, the spot diameter from the far field to the target spot is continuously expanded and the degree of fragmentation inside the spot is more intense.When the sampling spacing is small, the system can detect smaller speckles, thereby reducing the system measurement error.However, the calculated error is close to the real spot.From the above analysis, it can be seen that it is reasonable to select the sampling interval of 5.52 mm.

Failure Point Repair
Based on the above analysis, we sample the spot in Figure 3 with a sampling space of 5.5 mm, and add a failure point to the sampling spot.According to the algorithm proposed in this paper, the image containing the failed spot is repaired and reconstructed.In addition, the control group processes them with the mean filtering algorithm [24], respectively, and the obtained spot image is shown in Figure 5.It can be seen from the above figures that, when there is a single regional failure spot module in the measurement system, the algorithm proposed in this paper can effectively repair and reconstruct the failure spot data, which is intuitively superior to the data processing algorithm of error spot filtering.In addition, the spot image processing under different turbulence intensities fully proves the robustness of the algorithm.

Figure 1 .
Figure 1.Structure diagram of detector array method: (a) Mechanical structure diagram.(b) Electrical structure diagram.

Figure 1 .
Figure 1.Structure diagram of detector array method: (a) Mechanical structure diagram.(b) Electrical structure diagram.

Figure 2 .
Figure 2. Spot image restoration algorithm based on structural similarity.

Figure 2 .
Figure 2. Spot image restoration algorithm based on structural similarity.