Spectral line peak detection method and device, storage medium and computer equipment

By combining overall peak finding and local peak finding strategies and utilizing the Lorentz fitting method, the problem of high speed and high accuracy in spectral line peak detection on high-speed linear confocal equipment is solved, improving detection speed and accuracy. It is applicable to products such as laser confocal, white light interferometry, and ultra-depth of field.

CN121783873APending Publication Date: 2026-04-03MOTIC CHINA GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-05
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve both high-speed and high-precision peak detection of spectral lines on high-speed linear confocal devices, and neglect the continuity between adjacent positions of spectral lines, thus preventing further improvements in detection speed.

Method used

A strategy combining overall and local peak finding is adopted. Peak detection is performed on the spectral line image using the Lorentz fitting method. Taking advantage of the continuity between adjacent positions of the spectral line, the entire peak data is fitted when peak finding fails at the initial position or the previous position. When peak finding is successful at the previous position, local peak data is obtained based on the peak position of the previous position and fitted.

Benefits of technology

It improves the speed and accuracy of spectral line peak detection, reduces computing hardware requirements, enhances the competitiveness of line confocal products, and is suitable for products with real-time peak detection such as laser confocal, white light interferometry, and super depth of field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121783873A_ABST
    Figure CN121783873A_ABST
Patent Text Reader

Abstract

According to the spectral line peak value detection method and device, the storage medium and the computer equipment provided by the invention, the continuity between adjacent positions of the spectral lines is effectively utilized by combining overall peak searching and local peak searching strategies. When the peak searching at the initial position or the previous position fails, Lorentz fitting is performed on the whole wave crest data at the current position, so that the accuracy of peak detection is ensured; and when the peak searching at the previous position succeeds, the local peak data of the current position is obtained based on the peak value position of the previous position for fitting, so that the data processing amount is greatly reduced, the detection speed is improved, the requirement of calculation hardware is reduced, and the cost is reduced. According to the spectral line peak value detection method, on the basis of ensuring the detection precision, the detection speed is greatly improved, the competitiveness of a line confocal product is further improved, and an improved option is provided for other products needing real-time peak value detection, such as laser confocal, white light interference and super field depth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of spectral detection technology, and in particular to a method, apparatus, storage medium and computer equipment for detecting spectral line peaks. Background Technology

[0002] With the rapid development of micro- and nano-sized processing and manufacturing technologies in recent years, the demand for corresponding precision measurement technologies has also increased significantly. The latter plays a crucial role in the former's model design, quality control, and process optimization. Spectral confocal microscopy is a micro- and nano-sized measurement technology. Based on confocal microscopy and combined with optical dispersion phenomena, it focuses different wavelengths of light from a broadband light source, such as white light (after passing through a dispersive objective lens), onto different axial positions. This allows for the establishment of a wavelength-position mathematical model along the optical axis before measurement (typically using a plane mirror and a high-precision Z-axis). During measurement, by extracting the focused wavelength of the reflected light from the surface under test, the axial position (height) of the surface can be calculated using this model. Its technical principle is as follows: Figure 1 As shown, Figure 1 A schematic diagram of the spectral confocal technique and the position-wavelength mathematical model provided in this application; Figure 1 (a) illustrates the basic principle of spectral confocal technology: light of wavelength (e.g., λ2) focused on the surface of an object is reflected and focused onto a conjugate pinhole, forming a corresponding peak on a photodetector (e.g., a spectrometer). Figure 1 (b) in the figure represents the position-wavelength mathematical model: light of different wavelengths is focused at different axial positions, thus forming a wavelength-position relationship curve.

[0003] Linear confocalization is a type of spectral confocalization. Its characteristic is that it transforms the point light source into a surface light source, replacing the pinhole with a slit. This creates a series of peaks (forming spectral lines) corresponding to the slit in the photodetector, allowing the axial position of a series of points (a line) to be obtained simultaneously through algorithms, greatly improving measurement efficiency. For example... Figure 2 As shown, Figure 2 This is a schematic diagram of the line confocal spectral lines provided in this application. Figure 2 In the diagram, at each position along the slit direction (the horizontal direction in the above figure, also known as the spectral line direction) (corresponding to each column in the above figure, represented by white dashed lines), there is a peak (red lines, describing the brightness change of the current column). Currently, line confocal scanning is widely used in 3D reconstruction, defect detection, surface roughness measurement, and thickness measurement due to its high precision (down to submicron), non-contact operation, fast scanning speed, and good adaptability (capable of scanning transparent and reflective surfaces).

[0004] As the foregoing analysis shows, in online confocal technology, both the wavelength-position model that needs to be established before measurement and the focused wavelength of the reflected light from the surface under test that needs to be extracted in real time during measurement rely on peak (position) detection algorithms or peak-finding algorithms for the peaks formed in the photodetector. The accuracy and speed of this algorithm are among the key factors of the entire measurement system. Currently, all peak-finding algorithms can be divided into two categories: fitting and non-fitting. The former has higher accuracy than the latter, while the latter is faster than the former. As the data acquisition efficiency of photodetectors (such as image sensors) increases, online confocal technology is also developing towards high speed. However, this often contradicts high accuracy: in order to keep up with the acquisition speed, the peak-finding algorithm needs to be ported to parallel processors such as GPUs. However, the current high-precision peak-finding algorithms based on fitting rely on complex mathematical and logical operations (for example, Gaussian fitting is a nonlinear optimization problem that needs to be solved using iterative methods), which are difficult to implement on these devices, making it difficult to achieve high-precision peak detection on high-speed online confocal devices. On the other hand, existing algorithms treat each point on the peak curve as a discrete individual (each point uses the same peak data length for peak finding), ignoring the continuity between adjacent positions of the spectral lines, which is one of the reasons why the detection speed has not been further improved. Summary of the Invention

[0005] The purpose of this application is to at least solve one of the aforementioned technical defects, particularly the technical defect in the prior art that it is impossible to combine high speed and high precision when performing peak detection on high-speed linear confocal equipment.

[0006] This application provides a method for detecting spectral line peaks, the method comprising:

[0007] A spectral line image is obtained by scanning each sample point on the sample line of the sample surface under test using the line confocal technique. Each column of coordinates in the spectral line image represents the position of a sample point.

