Optical image and LIBS detection area registration method and device, medium and program product

By establishing a sample space coordinate system and fusing and updating image and spectral features, the problem of insufficient registration accuracy between optical images and spectral detection areas in LIBS technology is solved, achieving high-precision and fast alignment between optical images and spectral detection areas, thus improving the interpretability and efficiency of detection results.

CN121169979APending Publication Date: 2025-12-19SHANGHAI GLORYSOFT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511275095.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing LIBS technology has insufficient precision in the registration of optical images and spectral detection areas, making it difficult to achieve accurate alignment, resulting in low accuracy and efficiency of detection results.

Method used

By establishing a sample space coordinate system, a mapping relationship is established between the pixel coordinates of the optical image and the coordinates of the LIBS laser focus. Image features and spectral features are used for fusion and iterative updates to achieve registration between the optical image and the spectral detection area.

Benefits of technology

It significantly improves the accuracy and robustness of registration, reduces mechanical positioning errors and manual calibration deviations, enhances the interpretability and application value of test results, and meets the real-time requirements of industrial online testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121169979A_ABST
    Figure CN121169979A_ABST
Patent Text Reader

Abstract

The invention provides an optical image and LIBS detection area registration method and device, a medium and a program product, and the method comprises the steps: collecting an optical image, three-dimensional shape data and spectrum detection data of a to-be-detected sample, and building a sample space coordinate system based on the optical image and the three-dimensional shape data, the spectrum detection data is collected from a preset spectrum detection area on the surface of the to-be-detected sample; establishing a mapping relation between optical image pixel coordinates and LIBS laser focus coordinates in the sample space coordinate system; extracting image features of the optical image and spectral features of the spectral detection data, and fusing and updating the mapping relation based on the image features and the spectral features to obtain a registration result of the optical image and the spectral detection area; and performing superposition display on the optical image and the spectrum detection result aligned based on the registration result in a visual interface. According to the method, the influence caused by mechanical positioning errors, manual calibration deviations and sample morphology differences is effectively reduced, and the registration precision and robustness are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of optical detection and spectral analysis, and particularly relates to a method for registering an optical image and a LIBS detection region

[0002] A LIBS detection region registration method, device, medium and program product. BACKGROUND

[0003] Laser-induced breakdown spectroscopy (LIBS) is a detection method based on high-energy laser pulses acting on the surface of a sample to generate plasma and analyze its emission spectrum. This technology has the advantages of fast detection speed, wide application of sample types, and no need for complex pretreatment, and has been widely used in material composition analysis, element qualitative and quantitative detection, and element distribution characterization.

[0004] In existing applications, LIBS technology is usually combined with optical microscopic imaging to obtain an optical image of the sample surface, assist in determining the position of the laser, and collect spectral data at the corresponding position to realize element detection and distribution analysis of the sample micro area. However, the existing detection method still has the following deficiencies in the registration of the optical image and the spectral detection region.

[0005] Existing systems generally rely on stepper motors to control the sample stage to realize laser landing point positioning, and the repeatability of the positioning is about ±50 μm. When the detection object is a micro area with a size of tens of microns, it is difficult to ensure the accurate correspondence between the actual laser action point and the predetermined position in the optical image, which limits the accuracy of the detection results. Moreover, the position of the laser spot is determined by manual calibration, which takes several minutes for a single calibration and is prone to human interpretation errors, resulting in low overall efficiency.

[0006] At the data fusion level, the optical image uses a pixel coordinate system, and the spectral data is based on a laser focal point coordinate system, and the two lack a unified spatial reference. If the data is directly spliced, it will often cause position mismatch, affecting the accuracy of the interpretation of the element distribution results. For example, in the classification of Chinese wolfberry, the misjudgment rate of such a method can reach 15%, which cannot meet the needs of industrial detection.

[0007] Therefore, how to effectively register the optical image and the LIBS spectral detection region and improve the reliability of the detection results has become a technical problem that needs to be solved in the field. SUMMARY

[0008] In view of the deficiencies in the prior art, the present application provides a method for registering an optical image and a LIBS detection region, a device, a medium and a program product, at least to solve the problem of insufficient registration accuracy caused by the difficulty in accurately aligning the optical image and the spectral detection region in the prior art.

[0009] To achieve the above object and other advantages, some embodiments of the present application provide the following aspects:

[0010] In a first aspect, some embodiments of the present application provide an optical image and LIBS detection area registration method, comprising:

[0011] Collecting optical image, three-dimensional topographic data and spectral detection data of a sample to be measured, and establishing a sample space coordinate system based on the optical image and the three-dimensional topographic data, wherein the spectral detection data is collected from a pre-set spectral detection area on the surface of the sample to be measured;

[0012] Establishing a mapping relationship between optical image pixel coordinates and LIBS laser focal point coordinates in the sample space coordinate system;

[0013] Extracting image features of the optical image and spectral features of the spectral detection data, and fusing and updating the mapping relationship based on the image features and the spectral features to obtain a registration result of the optical image and the spectral detection area;

[0014] In a unified reference of the sample space coordinate system, superimpose and display the optical image and spectral detection results aligned based on the registration result in a visualization interface.

[0015] In a second aspect, some embodiments of the present application also provide an electronic device, comprising:

[0016] One or more processors; and a memory storing computer program instructions, which when executed cause the processor to perform the optical image and LIBS detection area registration method as described in any one of the above.

[0017] In a third aspect, some embodiments of the present application also provide a computer readable storage medium having stored thereon computer programs and / or instructions, which when executed by a processor implement the optical image and LIBS detection area registration method as described in any one of the above.

[0018] In a fourth aspect, some embodiments of the present application also provide a computer program product comprising computer programs and / or instructions, which when executed by a processor implement the optical image and LIBS detection area registration method as described in any one of the above.