[0008] Using the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure.

[0009] If the peak finding result is a peak finding failure, then the entire peak data at the current position is obtained from the spectral line image, and after Lorentz fitting of the entire peak data, the peak position of the entire peak data is determined according to the first fitting result.

[0010] If the peak finding result is successful, the peak position of the previous column of coordinates is obtained, and the local peak data of the current position is obtained from the spectral line image based on the peak position of the previous column of coordinates. After Lorentz fitting of the local peak data, the peak position of the local peak data is determined based on the second fitting result.

[0011] Determine whether the current position is the last column of coordinates in the spectral line image. If so, end the detection process; otherwise, take the next column of coordinates in the spectral line image as the current position and return to execute the peak finding result of obtaining the previous column of coordinates in the spectral line and its subsequent steps.

[0012] Optionally, determining the peak position of the entire peak data based on the first fitting result after performing Lorentz fitting on the entire peak data includes:

[0013] Find the point where the first maximum brightness value is located from the entire peak data, and determine whether the first maximum brightness value at that point is less than the first preset brightness threshold.

[0014] If the first maximum brightness value of the point is less than the first preset brightness threshold, the peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps.

[0015] If the first maximum brightness value at a point is not less than the first preset brightness threshold, then the first peak region data of the point where the first maximum brightness value is located is extracted from the entire peak data, and after Lorentz fitting of the first peak region data, the peak position of the entire peak data is determined according to the first fitting result.

[0016] Optionally, determining the peak position of the entire wave peak data based on the first fitting result after performing Lorentz fitting on the first peak region data includes:

[0017] After calculating the full width of the first half-peak of the first peak region data, it is determined whether the full width of the first half-peak is less than a first preset width threshold.

[0018] If the full width of the first half-peak is less than the first preset width threshold, peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps.

[0019] If the full width of the first half-peak is not less than the first preset width threshold, then the peak finding is successful. After Lorentz fitting of the first peak region data within the full width of the first half-peak, the peak position of the entire wave peak data is determined according to the first fitting result.

[0020] Optionally, the step of performing Lorentz fitting on the first peak region data within the full width of the first half-peak, and then determining the peak position of the entire peak data based on the first fitting result, includes:

[0021] Data transformation is performed on the data of the first peak region within the full width of the first half-peak to obtain the target data;

[0022] Based on the parabolic equation of the Lorentz function, construct a system of linear equations corresponding to the target data;

[0023] The linear equations are optimized and solved using GPU parallel processing, and the peak position of the entire wave peak data is determined based on the solution results.

[0024] Optionally, determining the peak position of the local peak data based on the second fitting result after performing Lorentz fitting on the local peak data includes:

[0025] Find the point where the second maximum brightness value is located from the local peak data, and determine whether the second maximum brightness value at that point is less than the second preset brightness threshold.

[0026] If the second maximum brightness value of the point is less than the second preset brightness threshold, the peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps.

[0027] If the second maximum brightness value at that point is not less than the second preset brightness threshold, then the second peak region data of the point where the second maximum brightness value is located is extracted from the local peak data, and after Lorentz fitting of the second peak region data, the peak position of the entire peak data is determined according to the second fitting result.

[0028] Optionally, after performing Lorentz fitting on the second peak region data, determining the peak position of the entire peak data based on the second fitting result includes:

[0029] After calculating the full width of the second half-peak of the second peak region data, it is determined whether the full width of the second half-peak is less than the second preset width threshold.

[0030] If the full width of the second half-peak is less than the second preset width threshold, peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps.

[0031] If the full width of the second half-peak is not less than the second preset width threshold, then the peak finding is successful. After Lorentz fitting of the second peak region data within the full width range of the second half-peak, the peak position of the local peak data is determined according to the second fitting result.

[0032] Optionally, before performing Lorentz fitting on the entire peak data, the method further includes:

[0033] The entire peak data is denoised, and the denoised entire peak data is then Lorentz fitted.

[0034] Before performing Lorentz fitting on the local peak data, the method further includes:

[0035] The local peak data is denoised, and the denoised local peak data is then Lorentz fitted.

[0036] This application also provides a spectral line peak detection device, comprising:

[0037] The image acquisition module is used to acquire spectral line images obtained when scanning each sample point on the sample line of the sample surface under test using line confocal technology, wherein each column of coordinates in the spectral line image represents the position of a sample point.

[0038] An initialization module is used to take the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure.

[0039] The overall peak finding module is used to obtain the entire peak data at the current position from the spectral line image if the peak finding result is peak finding failure, and after performing Lorentz fitting on the entire peak data, determine the peak position of the entire peak data according to the first fitting result.

[0040] The local peak finding module is used to obtain the peak position of the previous column of coordinates if the peak finding result is successful, and obtain the local peak data of the current position from the spectral line image according to the peak position of the previous column of coordinates. After Lorentz fitting the local peak data, the peak position of the local peak data is determined according to the second fitting result.

[0041] The loop execution module is used to determine whether the current position is the last column of coordinates in the spectral line image. If so, the detection process ends; otherwise, the next column of coordinates in the spectral line image is taken as the current position, and the process returns to execute the peak finding result of obtaining the previous column of coordinates in the spectral line and its subsequent steps.

[0042] This application also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the spectral line peak detection method as described in any of the above embodiments.

[0043] This application also provides a computer device, including: one or more processors, and memory;

[0044] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the spectral line peak detection method as described in any of the above embodiments.

[0045] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0046] The spectral line peak detection method, apparatus, storage medium, and computer equipment provided in this application effectively utilize the continuity between adjacent positions of the spectral line by combining a global peak-finding and a local peak-finding strategy. When peak-finding fails at the initial position or the previous position, Lorentz fitting is performed on the entire peak data at the current position to ensure the accuracy of peak detection. Conversely, when peak-finding is successful at the previous position, local peak data at the current position is obtained based on the peak position of the previous position for fitting, greatly reducing the amount of data processing, thereby improving the detection speed and lowering the requirements for computing hardware, thus reducing costs. The spectral line peak detection method of this application greatly improves the detection speed while ensuring detection accuracy, further enhancing the competitiveness of line confocal products and providing an improved option for other products requiring real-time peak detection, such as laser confocal, white light interferometry, and super depth-of-field methods. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A schematic diagram of the spectral confocal technique and the position-wavelength mathematical model provided in this application;