[0019] Compared with the prior art, in the scheme provided by the embodiment of the application, a unified space reference system is provided by establishing a sample space coordinate system, so that the optical image pixel coordinates LIB laser focus coordinates can be expressed in the same coordinate system, thereby fundamentally solving the problem of lack of unified alignment reference between multi-modal data. By fusing and iteratively updating the mapping relationship based on image features and spectral features, the influence of mechanical positioning errors, artificial calibration deviations and sample topography differences is effectively reduced, and the accuracy and robustness of registration are significantly improved. The superimposed image after registration is directly output in the visualization interface, so that the spectral distribution information can be intuitively presented in the optical image, and the explainability and application value of the detection result are improved. Therefore, the lengthy operation process originally relying on artificial calibration and mechanical positioning is converted into a fast calculation process based on unified coordinate system, automatic registration and iterative optimization, so that the processing time of a single sample is shortened from more than 5 minutes in the traditional method to within 10 seconds, meeting the real-time requirement of industrial online detection. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other embodiments can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0021] Figure 1 is a flowchart of an optical image and LIBS detection area registration method provided by the embodiment of the application;

[0022] Figure 2 is a structural schematic diagram of an optical image and LIBS detection area registration system provided by the embodiment of the application;

[0023] Figure 3 is a flowchart of image feature and spectral feature fusion processing provided by the embodiment of the application;

[0024] Figure 4 is a structural schematic diagram of an electronic device provided by the embodiment of the application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical scheme and advantages of the embodiments of the application more clear, the technical scheme in the embodiments of the application will be described clearly and completely in combination with the drawings in the embodiments of the application. Obviously, the described embodiments are some of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the application.

[0026] First embodiment

[0027] The first embodiment of the present application relates to a method for registering optical images and LIBS detection regions, which is realized by an optical imaging module, a LIBS excitation and detection module, and a data processing and visualization module. The optical imaging module includes a CMOS camera and a rear split pupil differential confocal lens. The resolution of the CMOS camera can reach 3840x2160, which is used to collect two-dimensional optical images of the sample surface; the differential confocal lens is used to obtain three-dimensional topographic data of the sample. The LIBS excitation and detection module includes a pulsed laser, a galvanometer control system, and a fiber spectrometer. The wavelength of the pulsed laser can be 1064 nm, and the single pulse energy is about 50 mJ, which is used to excite the sample surface to form a plasma; the galvanometer control system is used to guide the laser spot to accurately position the to-be-detected region; the spectral detection range of the fiber spectrometer is 200-980 nm, which is used to receive the spectral signal of the plasma radiation. The data processing and visualization module includes an FPGA-based embedded system and an interactive interface. The FPGA-based embedded system runs an image-spectrum fusion algorithm, performs registration calculation on the collected optical images and spectral detection data, and outputs the registration result to the interactive interface. The interactive interface supports user adjustment of display parameters to realize superimposed visualization of optical images and spectral detection results.

[0028] Referring to Figure 1 、 Figure 2 , the method can include the following steps:

[0029] Step S1: Collecting optical images, three-dimensional topographic data, and spectral detection data of the to-be-detected sample, and establishing a sample space coordinate system based on the optical images and the three-dimensional topographic data, the spectral detection data being collected from a pre-set spectral detection region on the surface of the to-be-detected sample.

[0030] In this step, the to-be-detected sample can be a solid, liquid, or powder sample, such as metal and alloy materials, glass or ceramic non-metallic materials, mineral and geological samples, biological tissues or agricultural product samples, industrial powder or coating materials, etc. The present method is not limited to the above-mentioned sample types and can be applied to various objects that need to be detected for element composition and distribution analysis.

[0031] The CMOS camera in the optical imaging module is used to collect two-dimensional high-resolution optical images of the to-be-detected sample. The optical images are usually pixel images of the sample surface under visible light or near-infrared waveband, which are used to provide surface topography and texture information. The three-dimensional topographic data of the to-be-detected sample is obtained by the rear split pupil differential confocal lens, which is used to reflect the microscopic undulation characteristics of the sample surface.

[0032] Based on the two-dimensional optical image and the three-dimensional topographic data collected by the optical imaging module, a sample space coordinate system with the sample surface as a reference is established. Specifically, a preset reference point on the sample surface is taken as the coordinate origin, the row and column directions of the optical image are taken as the X-axis and Y-axis of the sample space coordinate system respectively, and the height information in the three-dimensional topographic data is taken as the Z-axis; through the camera imaging model and the depth measurement result, the pixel coordinates in the optical image are mapped to the actual space coordinate points, so that the one-to-one correspondence and association between the image plane data and the three-dimensional space position are realized in the sample space coordinate system.

[0033] The spectral detection data is collected from a preset spectral detection region on the surface of the sample to be detected. Specifically, the spectral detection region refers to a target region defined on the sample surface according to the detection requirements. The region can be a regular rectangular grid, a circular region, or a specific functional area defined according to actual application. In the detection process, the pulsed laser in the LIBS excitation and detection module acts on the sample surface point by point in the spectral detection region, causing the position to generate plasma radiation; the optical fiber spectrometer receives the emission signal of the plasma and converts it into spectral detection data. Through multi-point excitation and collection in the spectral detection region, the element distribution information of the region can be obtained, and the spectral detection data can be corresponded and registered with the optical image in the unified sample space coordinate system.

[0034] Step S2: establishing a mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates in the sample space coordinate system.

[0035] In this embodiment, step S2 specifically includes:

[0036] Step S201: in the sample space coordinate system, using a double chessboard calibration plate to obtain the optical image pixel coordinates and the corresponding LIBS laser focal point coordinates;

[0037] Step S202: based on the correspondence between the optical image pixel coordinates and the LIBS laser focal point coordinates, constructing an affine transformation matrix and a translation compensation amount for describing the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates.

[0038] Specifically, it is necessary to establish a corresponding relationship between the two-dimensional pixel points of the optical image and the actual space position of the plasma formed by the LIBS laser acting on the sample surface, so as to realize the unification of the image domain and the spectral detection domain in the sample space coordinate system. The optical image pixel coordinate X img refers to the row and column position of a pixel point in the image plane in the optical image, which reflects two-dimensional plane information; the LIBS laser focal point coordinate X LIBSis referred to as the position coordinate of the sample surface where the pulsed laser is guided by the galvanometer, which determines the spatial sampling point of the spectral detection. The mapping relationship between the two is usually described by the combination of an affine transformation matrix and a translation compensation amount, that is,

[0039] X LIBS = T·X img + δ

[0040] wherein T is an affine transformation matrix, and δ is a translation compensation amount.

[0041] In the actual implementation process, the initial mapping relationship can be obtained in the following manner: a double chessboard calibration plate is placed on the sample surface, a two-dimensional optical image of the calibration plate is collected by using an optical imaging module to obtain the pixel coordinates of the calibration points; at the same time, the galvanometer system in the LIBS excitation and detection module is controlled to make the laser target each point of the corresponding points of the calibration plate, and the focal point coordinates in the sample space coordinate system are recorded. A set of corresponding point pairs of optical image pixel coordinates and LIBS laser focal point coordinates are obtained in this way, and then the initial affine transformation matrix and the translation compensation amount are obtained based on least squares fitting or other mathematical methods.

[0042] The affine transformation matrix T can include the following parameters: a rotation angle θ used to represent the rotation deviation between the optical image coordinate system and the LIBS laser focal point coordinate system, which can be obtained by the average of the included angles of the feature point matching; a scaling factor s used to represent the proportional relationship between the actual physical size of the calibration plate and the image pixel size, that is, the coefficient of converting from pixel units to actual space units; a shear coefficient k used to describe the non-orthogonal distortion generated by the grid fitting in the calibration process, which can be estimated by the fitting residual. The translation compensation amount δ is used to correct the overall position deviation, which usually includes two components Δx and Δy. The obtained mapping relationship can be stored in the data processing and visualization module for subsequent feature fusion and iterative optimization.

[0043] In some embodiments, the typical parameters of the affine transformation matrix can be obtained through experimental calibration. For example, the range of the rotation angle can be within a few degrees, the scaling factor is in the order of sub-microns / pixel, and the shear coefficient is in the order of decimal residual. In a specific experiment, the rotation angle is about -2.5° to 1.8°, the scaling factor is about 0.45 μm / pixel, and the shear coefficient is about 0.03. It should be noted that the above numerical values are only used to illustrate the order of magnitude and actual feasibility of the parameters, and the protection scope of the present application is not limited to the numerical values.

[0044] Step S3: extracting the image features of the optical image and the spectral features of the spectral detection data, and fusing and updating the mapping relationship based on the image features and the spectral features to obtain the registration result of the optical image and the spectral detection region.

[0045] In this step, due to the influence of factors such as mechanical positioning error, optical distortion, sample surface undulation and environmental drift, the initial mapping relationship obtained based on the calibration experiment may be misaligned in the actual detection process, resulting in deviation between the optical image pixel coordinates and the LIBS laser focal point coordinates. Therefore, by extracting the image features of the optical image and the spectral features of the spectral detection data and matching them, the mapping parameters can be continuously iteratively optimized to automatically correct these deviations, so that the registration result always maintains high precision and stability.

[0046] In specific implementation, the reliability of registration can be enhanced through joint extraction of feature points and spectral line distribution. For example, the optical image is processed, and the scale-invariant feature transform (SIFT) algorithm is used to extract the key feature points of the image to represent the local structure and texture information of the sample surface; at the same time, the spectral line intensity distribution features are extracted from the plasma image obtained by LIBS spectral detection, such as the Ca II 396.8 nm spectral line (characteristic emission spectral line of ionized calcium ion at wavelength 396.8 nm). In this way, both the geometric structure information provided by the optical image and the element distribution information reflected by the spectral detection data are utilized, thereby jointly ensuring the accuracy of registration in both geometric position and composition information dimensions, and finally obtaining a high-precision registration result of the optical image and the spectral detection region.

[0047] Step S4: In the sample space coordinate system as a unified reference, the optical image and the spectral detection result aligned based on the registration result are superimposed and displayed in the visualization interface.

[0048] In this step, the sample space coordinate system established in step S1 is taken as a unified reference, and the registration result of the optical image and the spectral detection region obtained in step S3 is imported into the visualization interface. During display, the interface bottom layer displays the optical image of the sample (presented in RGB true color mode) to intuitively reflect the topography and texture information of the sample surface; the spectral detection result is the spatial distribution information generated based on the spectral detection data and combined with the registration relationship, such as pseudo-color heat map, element distribution map or other spectral mapping images that can be directly displayed in the two-dimensional image coordinate system. On this basis, the spectral detection result is aligned and superimposed according to the registration relationship. Through this superimposition method, the user can intuitively observe the correspondence between the optical image and the spectral distribution, thereby accurately performing composition analysis and regional positioning of the sample.

[0049] Compared with the prior art, in the scheme provided by the embodiment of the application, a unified space reference system is provided by establishing a sample space coordinate system, so that the optical image pixel coordinates LIB laser focus coordinates can be expressed in the same coordinate system, thereby fundamentally solving the problem of lack of unified alignment reference between multi-modal data. By fusing and iteratively updating the mapping relationship based on image features and spectral features, the influence of mechanical positioning errors, manual calibration deviations and sample topography differences is effectively reduced, and the accuracy and robustness of registration are significantly improved. The superimposed image after registration is directly output in the visualization interface, so that the spectral distribution information can be intuitively presented in the optical image, and the explainability and application value of the detection result are improved.

[0050] By adopting the technical scheme described in the application, the lengthy operation process originally relying on manual calibration and mechanical positioning is converted into a fast calculation process based on unified coordinate system, automatic registration and iterative optimization. This process can complete the accurate alignment of the optical image and the spectral detection area without human intervention, thereby significantly reducing the errors introduced by human operation and improving the overall detection efficiency. Compared with the prior art, the method of the application can shorten the processing time of a single sample from more than 5 minutes to less than 10 seconds, effectively meeting the real-time and high-throughput requirements of industrial online detection.