[0049] Figure 2 A schematic diagram of the line confocal spectral lines provided in this application;

[0050] Figure 3 A schematic flowchart of a spectral line peak detection method provided in an embodiment of this application;

[0051] Figure 4 This is a schematic diagram of the step edge position in a spectral line image obtained when detecting step height, as provided in an embodiment of this application.

[0052] Figure 5A schematic diagram of the spectral line peak detection process based on local priority provided in an embodiment of this application;

[0053] Figure 6 A schematic diagram of the Lorentz fitting result of peak data at one location in a spectral line image provided in an embodiment of this application;

[0054] Figure 7 A schematic diagram of the Gaussian fitting result of peak data at another location in the spectral line image provided in this application embodiment;

[0055] Figure 8 This is a schematic diagram of the image to be tested provided in an embodiment of this application;

[0056] Figure 9 A schematic diagram of the peak values ​​obtained by fitting the test image with Gaussian and Lorentz respectively, as provided in the embodiments of this application;

[0057] Figure 10 Peak difference distribution maps obtained by fitting the test image with Gaussian and Lorentz respectively, as provided in the embodiments of this application;

[0058] Figure 11 The test image set provided in this application embodiment when testing 5601 spectral line images using the above algorithm;

[0059] Figure 12 A schematic diagram showing the speed comparison between local priority search and current global search provided in the embodiments of this application;

[0060] Figure 13 This is a schematic diagram of the structure of a spectral line peak detection device provided in an embodiment of this application;

[0061] Figure 14 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0062] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] In one embodiment, such as Figure 3 As shown, Figure 3 This is a flowchart illustrating a method for detecting spectral line peaks provided in an embodiment of this application; this application provides a method for detecting spectral line peaks, the method comprising:

[0064] S110: Acquire the spectral line image obtained when scanning each sample point on the sample line of the sample surface under test using the line confocal technique. Each column of coordinates in the spectral line image represents the position of a sample point.

[0065] In this step, the surface of the sample to be tested is scanned by line confocal technology, which can generate a spectral line image containing rich position and brightness information. Each column of coordinates precisely corresponds to the position of a sample point, laying the foundation for accurate peak detection in the future.

[0066] In practice, line confocal technology, with its unique optical principles, enables high-speed, non-contact scanning of sample surfaces. This avoids potential damage caused by contact and is adaptable to samples with varying materials and surface properties, such as transparent and reflective surfaces. During scanning, a photodetector captures reflected light in real time, converting it into electrical signals, which are then processed to form a spectral line image. This image visually presents the brightness variations at different locations on the sample surface, and the brightness peaks are often closely related to important surface features such as height variations and defects. Therefore, accurately detecting the peak positions in the spectral line image is crucial for applications such as 3D reconstruction of sample surfaces, defect detection, surface roughness measurement, and thickness measurement.

[0067] S120: Using the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line image, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure.

[0068] In this step, after obtaining the spectral line image obtained by scanning each sample point on the sample line of the sample surface to be tested using the line confocal technique in S110, this application can detect the peak value at each column coordinate in the spectral line image. During detection, this application can take the current column coordinate in the spectral line image as the current position and obtain the peak finding result of the previous column coordinate in the spectral line so as to determine the peak position of the current column coordinate based on the peak finding result of the previous column coordinate.

[0069] Understandably, for the first column of coordinates in a spectral image, since there is no preceding column, this application can set the peak finding result of the preceding column corresponding to the first column as peak finding failure, so that the peak position of the first column can be detected subsequently using the overall peak finding method. In practical applications, this setting method can ensure the integrity and accuracy of the entire detection process, avoiding errors or omissions in the detection process due to the special case of the first column coordinates.

[0070] Specifically, when performing peak detection, this application treats each column of coordinates in the spectral line image as an independent detection unit, and detects them sequentially from left to right. When detecting each column of coordinates, the peak-finding result of the previous column is checked first. If the peak-finding result of the previous column is "peak-finding failed," or if the current column is the first column (whose peak-finding result is pre-set to be "peak-finding failed"), then the peak position of the current column is detected using an overall peak-finding method. If the peak-finding result of the previous column is "peak-finding successful," then the peak position of the current column is detected using a local peak-finding method.

[0071] S130: If the peak finding result is a failure, then obtain the entire peak data at the current position from the spectral line image, perform Lorentz fitting on the entire peak data, and determine the peak position of the entire peak data based on the first fitting result.

[0072] In this step, if the peak finding result obtained through S120 for the previous column of coordinates is "peak finding failed," it indicates that the previous column of coordinates does not exist, there may not be a clear peak at the previous column of coordinates, or the peak cannot be accurately detected due to factors such as noise. In this case, this application chooses to obtain the entire peak data of the current position from the spectral line image. This data contains all possible peak information at the current position.

[0073] Next, this application can perform Lorentz fitting on the entire peak data. Lorentz fitting is a commonly used peak fitting method that can effectively extract the characteristic parameters of the peak data, such as peak position, peak height, and full width at half maximum (FWHM). Finally, based on the first fitting result, this application can determine the peak position of the entire peak data, thereby achieving peak detection at the current position.

[0074] S140: If the peak finding result is successful, obtain the peak position of the previous column of coordinates, and obtain the local peak data of the current position from the spectral line image based on the peak position of the previous column of coordinates. After Lorentz fitting of the local peak data, determine the peak position of the local peak data based on the second fitting result.

[0075] In this step, when the peak finding result obtained through S120 is "peak finding successful," it indicates that there is a significant peak at the previous coordinate position, and the position of this peak has been accurately detected. In this case, considering the continuity of the surface of the object under test in the axial (height direction), the peak positions of adjacent positions on the corresponding obtained spectral lines are also continuous. This application can utilize the continuity between adjacent positions of spectral lines to infer the possible peak position at the current position based on the peak position of the previous coordinate.