[0051] Second embodiment

[0052] The second embodiment of the application relates to a method for registering an optical image and a LIBS detection area. The second embodiment is an improvement based on the first embodiment, and the specific improvement is that in the second embodiment of the application, a specific implementation of registration optimization based on feature fusion and prediction is provided, that is, in step S3, the following steps can be further included:

[0053] Step S301: preliminarily fusing the image features and the spectral features by an attention weighting method to obtain first fused features.

[0054] In this embodiment, step S301 specifically includes:

[0055] Step S3011: extracting features of the optical image by a convolutional neural network to obtain image features reflecting the spatial distribution features of the sample surface;

[0056] Step S3012: extracting spectral line features of the spectral detection data, and mapping the spectral line features to a spatial dimension matched with the image features based on an interpolation method to obtain spectral features;

[0057] Step S3013: calculating attention weights for the image features and the spectral features respectively, wherein the attention weight of the image features is used to highlight the texture information with high distinguishability, and the attention weight of the spectral features is used to highlight the spectral line information with high signal-to-noise ratio.

[0058] Step S3014: The image features and spectral features are weighted based on the attention weights of the image features and the attention weights of the spectral features, and the weighted features are fused to obtain the first fused feature.

[0059] Specifically, refer to Figure 3 As shown, a convolutional neural network is used to extract features from an optical image. The optical image can be input as a 3840×2160×3 (RGB) image, and features are extracted through convolutional branches (which may include depthwise separable convolutional layers). After downsampling, the output is a 128×128×64 dimensional image feature, which is used to characterize spatial distribution information such as sample edges and textures.

[0060] The spectral data acquired by the fiber optic spectrometer (e.g., 512-point spectra in the 200–980 nm band) is processed. Features are extracted through a spectral line profile analysis layer and mapped to a dimension matching the image features based on spatial interpolation. For example, bilinear or bicubic interpolation methods can be used to expand the spectral features to a spatial size of 128×128 while maintaining the same 64 channels as the image convolutional features, resulting in 128×128×64 dimensional spectral features to reflect the spatial distribution of elemental spectral line intensities. For example, the spectral features may include intensity information of characteristic spectral lines such as Ca II 396.8 nm and Mg I 285.2 nm.

[0061] Subsequently, a channel attention mechanism is used to calculate the weights for image features and spectral features respectively. The weights for image features are obtained by globally averaging the convolutional features and then outputting them through two fully connected layers, resulting in a 64-dimensional channel weight vector to highlight high-discrimination texture information. The weights for spectral features are also obtained by globally averaging the features and then outputting them through a fully connected layer, resulting in a 64-dimensional channel weight vector to highlight high signal-to-noise ratio spectral line information. Based on the attention weights for image features and spectral features, the image features and spectral features are weighted separately, and then fused channel by channel to obtain the first fused feature. The fusion process can be represented as follows:

[0062]

[0063] Among them, F fusion F represents the first fused feature of the output. img F represents image features. spec Indicating spectral characteristics, W img and W spec These represent the attention weights for image features and spectral features, respectively. denotes the channel-wise multiplication operation, and denotes the activation function (e.g., LeakyReLU). In this way, the correlation between the image texture and the spectral line can be adaptively learned in the channel dimension. The final output of the fusion feature maintains the dimension of 128x128x64, while retaining both the spatial position information and the element distribution information, providing an effective input for subsequent registration calculation.

[0064] Step S302: predicting the coordinate offset between the optical image pixel coordinates and the LIBS laser focal point coordinates based on the first fusion feature. The coordinate offset includes a rotation angle, a scaling coefficient, a shearing coefficient, and a translation compensation amount, wherein the rotation angle, the scaling coefficient, and the shearing coefficient are used to update the affine transformation matrix, and the translation compensation amount is used to correct the overall translation deviation.

[0065] In this step, the first fusion feature obtained in step S301 is time-sequenced and unfolded to form an input feature sequence for sequence modeling. For example, the fusion feature with a size of 128x128x64 can be unfolded into a sequence of 16384x64 time-sequenced feature vectors. Specifically, the fusion feature with a size of 128x128x64 is flattened in the spatial dimension according to a predetermined order (e.g., row priority): 128x128 spatial positions are arranged in sequence as time-sequenced indexes with a length of 16384, and the 64-dimensional feature channel values corresponding to each position are retained, thereby obtaining a sequence of 16384x64 time-sequenced feature vectors.

[0066] Subsequently, the sequence of time-sequenced feature vectors is input into a sequence modeling network (e.g., a bidirectional long short-term memory network). The bidirectional LSTM network includes two parallel LSTM sequence modeling units in the forward and backward directions, which are used to simultaneously capture the forward and backward dependency relationships of the feature sequence. Each direction of the LSTM is composed of two layers of stacked hidden layers, each containing 128 neurons, thereby being able to model the correlation between spatial positions in a larger range. The outputs of the forward and backward LSTMs are spliced or weighted and fused to form a comprehensive feature representation after time-sequencing modeling.

[0067] The bidirectional LSTM network utilizes its capability in modeling temporal dependencies and associating spatial features to predict the deviation between the optical image pixel coordinates and the LIBS laser focal point coordinates. Through the prediction process, a set of multi-dimensional coordinate offsets can be output to characterize the difference between the current mapping relationship and the actual detection position. Among them, the rotation angle, the scaling coefficient and the shearing coefficient are used to update the affine transformation matrix to correct the rotation deviation, the proportion difference and the non-orthogonal distortion between the image domain and the spectral detection domain; the translation compensation quantity is used to correct the overall translation deviation, which usually includes two components of Δx and Δy, used to correct the overall offset of the two in the plane position. In this way, the registration parameters can be comprehensively corrected in the two dimensions of geometric transformation and position offset, so as to ensure that the optical image and the spectral detection region are aligned in a unified coordinate system with high precision.

[0068] Step S303: Based on the coordinate offset, the affine transformation matrix and the translation compensation quantity used to describe the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates are corrected to obtain the registration result of the optical image and the spectral detection region.

[0069] In this embodiment, step S303 specifically includes:

[0070] Step S3031: Selecting a plurality of feature points in the optical image and their corresponding feature points in the spectral detection region;

[0071] Step S3032: Mapping the plurality of feature points one by one, mapping each feature point to the predicted LIBS laser focal point coordinates through the affine transformation matrix and the translation compensation quantity obtained by the current iteration, and comparing with the corresponding measured coordinates to obtain the registration error of each feature point;

[0072] Step S3033: Based on the registration error of each feature point, determining the overall registration error, when the overall registration error is greater than a preset error threshold, simultaneously updating the affine transformation matrix and the translation compensation quantity, and repeating the iterative calculation until the overall registration error is less than or equal to the error threshold, obtaining the final optimized affine transformation matrix and translation compensation quantity;

[0073] Step S3034: Based on the final optimized affine transformation matrix and the translation compensation quantity, obtaining the registration result between the optical image pixel coordinates and the LIBS laser focal point coordinates.

[0074] Specifically, a plurality of distributed feature points are selected in the optical image, such as edge points, corner points or points in a texture significant area, and their corresponding LIBS laser focal point measured coordinates in the spectral detection area are obtained to form a set of point pair data. Subsequently, the selected plurality of feature points are mapped one by one, that is, each feature point is mapped to the predicted LIBS laser focal point coordinate via the affine transformation matrix and the translation compensation amount obtained in the current iteration, and compared with the corresponding measured coordinate, so as to obtain the registration error of each feature point.

[0075] Based on the registration error of each feature point, the overall registration error can be further calculated, for example:

[0076] e =∑|X LIBS -T·X img -δ|

[0077] Wherein, e represents the overall registration error, which is used to measure the matching accuracy between the optical image pixel coordinates and the LIBS laser focal point coordinates, and the value is obtained by accumulating or averaging the residuals of a plurality of feature points; ∑ represents calculating the residual and summing up one by one on a plurality of feature points, reflecting the overall error level; X LIBS represents the measured LIBS laser focal point coordinates; X img represents the optical image pixel coordinates; T represents the affine transformation matrix; δ represents the translation compensation amount.

[0078] When the overall registration error is greater than a preset error threshold (for example, 5 μm), the affine transformation matrix and the translation compensation amount need to be updated simultaneously, and the update of the affine transformation matrix can be represented as:

[0079] T n+1 =T n +diag(Δθ,Δs,Δk x ,Δk y )·T n

[0080] Wherein, T n represents the affine transformation matrix in the n th iteration, T n+1 represents the affine transformation matrix updated after the n+1 th iteration; diag(Δθ,Δs,Δk x ,Δk y ) represents a four-diagonal correction matrix, wherein each component represents the correction amount of different parameters in one iteration: Δθ represents the correction amount of the rotation angle, Δs represents the correction amount of the scaling coefficient, Δk x represents the shear correction amount in the x direction, and Δk y represents the shear correction amount in the y direction.

[0081] The update of the translation compensation amount can be represented as:

[0082] δ n+1 = δ n + Δδ

[0083] wherein δ n represents the translation compensation at the n-th iteration; δ n+1 represents the translation compensation updated after the (n+1)-th iteration; and Δδ represents the translation correction including Δx and Δy components, for iterative updating of the translation compensation δ.

[0084] In the iterative updating process, the plurality of optical image feature points are mapped to the predicted LIBS laser focal point coordinates, and compared with the corresponding measured coordinates to calculate the registration residual. The residual is used to determine the overall registration error, and the affine matrix parameters and the translation compensation are adjusted according to the overall error in each iteration, so as to gradually reduce the overall registration error until it converges within the error threshold, and the final optimized affine matrix T final and the translation compensation δ final are obtained. Since the physical size of the pixels in camera imaging is usually in the order of several microns, for example, each pixel corresponds to an actual spatial size of 5 μm or less, therefore, when the overall registration error is controlled within 5 μm, it means that the error is less than the physical width of a single pixel, in other words, the mapping accuracy is better than the resolution of a single pixel, that is, the sub-pixel level spatial alignment effect is achieved.

[0085] The final optimized affine transformation matrix T final and the translation compensation δ final are used to describe the corresponding relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates. Specifically, the two satisfy:

[0086] X LIBS = T final ·X img + δ final

[0087] wherein X img is the pixel coordinate in the optical image, and X LIBS is the corresponding laser focal point coordinate on the sample surface.

[0088] To realize the visualization display of superimposing the spectral detection results to the optical image, the embodiment adopts the reverse mapping mode: for each laser sampling point X LIBS with spectral value, calculate

[0089]

[0090] wherein X is the mapped optical image pixel coordinate, and T is the inverse matrix of the final optimized affine transformation matrix.

[0091] By setting the LIBS laser focal point coordinate X LIBS Subtract the final optimized translation compensation amount δ final , the overall position offset is corrected; then the inverse matrix of the final affine transformation matrix is used Transform it to the pixel coordinate system of the optical image, so as to obtain the mapped pixel coordinates Based on the mapping result, the spectral intensity of each sampling point is projected to a pixel grid of the same size as the optical image by bilinear interpolation or neighborhood weighting, generating a spectral distribution map (such as a pseudo-color intensity map or an element heat map) strictly aligned with the image coordinate system. In the visualization interface, the RGB true color of the optical image is used as the background, and the spectral distribution map is displayed in superposition with a set transparency, thereby obtaining a high-precision registration result of the optical image and the spectral detection area, and realizing unified visualization of the image domain and the spectral detection domain.