[0076] Specifically, this application can obtain local peak data of the current position from the spectral line image based on the peak position of the previous column of coordinates. This data only contains a portion of the peak information near the current position, thus the data processing volume is relatively small. For example, this application can set the current position... The peak data at the location is The corresponding peak position is :

[0077] ,

[0078] in, It refers to the length of the spectral lines in the spectral image, corresponding to the width of a photodetector, such as an image sensor. For column coordinate indexes in the spectral line image, It is the length of the peak data, corresponding to the height of a photodetector, such as an image sensor. This refers to the row coordinate index in the spectral line image. This is the ordinate of the peak curve at the current position, i.e., the brightness value. Then the next position... peak at the point peak position It is highly likely that in Found inside, among which, This is the preset neighborhood radius, which is an empirical value and is set as an adjustable parameter of the algorithm. Generally, setting it to 50 is sufficient.

[0079] Therefore, this application can be submitted first. local area Searching for Since the spectral line is continuous between positions in most cases, this local peak-finding strategy will significantly reduce computational load, thereby improving the detection efficiency of the entire spectral line. Furthermore, considering the position... Relative position Mutations may have occurred (e.g.) Figure 4 As shown, Figure 4 (This is a schematic diagram of the step edge position in the spectral line image obtained when detecting the step height according to the embodiment of this application). If peak finding fails in the above local area, a second peak finding needs to be performed on the global peak.

[0080] Once this application obtains the local peak data at the current location, it can perform Lorentz fitting on the local peak data to obtain its characteristic parameters. Finally, this application can determine the peak position of the local peak data based on the second fitting result, thereby achieving peak detection at the current location. This method can significantly reduce the amount of data processing, improve the detection speed, and ensure detection accuracy by utilizing the continuity between adjacent positions.

[0081] S150: Determine whether the current position is the last column of coordinates in the spectral line image. If so, end the detection process; otherwise, take the next column of coordinates in the spectral line image as the current position and return to execute steps S110~S150.

[0082] In this step, after completing peak detection at the current position via S130 or S140, this application needs to determine whether the current position is the last column of coordinates in the spectral line image. If it is the last column of coordinates, it means that peak detection for the entire spectral line image has been completed, and the detection process can end. If it is not the last column of coordinates, it means that peak detection is still needed for subsequent positions. In this case, this application uses the next column of coordinates in the spectral line image as the current position and returns to execute steps S110~S150 to perform peak detection for the next position. In this way, this application can achieve peak detection at all positions in the spectral line image, thereby obtaining complete peak distribution information.

[0083] In a specific implementation, such as Figure 5 As shown, Figure 5 A schematic diagram of the spectral line peak detection process based on local priority provided in an embodiment of this application; Figure 5 The steps in the process are detailed below:

[0084] Step 1: Set the peak position variable to c, initialized to 0, representing the position of the first peak on the spectral line; set the flag variable indicating whether the peak finding at the previous position was successful to b, initialized to false, indicating failure; set the peak position variable of the previous peak to... ;

[0085] Step 2: For the current position c, check the value of the current flag b:

[0086] Step 2.1: If the value of b is false, then obtain the entire peak data at the current position from the spectral line image. Then, peak finding is performed based on the entire peak data. If peak finding is successful, its peak position is used. Update Then set the value of flag b to true and proceed to Step 3; otherwise, set the value of flag b to false and proceed to Step 3.

[0087] Step 2.2: If the value of b is true, then obtain the local peak data at the current location from the spectral line image. The peak is then located based on local peak data. If the peak is successfully located, its peak position is used. Update Then set the value of flag b to true and proceed to Step 3; otherwise, obtain the entire peak data at the current position from the spectral line image. Use the algorithm in 1) to find the peak; if successful, use its peak position. Update Then set the value of flag b to true and proceed to Step 3; otherwise, set the value of flag b to false and proceed to Step 3.

[0088] Step 3 If Then update the variable. Then return to Step 2, if If the test is completed, the testing process ends.

[0089] In the above embodiments, by combining the strategies of overall peak finding and local peak finding, the continuity between adjacent positions of the spectral line is effectively utilized. When peak finding fails at the initial position or the previous position, Lorentz fitting is performed on the entire peak data at the current position to ensure the accuracy of peak detection. When peak finding is successful at the previous position, local peak data at the current position is obtained based on the peak position of the previous position for fitting, which greatly reduces the amount of data processing, thereby improving the detection speed and reducing the requirements for computing hardware, thus reducing costs. The spectral line peak detection method of this application greatly improves the detection speed while ensuring detection accuracy, further increasing the competitiveness of line confocal products and providing an improved option for other products that require real-time peak detection, such as laser confocal, white light interferometry, and super depth of field.

[0090] In one embodiment, after performing Lorentz fitting on the entire peak data in S130, determining the peak position of the entire peak data based on the first fitting result may include:

[0091] S131: Find the point where the first maximum brightness value is located from the entire peak data, and determine whether the first maximum brightness value at that point is less than the first preset brightness threshold.

[0092] S132: If the first maximum brightness value of the point is less than the first preset brightness threshold, then the peak finding fails, and the process returns to the step of determining whether the current position is the last column coordinate in the spectral line image and its subsequent steps.

[0093] S133: If the first maximum brightness value of the point is not less than the first preset brightness threshold, then extract the first peak region data of the point where the first maximum brightness value is located from the entire peak data, and after Lorentz fitting the first peak region data, determine the peak position of the entire peak data according to the first fitting result.

[0094] In this embodiment, during the process of performing Lorentz fitting on the entire peak data to determine the peak position, it is first necessary to locate the point where the first maximum brightness value is located from the entire peak data. This step is crucial because it directly affects the accuracy of subsequent fitting and the reliability of peak detection. The first maximum brightness value is the extreme brightness point in the entire peak data, and its magnitude reflects the intensity of light at that location.

[0095] After obtaining the point where the first maximum brightness value is located, it is necessary to further determine whether the first maximum brightness value of this point is less than a first preset brightness threshold. The first preset brightness threshold is a threshold pre-set according to the actual application scenario and detection requirements, used to determine whether there is a significant peak at the current position. If the first maximum brightness value of this point is less than the first preset brightness threshold, it means that the light intensity at the current position is weak, and there may be no significant peak. In this case, peak finding fails, and the process returns to determine whether the current position is the last column of coordinates in the spectral line image and its subsequent steps, so as to detect the next position.