[0092] Therefore, in step S3, by setting a two-level fusion structure, first, the attention mechanism is used to realize channel weighting fusion of image features and spectral features, thereby obtaining a first fusion feature sensitive to high-discrimination texture and high-SNR spectral lines; then, based on the first fusion feature, the coordinate offset is predicted by a lightweight sequence modeling network, and the affine transformation matrix and the translation compensation amount are iteratively corrected. Since the whole process uses low-dimensional feature input and lightweight network structure (parameter amount <3M), the calculation overhead of single registration is extremely small, and its deployment on FPGA or embedded chip takes less than 1ms for single inference, which can meet the real-time requirement of industrial online detection. At the same time, through two-level fusion, the alignment is gradually realized from the feature layer to the coordinate layer, which can effectively solve the problem of non-uniformity of optical image and spectral detection data in heterogeneous coordinate systems, and ensure the accuracy and real-time performance of the final registration result.

[0093] It is not difficult to find that in the scheme provided by the embodiments of the present application, by introducing attention weighting and coordinate offset prediction on the basis of primary fusion, the optical image features and the spectral detection features can be combined in depth in spatial dimension and component dimension. Through joint prediction and correction of the rotation angle, the scaling coefficient, the shear coefficient and the translation compensation amount, not only can the deviations caused by mechanical errors, optical distortion and sample surface undulations be dynamically eliminated, but also the iterative optimization under the overall constraint of multiple feature points can be realized, thereby significantly improving the registration accuracy and stability. The scheme ensures adaptive updating of the mapping relationship, so that the optical image and the spectral detection area can always maintain sub-pixel level spatial alignment effect.

[0094] Third embodiment

[0095] The third embodiment of the present application relates to a method for registering an optical image and a LIBS detection area. The third embodiment is an improvement based on the first embodiment, and the specific improvement is that before step S2, the method further comprises dynamic spot positioning and drift compensation, which specifically comprises:

[0096] Before laser excitation, the laser is controlled by the galvanometer to scan in a preset focus optimization area, and the target focus point of the laser is determined based on the monitored reflection light intensity peak value during the scanning process;

[0097] During the detection of the sample to be detected, the target focus point is taken as a reference, the height variation of the sample surface is measured in real time through the confocal lens, the height variation is converted into a correction amount of the focus point position according to the axial offset coefficient of the objective lens, the LIBS laser focus point coordinates are updated, and the defocusing error caused by the ups and downs or inclination of the sample surface is compensated.

[0098] Specifically, the purpose of dynamic spot positioning is to find the best focus state of the laser before sample detection. To this end, before laser excitation, dynamic spot positioning is performed, the laser is controlled by the galvanometer to perform spiral scanning in a preset focus optimization area (for example, a range of 500x500μm) according to a set step (for example, 1μm), and the change of the reflection light intensity is monitored during the scanning process. When the peak value of the reflection light intensity is detected, the position is determined as the target focus point of the laser, thereby avoiding the defocusing breakdown problem caused by the focus point shift. In actual implementation, the target focus point can also be a reference point determined by other focus optimization algorithms.

[0099] During the subsequent detection of the sample to be detected, drift compensation is performed, that is, the target focus point is taken as a reference, the height variation Δz of the sample surface is measured in real time through the confocal lens, and when the sample surface has ups and downs or inclination, the height variation will cause the focus point position to drift. To this end, the axial offset coefficient α (which can be obtained through calibration experiments) of the objective lens is used to convert the height variation Δz into a correction amount of the focus point position, and the laser focus point coordinates are updated through the following formula to compensate for the defocusing error caused by the ups and downs or inclination of the sample surface:

[0100] X' LIBS =X LIBS +α·Δz

[0101] Wherein, X LIBS represents the original laser focus point coordinates, and X' LIBSThe laser focal point coordinates are represented. Through the above updating, the defocusing error caused by the ups and downs or tilting of the sample surface can be compensated in real time, so as to ensure that the laser energy stably acts on the sample surface. Further, the experimental results show that, under the action of the dynamic drift compensation, the defocusing breakdown rate can be reduced by about 90%, and the plasma excitation efficiency and the signal-to-noise ratio of the spectrum detection are significantly improved.

[0102] Benefiting from the wide linear region near the focal point of the differential confocal and the adaptive gain control, the scheme can increase the available defocusing tolerance to about ± 50 μm, and effectively maintain the effective focusing and coordinate consistency even for curved or flexible samples.

[0103] It can be found that, in the scheme provided by the embodiments of the application, the dynamic spot positioning and drift compensation process is introduced in the registration method, the focusing optimization can be automatically completed before the laser excitation, and the laser focal point position is dynamically modified according to the height change of the sample surface monitored in real time during the sample detection process. The scheme effectively avoids the breakdown failure problem caused by defocusing in the traditional method, so that the laser energy always stably acts on the sample surface. Under the condition of stable focusing, the excitation efficiency and repeatability of the plasma are improved, the collected spectrum signal has higher intensity and clarity, and thus the signal-to-noise ratio and overall detection reliability of the spectrum detection are significantly improved.

[0104] It should be noted that the third embodiment of the application can also be an improvement on the basis of any one or more of the first embodiment to the second embodiment.

[0105] Fourth embodiment

[0106] The fourth embodiment of the application relates to an optical image and LIBS detection area registration method. The fourth embodiment is an improvement on the basis of the first embodiment, and the specific improvement lies in that, after step S4, the method further comprises: a registration modification process based on external input, and the registration modification process specifically comprises:

[0107] generating a control point for adjusting the registration result in the visualization interface, and receiving a displacement operation instruction of the control point;

[0108] in response to the displacement operation instruction, determining a difference value between the initial coordinates and the modified coordinates of the control point, and storing the difference value as a modification amount;

[0109] storing the modification amount as an external input parameter, and modifying an affine transformation matrix and a translation compensation amount used to describe the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates by the modification amount, so as to reduce the registration deviation between the optical image pixel coordinates and the LIBS laser focal point coordinates.

[0110] Specifically, in the process, first, an interactive control point for assisting in registration correction is generated in the visualization interface, the control point can be overlaid on the superimposed diagram of the optical image and the spectral detection result, and a user can intuitively observe the registration effect and manually adjust. Subsequently, the data processing and visualization module receives a displacement operation instruction of the user on the control point, and the instruction can be realized by mouse dragging or touch operation.

[0111] When responding to the user operation, the data processing and visualization module records the initial coordinate position of the control point and the corrected coordinate position after the user adjustment, and calculates the difference between the two. The difference is used as a correction amount to represent the manual intervention information of the external input on the registration result.

[0112] Further, the correction amount can be stored as an external input parameter and used to correct the affine transformation matrix and the translation compensation amount describing the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates. By introducing the external correction parameter on the basis of the original automatic registration, the residual registration deviation that may exist between the optical image pixel coordinates and the LIBS laser focal point coordinates can be effectively reduced.

[0113] Through the external input correction mechanism, the efficiency and intelligence of automatic registration can be ensured, and higher precision and flexibility can be realized by relying on manual intervention in special scenarios. For example, when there are local distortion, reflection anomaly or insufficient feature points on the sample surface, the user can manually adjust the control point for correction, thereby ensuring the reliability and accuracy of the registration result in the visualization display and subsequent element distribution analysis.

[0114] It should be noted that the fourth embodiment of the present application can also be an improvement on the basis of any one or more of the first to third embodiments.

[0115] The step division of the above methods is only for the purpose of clear description, and when implemented, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, all within the protection scope of the present application; adding irrelevant modifications or introducing irrelevant designs in the algorithm or process, but not changing the core design of the algorithm and process, are within the protection scope of the present application.

[0116] In addition, some embodiments of the present application also provide an electronic device. The electronic device can be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0117] The electronic device includes one or more processors, and a memory storing computer program instructions that, when executed, cause the processors to perform a method of registering an optical image with a LIBS detection area as provided by any one or more of the embodiments described above. Figure 4 An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and an interface for connecting various components, including a high-speed interface and a low-speed interface. The various components are connected to each other via different buses, and can be mounted on a common motherboard or in other ways as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory or on the memory to display a GUI on an external input / output device, such as a display device coupled to the interface. In some other embodiments, multiple processors and / or buses can be used with multiple memories and multiple memory, if desired. Also, multiple electronic devices can be connected, each device providing part of the necessary operations. Among them, the components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described and / or claimed herein.

[0118] The electronic device can also include an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103 and the output device 1104 can be connected by bus or other means, Figure 4 The connection by bus is taken as an example in the middle.

[0119] The input device 1103 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device, such as touch screen, keypad, mouse, trackpad, touchpad, pointing stick, one or more mouse buttons, trackball, joystick, etc. The output device 1104 can include a display device, an auxiliary lighting device (e.g., LED), and a tactile feedback device (e.g., a vibration motor), etc. The display device can include but is not limited to liquid crystal display, light emitting diode display and plasma display. In some embodiments, the display device can be a touch screen.

[0120] To provide for interaction with a user, the electronic device can be a computer. The computer has a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, etc.); and input from the user can be received in any form (e.g., acoustic input, speech input, tactile input, etc.).

[0121] In the embodiments of the present application, the computer program / instruction is stored on the computer readable medium, and the computer program / instruction is executed by the processor to implement the method for registering the optical image and the LIBS detection area provided by any one or more of the above embodiments. The computer readable medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the device. The computer readable medium carries one or more computer readable instructions.

[0122] The memory 1102 can be used as a non-transitory computer readable storage medium to store non-transitory software programs, non-transitory computer executable programs and modules. The processor 1101 executes various functions and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more of the above embodiments in the embodiments of the present application.

[0123] The memory 1102 can include a program storage area and a data storage area. The program storage area can store operating systems, application programs required by at least one function; and the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 1102 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 1102 can optionally include a memory disposed remotely with respect to the processor 1101, and these remote memories can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0124] It is instructive to note that the computer readable medium described in the present application can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable medium may, for example, be, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disc read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.

[0125] The computer readable medium includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technology, read-only optical disc, digital versatile disc or other optical storage, magnetic cassette, magnetic tape disc storage or other magnetic storage device, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0126] Computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of the same, including an object oriented programming language such as

[0127] Java, Smalltalk, C++, as well as conventional procedural programming languages such as C or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network or a wide area network, or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0128] In the above-described embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. For example, application specific integrated circuits, general purpose computers or any other similar hardware devices can be used. In some embodiments, the software programs of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software programs of the present application (including related data structures) can be stored in a computer-readable recording medium, such as a RAM memory, a magnetic or optical drive or a soft disk and the like. In addition, some steps or functions of the present application can be implemented by hardware, such as a circuit cooperating with a processor to perform the respective steps or functions.

[0129] The computer program product provided by the embodiments of the present application includes one or more computer programs / instructions, which, when executed by a processor, generate all or part of the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk) and the like.

[0130] The flowchart or block diagram in the drawings illustrates the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently, or the blocks can sometimes be executed in reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, or combinations of blocks in the block diagrams and / or flowchart illustrations, can be implemented by special-purpose hardware-based systems that perform the specified functions or operations, or combinations of special-purpose hardware and computer instructions.

[0131] The scope of the application is defined by the appended claims rather than by the description set forth herein, and therefore the specification is not intended to limit the claims in any way. No admission is made that any of the related art references are prior art. It will be apparent that modifications and / or improvements can be made to the embodiments described herein without departing from the scope of the application. Accordingly, while the application is presented in terms of embodiments, it should be appreciated that the application is not limited to these embodiments. The application is limited only by the claims that follow, the full scope of which is deemed to encompass any changes which come within the meaning and range of equivalency of the claims. None of the features or limitations described herein are intended to be limiting but are intended to be examples of presently preferred embodiments. Thus, it should be apparent that the application can be practiced otherwise than as specifically outlined herein without departing from the scope and spirit of the application. Any discussion of mechanisms underlying the application should be treated as pure speculation, capable of

[0132] The above description is only specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily make changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be limited by the protection scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.

Claims