[0096] If the first maximum brightness value at a point is not less than a first preset brightness threshold, it indicates that there is a significant peak at the current location. In this case, the first peak region data of the point containing the first maximum brightness value can be extracted from the entire peak data. The first peak region data refers to data including the point containing the first maximum brightness value and a certain range nearby; this data can more accurately reflect the characteristics of the peak. Next, this application can perform Lorentz fitting on the first peak region data. Lorentz fitting can effectively extract the characteristic parameters of the peak data, such as peak position, peak height, and full width at half maximum (FWHM). Finally, based on the first fitting result, the peak position of the entire peak data is determined, thereby achieving accurate peak detection at the current location.

[0097] In one embodiment, after performing Lorentz fitting on the first peak region data in S133, determining the peak position of the entire wave peak data based on the first fitting result may include:

[0098] S1331: After calculating the full width of the first half-peak of the first peak region data, determine whether the full width of the first half-peak is less than the first preset width threshold.

[0099] S1332: If the full width of the first half-peak is less than the first preset width threshold, then the peak finding fails, and the process returns to the step of determining whether the current position is the last column coordinate in the spectral line image and its subsequent steps.

[0100] S1333: If the full width of the first half-peak is not less than the first preset width threshold, then the peak finding is successful, and after Lorentz fitting of the first peak region data within the full width of the first half-peak, the peak position of the entire wave peak data is determined according to the first fitting result.

[0101] In this embodiment, when performing Lorentz fitting on the data of the first peak region, the full width of the first half-peak of the first peak region data can be calculated first. This full width of the first half-peak refers to the width at half the height of the peak in the first peak region data; it reflects the width characteristics of the peak. By calculating the full width of the first half-peak, it can be further determined whether the current peak meets the preset width condition.

[0102] For example, this application can determine whether the full width of the first half-peak is less than a first preset width threshold. The first preset width threshold is also pre-set based on the actual application scenario and detection requirements; it is used to measure whether the width of the peak is within a reasonable range. If the full width of the first half-peak is less than the first preset width threshold, it means that the currently detected peak width is too narrow, and may not be a true peak, but rather the result of noise or other interference factors. In this case, peak finding fails, and the process returns to determining whether the current position is the last column of coordinates in the spectral line image and its subsequent steps, continuing to detect the next position.

[0103] If the full width of the first half-peak is not less than a first preset width threshold, it indicates that the currently detected peak width meets the requirements, and peak finding is successful. Next, Lorentz fitting is performed on the data of the first peak region within the full width of the first half-peak. Lorentz fitting can accurately extract the feature parameters of the peak data within this range, such as peak position and peak height. Finally, this application can determine the peak position of the entire peak data based on the first fitting result, thereby achieving more accurate peak detection at the current position.

[0104] In one specific implementation, assume the peak data at the current location... ,in, The length of the peak data is given. The specific steps of the peak-finding algorithm based on Lorentz function fitting are as follows:

[0105] Step 1: Searching The point where the maximum brightness value is located ,like ,in, If the first preset brightness threshold is met, peak finding fails and the process exits; otherwise, proceed to the next step.

[0106] Step 2: Extract Data of the first peak region at the point where the maximum brightness value is located. :

[0107]

[0108] Where l is the length of the rising edge. It is the length of the falling edge;

[0109] Step 3: Calculate Full width of the first half peak ,like (in If the first preset width threshold is used, peak finding fails and the process exits; otherwise, the peak position is obtained by performing Lorentz fitting on the first peak region data within the full width range of the first half-peak. .

[0110] Indicatively, such as Figure 6 As shown, Figure 6 Given Figure 2 A schematic diagram of the Lorentz fitting result for the peak data at one location in the spectral line image shown. Figure 7 Given Figure 2 This is a schematic diagram of the Gaussian fitting result for the peak data at another location in the spectral line image shown; from Figure 6 , Figure 7 As can be seen, the Lorentz function obtained by this application fits the original data better than the Gaussian function, and therefore theoretically can achieve higher accuracy than the Gaussian function. Furthermore, this application provides another comparative test. (See attached image.) Figure 8 , 9 As shown in Figure 10, Figure 8 This is a schematic diagram of the image to be tested provided in an embodiment of this application. Figure 9 This is a schematic diagram of the peak values ​​obtained by fitting the test image with Gaussian and Lorentz fitting methods, respectively, as provided in an embodiment of this application. Figure 10 The peak difference distribution maps obtained by fitting the test image with Gaussian and Lorentz functions respectively are provided in the embodiments of this application. This application uses Gaussian and Lorentz functions to perform peak detection on the same spectral line image and calculates its peak difference: a total of 1821 peak values ​​were obtained. The maximum difference between the peak positions calculated by the two methods at the same peak position is 0.243 pixels and the minimum difference is -0.688 pixels, that is, the difference is no more than 1 pixel. It can be seen that: 1) the consistency between the two methods is relatively good; 2) both are high-precision peak detection methods.

[0111] This approach further improves the accuracy and reliability of peak detection, ensuring that the true peak position can be accurately identified in complex spectral line data.

[0112] In one embodiment, after performing Lorentz fitting on the first peak region data within the full width at half maximum (FWHM) of the first peak in step S1333, determining the peak position of the entire peak data based on the first fitting result may include:

[0113] S13331: Perform data transformation on the first peak region data within the full width range of the first half-peak to obtain the target data.

[0114] S13332: Construct a system of linear equations corresponding to the target data based on the parabolic equation of the Lorentz function.

[0115] S13333: The linear equation system is optimized and solved using GPU parallel processing, and the peak position of the entire wave peak data is determined based on the solution results.

[0116] In this embodiment, to improve the accuracy and efficiency of peak detection, the application further processes the data of the first peak region within the full width of the first half-peak. Specifically, the data of the first peak region is first transformed into target data that is more suitable for Lorentz fitting. This data transformation can be a logarithmic transformation, a difference transformation, or other appropriate mathematical transformation, the purpose of which is to make the data more consistent with the characteristics of the Lorentz function, thereby improving the accuracy of the fitting.