1. A method for registering an optical image with a LIBS detection region, characterized in that, include: Optical images, three-dimensional morphology data, and spectral detection data of the sample to be tested are acquired, and a sample space coordinate system is established based on the optical images and the three-dimensional morphology data. The spectral detection data is acquired from a preset spectral detection area on the surface of the sample to be tested. Establish a mapping relationship between the optical image pixel coordinates and the LIBS laser focus coordinates in the sample space coordinate system; The image features of the optical image and the spectral features of the spectral detection data are extracted, and the mapping relationship is fused and updated based on the image features and the spectral features to obtain the registration result between the optical image and the spectral detection region; Using the sample space coordinate system as a unified reference, the optical image is superimposed and displayed with the spectral detection results aligned based on the registration results in the visualization interface.

2. The optical image and LIBS detection region registration method according to claim 1, characterized in that, Before the step of establishing the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates in the sample space coordinate system, the method further includes: dynamic spot positioning and drift compensation, specifically including: Before laser excitation, the laser is controlled by a galvanometer to scan within a preset focusing optimization area, and the target focal point of the laser is determined based on the peak intensity of the reflected light monitored during the scanning process. During the testing of the sample, the target focal point is used as a reference. The height change of the sample surface is measured in real time through a confocal lens. The height change is converted into a correction value for the focal position based on the axial offset coefficient of the objective lens. The LIBS laser focal coordinates are then updated to compensate for defocusing errors caused by undulations or tilting of the sample surface.

3. The optical image and LIBS detection region registration method according to claim 1, characterized in that, The step of establishing the mapping relationship between the optical image pixel coordinates and the LIBS laser focal point coordinates in the sample space coordinate system includes: In the sample space coordinate system, the optical image pixel coordinates and the corresponding LIBS laser focus coordinates are obtained using a double checkerboard calibration plate. Based on the correspondence between the optical image pixel coordinates and the LIBS laser focal coordinates, an affine transformation matrix and a translation compensation amount are constructed to describe the mapping relationship between the optical image pixel coordinates and the LIBS laser focal coordinates.

4. The optical image and LIBS detection region registration method according to claim 1, characterized in that, The step of fusing and updating the mapping relationship based on the image features and the spectral features to obtain the registration result between the optical image and the spectral detection region includes: The image features and the spectral features are initially fused using an attention-weighted approach to obtain the first fused feature. Based on the first fusion feature, predict the coordinate offset between the optical image pixel coordinates and the LIBS laser focus coordinates; Based on the coordinate offset, the affine transformation matrix and translation compensation amount used to describe the mapping relationship between the pixel coordinates of the optical image and the coordinates of the LIBS laser focus are corrected to obtain the registration result between the optical image and the spectral detection region.

5. The optical image and LIBS detection region registration method according to claim 4, characterized in that, The step of performing primary fusion of the image features and the spectral features using an attention-weighted approach to obtain the first fused feature includes: The optical image is used to extract features through a convolutional neural network to obtain image features that reflect the spatial distribution characteristics of the sample surface. Spectral line features are extracted from the spectral detection data, and then mapped to a spatial dimension that matches the image features based on an interpolation method to obtain spectral features; Attention weights are calculated for the image features and the spectral features respectively, wherein the attention weights for the image features are used to highlight texture information with high discriminative power, and the attention weights for the spectral features are used to highlight spectral line information with high signal-to-noise ratio. The image features and the spectral features are weighted based on the attention weights of the image features and the attention weights of the spectral features, and the weighted features are then fused to obtain the first fused feature.

6. The optical image and LIBS detection region registration method according to claim 4, characterized in that, The coordinate offset includes rotation angle, scaling factor, shearing factor, and translation compensation, wherein the rotation angle, scaling factor, and shearing factor are used to update the affine transformation matrix, and the translation compensation is used to correct the overall translation deviation. The step of correcting the affine transformation matrix and translation compensation amount used to describe the mapping relationship between the pixel coordinates of the optical image and the coordinates of the LIBS laser focus based on the coordinate offset, to obtain the registration result of the optical image and the spectral detection region, includes: Select multiple feature points in the optical image and their corresponding feature points in the spectral detection area; The multiple feature points are mapped one by one. The affine transformation matrix and translation compensation amount obtained by the current iteration of each feature point are mapped to the predicted LIBS laser focus coordinates, and compared with the corresponding measured coordinates to obtain the registration error of each feature point. Based on the registration error of each feature point, the overall registration error is determined. When the overall registration error is greater than a preset error threshold, the affine transformation matrix and the translation compensation amount are iteratively updated simultaneously, and the iterative calculation is repeated until the overall registration error is less than or equal to the error threshold, so as to obtain the final optimized affine transformation matrix and translation compensation amount. Based on the final optimized affine transformation matrix and translation compensation, the registration result between the optical image pixel coordinates and the LIBS laser focal point coordinates is obtained.

7. The optical image and LIBS detection region registration method according to any one of claims 1-6, characterized in that, Following the step of overlaying the optical image with the spectral detection result aligned based on the registration result in the visualization interface, the process further includes: a registration correction process based on external input, specifically including: In the visualization interface, control points are generated for adjusting the registration results, and displacement operation commands for the control points are received; In response to the displacement operation command, the difference between the initial coordinates and the corrected coordinates of the control point is determined, and the difference is used as the correction amount; The correction amount is stored as an external input parameter. The correction amount is used to correct the affine transformation matrix and translation compensation amount used to describe the mapping relationship between the optical image pixel coordinates and the LIBS laser focus coordinates, so as to reduce the registration deviation between the optical image pixel coordinates and the LIBS laser focus coordinates.

8. An electronic device, characterized in that, The electronic device includes: One or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform the optical image and LIBS detection region registration method as described in any one of claims 1-7.

9. A computer-readable storage medium having a computer program and / or instructions stored thereon, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the optical image and LIBS detection region registration method as described in any one of claims 1-7.

10. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the optical image and LIBS detection region registration method as described in any one of claims 1-7.

Citation Information

Cited By

  • Wafer detection method and device, medium and product

    CN121856270A

  • Single crystal blade orientation detection method and system based on LIBS characteristic spectral response

    CN121954961A