[0117] Next, this application can construct a system of linear equations corresponding to the target data based on the parabolic equation of the Lorentz function. The Lorentz function can be approximated as a parabola near its peak, therefore, the true peak position can be approximated by constructing a system of linear equations. The key to this step is selecting appropriate equation forms and parameters to ensure that the system of equations accurately reflects the characteristics of the data.

[0118] Then, this application can utilize GPU parallel processing to optimize and solve the linear equation system. GPU parallel processing has powerful computing capabilities and efficient parallel processing capabilities, which can significantly improve the solution speed, especially when processing large-scale data. By optimizing the solution algorithm, such as the least squares method and gradient descent method, the solution to the linear equation system can be obtained, thereby determining the peak position of the entire peak data.

[0119] Finally, this application can determine the peak position of the entire peak data based on the solution results. This step summarizes all the preceding processing and analysis. By comprehensively judging the solution of the linear equation system and the characteristics of the data, the true peak position in the spectral line image can be accurately identified. In this way, this application achieves efficient and accurate peak detection, providing reliable technical support for spectral analysis.

[0120] In one specific implementation, the peak-finding process based on the Lorentz function in this application is as follows:

[0121] First, the nonlinear fitting is transformed into solving a system of linear equations. The Lorentz function is a unimodal function, and its mathematical expression can be written as:

[0122] (1)

[0123] in , For amplitude parameters, For width parameter, This is the peak position. x-axis coordinate Let be the y-axis coordinate. From equation (1), we can obtain:

[0124] (2)

[0125] make

[0126] (3)

[0127] Equation (2) then transforms into the following parabolic equation:

[0128] (4)

[0129] Therefore, the peak data to be fitted , To determine the number of data points in the peak region, you can first... Perform parabolic fitting to obtain the coefficients. Then, substituting into equation (3), we can obtain the parameters of the original Lorentz function:

[0130] (5)

[0131] (6)

[0132] (7)

[0133] The parabolic fitting problem described above can be transformed into the solution of the following system of linear equations:

[0134] (8)

[0135] Currently, most parallel processors, especially GPUs, have implemented the ability to solve linear equation systems. Therefore, the Lorentz fitting described above can be executed at high speed on parallel processors. For example, NVIDIA CUDA provides the cuSover library for solving linear equation systems on GPUs.

[0136] In one embodiment, after performing Lorentz fitting on the local peak data in step S140, determining the peak position of the local peak data based on the second fitting result may include:

[0137] S141: Find the point where the second maximum brightness value is located from the local peak data, and determine whether the second maximum brightness value at that point is less than the second preset brightness threshold.

[0138] S142: If the second maximum brightness value of the point is less than the second preset brightness threshold, then the peak finding fails, and the process returns to the step of determining whether the current position is the last column coordinate in the spectral line image and its subsequent steps.

[0139] S143: If the second maximum brightness value of the point is not less than the second preset brightness threshold, then extract the second peak region data of the point where the second maximum brightness value is located from the local peak data, and after Lorentz fitting the second peak region data, determine the peak position of the entire peak data according to the second fitting result.

[0140] In this embodiment, when processing local peak data, it is first necessary to locate the specific point where the second maximum brightness value is located from these data. This step is crucial because it determines the accuracy and effectiveness of subsequent analysis. Next, the second maximum brightness value at that point is compared with a pre-set second preset brightness threshold. This threshold is carefully set according to the actual application scenario and detection requirements to determine whether the currently detected brightness value is significant enough to be considered a true peak rather than noise or interference.

[0141] If the second maximum brightness value at a point is lower than the second preset brightness threshold, it can be determined that the detected peak is not a true peak, but a misjudgment caused by various factors (such as noise, equipment error, etc.). In this case, the peak finding process will fail and return to the step of determining whether the current position is the last column of coordinates in the spectral line image and its subsequent steps, so as to continue to detect other positions.

[0142] Conversely, if the second maximum brightness value at that point is not lower than the second preset brightness threshold, then the currently detected brightness value can be considered sufficiently significant and potentially a true peak. Next, the second peak region data at the point where the second maximum brightness value is located will be extracted from the local peak data. This data will contain information about key features such as peak shape, width, and height.

[0143] Subsequently, Lorentz fitting is performed on these second peak region data. Lorentz fitting is an effective mathematical method that can accurately describe the shape and characteristics of a single-peak function. Through the fitting process, a set of parameters can be obtained, which can accurately describe the shape and position of the peak. Finally, based on the second fitting result, the peak position of the entire wave peak data can be determined. This step summarizes all the preceding processing and analysis; by comprehensively judging the fitting results and the characteristics of the data, the true peak position in the spectral line image can be accurately identified.

[0144] In one embodiment, after performing Lorentz fitting on the second peak region data in S143, determining the peak position of the entire peak data based on the second fitting result may include:

[0145] S1431: After calculating the full width of the second half-peak of the second peak region data, determine whether the full width of the second half-peak is less than the second preset width threshold.

[0146] S1432: If the full width of the second half-peak is less than the second preset width threshold, peak finding fails, and the process returns to the step of determining whether the current position is the last column coordinate in the spectral line image and subsequent steps.

[0147] S1433: If the full width of the second half-peak is not less than the second preset width threshold, then the peak finding is successful, and after Lorentz fitting of the second peak region data within the full width range of the second half-peak, the peak position of the local peak data is determined according to the second fitting result.

[0148] In this embodiment, during the process of performing Lorentz fitting on the data in the second peak region to determine the peak position of the entire wave peak data, it is first necessary to calculate the full width at half maximum (FWHM) of the data in that region. FWHM is an important parameter for measuring the width of a peak; it reflects the width range of the peak when it reaches half its maximum value. By calculating the FWHM, it is possible to further evaluate whether the currently detected peak meets the preset width requirements.

[0149] Next, the calculated full width at half maximum (FWHM) is compared with a second preset width threshold. This threshold is set based on actual application requirements and spectral line characteristics to determine whether the width of the current peak is within an acceptable range. If the FWHM is smaller than the second preset width threshold, it indicates that the currently detected peak is too narrow and may not conform to the characteristics of a true peak. Therefore, the peak-finding process will fail, and the process will return to determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps, in order to continue detecting other positions.

[0150] Conversely, if the full width of the second half-peak is not less than a second preset width threshold, then the currently detected peak width can be considered to meet the requirements and may be the true peak. In this case, the peak-finding process will continue, performing Lorentz fitting on the data of the second peak region within the full width of the second half-peak. Lorentz fitting can accurately describe the shape and characteristics of a single-peak function. Through the fitting process, a set of parameters can be obtained, which can accurately describe the shape, width, and position of the peak.

[0151] Finally, based on the second fitting result, the peak position of the local peak data can be determined. This step summarizes all the preceding processing and analysis. By comprehensively judging the fitting results and the characteristics of the data, the true peak position in the spectral line image can be accurately identified. In this way, this application achieves efficient and accurate peak detection, providing reliable technical support for spectral analysis. Especially when processing complex spectral line data, it can significantly improve the accuracy and reliability of peak detection.

[0152] In one embodiment, before performing Lorentz fitting on the entire peak data in S130, the method may further include:

[0153] The entire peak data is denoised, and the denoised peak data is then Lorentz fitted.

[0154] Before performing Lorentz fitting on the local peak data in S140, the method may further include:

[0155] The local peak data is denoised, and the denoised local peak data is then Lorentz fitted.

[0156] In this embodiment, introducing a denoising step is crucial before performing Lorentz fitting on the entire peak data or local peak data. Spectral line data is often subject to various noise interferences during acquisition, transmission, and processing, such as electronic noise and photon noise. These noises can make the waveform of the data irregular and may even mask the true peak characteristics, thus affecting the accuracy of peak detection.

[0157] To remove this noise, this application employs various denoising methods, such as smoothing filtering, median filtering, and wavelet denoising. Smoothing filtering replaces the original data point by calculating the average or weighted average of its neighborhood, thus smoothing the data waveform and reducing the impact of noise. Median filtering, a nonlinear filtering method, effectively removes sharp noise such as impulse noise by using the median of the neighborhood surrounding the data point as a replacement value. Wavelet denoising, based on wavelet transform, decomposes the data into sub-bands of different frequencies, performs denoising processing on each sub-band, and finally reconstructs the data, thereby removing noise while preserving data characteristics.

[0158] After denoising, the waveform of the entire peak data or local peak data will become smoother, and the true peak characteristics will be more prominent. At this point, performing Lorentz fitting on this data will yield more accurate and reliable fitting results. Through the fitting process, a set of parameters can be obtained that precisely describe the shape, width, and position of the peaks, thus providing reliable technical support for subsequent spectral analysis.

[0159] Therefore, introducing a denoising step before performing Lorentz fitting on the entire peak data or local peak data is an important means to improve the accuracy and reliability of peak detection.

[0160] Furthermore, to more intuitively illustrate the beneficial effects of this application, the above algorithm was used to test 5601 spectral line images, and the corresponding test results were obtained. (Illustratively, as shown...) Figure 11 , 12 As shown, Figure 11 This application provides a test image set for testing 5601 spectral line images using the above algorithm, as provided in the embodiments of this application. Figure 12 This diagram illustrates a speed comparison between local-priority search and current global search, as provided in this embodiment. The test images in the test image set have a resolution of 2040x2048, meaning each spectral line contains a maximum of 2048 peaks (W=2040), and each peak has a data length of 2048 (H=2048). Peak detection was performed on each image using both global peak fitting and local-priority peak fitting. The average detection times for all images were 103.2 seconds and 56.7 seconds, respectively, thus the local-priority detection speed was improved by (103.2-56.7)÷103.2=45%.

[0161] The spectral line peak detection device provided in the embodiments of this application is described below. The spectral line peak detection device described below can be referred to in correspondence with the spectral line peak detection method described above.

[0162] In one embodiment, such as Figure 13As shown, Figure 13 This is a schematic diagram of a spectral line peak detection device provided in an embodiment of this application. This application also provides a spectral line peak detection device, which may include an image acquisition module 210, an initialization module 220, a global peak finding module 230, a local peak finding module 240, and a loop execution module 250, specifically including the following:

[0163] The image acquisition module 210 is used to acquire the spectral line image obtained when scanning each sample point on the sample line of the sample surface to be tested using the line confocal technique. Each column of coordinates in the spectral line image represents the position of a sample point.

[0164] The initialization module 220 is used to take the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure.

[0165] The overall peak finding module 230 is used to obtain the entire peak data at the current position from the spectral line image if the peak finding result is a peak finding failure, and after performing Lorentz fitting on the entire peak data, determine the peak position of the entire peak data according to the first fitting result.

[0166] The local peak finding module 240 is used to obtain the peak position of the previous column of coordinates if the peak finding result is successful, and obtain the local peak data of the current position from the spectral line image according to the peak position of the previous column of coordinates. After performing Lorentz fitting on the local peak data, the peak position of the local peak data is determined according to the second fitting result.

[0167] The loop execution module 250 is used to determine whether the current position is the last column of coordinates in the spectral line image. If so, the detection process ends; otherwise, the next column of coordinates in the spectral line image is taken as the current position, and the process returns to execute the peak finding result of obtaining the previous column of coordinates in the spectral line and its subsequent steps.

[0168] In the above embodiments, by combining the strategies of overall peak finding and local peak finding, the continuity between adjacent positions of the spectral line is effectively utilized. When peak finding fails at the initial position or the previous position, Lorentz fitting is performed on the entire peak data at the current position to ensure the accuracy of peak detection. When peak finding is successful at the previous position, local peak data at the current position is obtained based on the peak position of the previous position for fitting, which greatly reduces the amount of data processing, thereby improving the detection speed and reducing the requirements for computing hardware, thus reducing costs. The spectral line peak detection method of this application greatly improves the detection speed while ensuring detection accuracy, further increasing the competitiveness of line confocal products and providing an improved option for other products that require real-time peak detection, such as laser confocal, white light interferometry, and super depth of field.

[0169] In one embodiment, this application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the spectral line peak detection method as described in any of the above embodiments.

[0170] In one embodiment, this application also provides a computer device, including: one or more processors, and memory.

[0171] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the spectral line peak detection method as described in any of the above embodiments.

[0172] Indicatively, such as Figure 14 As shown, Figure 14 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 14 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the spectral line peak detection method of any of the above embodiments.

[0173] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0174] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0175] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0176] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0177] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting spectral line peaks, characterized in that, The method includes: A spectral line image is obtained by scanning each sample point on the sample line of the sample surface under test using the line confocal technique. Each column of coordinates in the spectral line image represents the position of a sample point. Using the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure. If the peak finding result is a peak finding failure, then the entire peak data at the current position is obtained from the spectral line image, and after Lorentz fitting of the entire peak data, the peak position of the entire peak data is determined according to the first fitting result. If the peak finding result is successful, the peak position of the previous column of coordinates is obtained, and the local peak data of the current position is obtained from the spectral line image based on the peak position of the previous column of coordinates. After Lorentz fitting of the local peak data, the peak position of the local peak data is determined based on the second fitting result. Determine whether the current position is the last column of coordinates in the spectral line image. If so, end the detection process; otherwise, take the next column of coordinates in the spectral line image as the current position and return to execute the peak finding result of obtaining the previous column of coordinates in the spectral line and its subsequent steps.

2. The method for detecting spectral line peaks according to claim 1, characterized in that, After performing Lorentz fitting on the entire peak data, determining the peak position of the entire peak data based on the first fitting result includes: Find the point where the first maximum brightness value is located from the entire peak data, and determine whether the first maximum brightness value at that point is less than the first preset brightness threshold. If the first maximum brightness value of the point is less than the first preset brightness threshold, the peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps. If the first maximum brightness value at a point is not less than the first preset brightness threshold, then the first peak region data of the point where the first maximum brightness value is located is extracted from the entire peak data, and after Lorentz fitting of the first peak region data, the peak position of the entire peak data is determined according to the first fitting result.

3. The method for detecting spectral line peaks according to claim 2, characterized in that, After performing Lorentz fitting on the data in the first peak region, determining the peak position of the entire wave peak data based on the first fitting result includes: After calculating the full width of the first half-peak of the first peak region data, it is determined whether the full width of the first half-peak is less than a first preset width threshold. If the full width of the first half-peak is less than the first preset width threshold, peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps. If the full width of the first half-peak is not less than the first preset width threshold, then the peak finding is successful. After Lorentz fitting of the first peak region data within the full width of the first half-peak, the peak position of the entire wave peak data is determined according to the first fitting result.

4. The method for detecting spectral line peaks according to claim 3, characterized in that, After performing Lorentz fitting on the first peak region data within the full width of the first half-peak, determining the peak position of the entire peak data based on the first fitting result includes: Data transformation is performed on the data of the first peak region within the full width of the first half-peak to obtain the target data; Based on the parabolic equation of the Lorentz function, construct a system of linear equations corresponding to the target data; The linear equations are optimized and solved using GPU parallel processing, and the peak position of the entire wave peak data is determined based on the solution results.

5. The method for detecting spectral line peaks according to claim 1, characterized in that, After performing Lorentz fitting on the local peak data, determining the peak position of the local peak data based on the second fitting result includes: Find the point where the second maximum brightness value is located from the local peak data, and determine whether the second maximum brightness value at that point is less than the second preset brightness threshold. If the second maximum brightness value of the point is less than the second preset brightness threshold, the peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps. If the second maximum brightness value at that point is not less than the second preset brightness threshold, then the second peak region data of the point where the second maximum brightness value is located is extracted from the local peak data, and after Lorentz fitting of the second peak region data, the peak position of the entire peak data is determined according to the second fitting result.

6. The method for detecting spectral line peaks according to claim 5, characterized in that, After performing Lorentz fitting on the second peak region data, determining the peak position of the entire peak data based on the second fitting result includes: After calculating the full width of the second half-peak of the second peak region data, it is determined whether the full width of the second half-peak is less than the second preset width threshold. If the full width of the second half-peak is less than the second preset width threshold, peak finding fails, and the process returns to the step of determining whether the current position is the last column of coordinates in the spectral line image and subsequent steps. If the full width of the second half-peak is not less than the second preset width threshold, then the peak finding is successful. After Lorentz fitting of the second peak region data within the full width range of the second half-peak, the peak position of the local peak data is determined according to the second fitting result.

7. The method for detecting spectral line peaks according to any one of claims 1-6, characterized in that, Before performing Lorentz fitting on the entire peak data, the method further includes: The entire peak data is denoised, and the denoised entire peak data is then Lorentz fitted. Before performing Lorentz fitting on the local peak data, the method further includes: The local peak data is denoised, and the denoised local peak data is then Lorentz fitted.

8. A spectral line peak detection device, characterized in that, include: The image acquisition module is used to acquire spectral line images obtained when scanning each sample point on the sample line of the sample surface under test using line confocal technology, wherein each column of coordinates in the spectral line image represents the position of a sample point. An initialization module is used to take the current column coordinates in the spectral line image as the current position, obtain the peak finding result of the previous column coordinates in the spectral line, and set the peak finding result of the previous column coordinates corresponding to the first column coordinates in the spectral line image as peak finding failure. The overall peak finding module is used to obtain the entire peak data at the current position from the spectral line image if the peak finding result is peak finding failure, and after performing Lorentz fitting on the entire peak data, determine the peak position of the entire peak data according to the first fitting result. The local peak finding module is used to obtain the peak position of the previous column of coordinates if the peak finding result is successful, and obtain the local peak data of the current position from the spectral line image according to the peak position of the previous column of coordinates. After Lorentz fitting the local peak data, the peak position of the local peak data is determined according to the second fitting result. The loop execution module is used to determine whether the current position is the last column coordinate in the spectral line image. If so, the detection process ends. Otherwise, the next column of coordinates in the spectral line image is taken as the current position, and the process of obtaining the peak finding result of the previous column of coordinates in the spectral line and subsequent steps is returned.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the spectral line peak detection method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the spectral line peak detection method as described in any one of claims 1 to 7.