A method and system for automatic recognition of ion tracks and energy spectrum analysis of a thomson spectrometer based on computer vision

CN122966670APending Publication Date: 2026-10-23PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611120635.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

现有技术虽能满足基本能谱分析需求,但面对现代高重频、大数据激光实验存在诸多弊端:一是效率低下,手动选点耗时久,无法满足海量数据实时分析需求;二是主观误差大,原点和径迹点选取依赖操作人员经验,不同人员处理结果差异大,影响实验可重复性;三是缺乏自适应性,固定灰度阈值无法适配不同曝光程度,容易造成信号丢失或噪声误判;四是拟合约束不足,单独拟合质子径迹、依靠经验设定成像板旋转角,都容易导致曲线参数偏差;五是弱信号识别能力差,难以从强噪声中提取弱信号,容易低估最高截止能量;六是无法定量表征误差,不利于分析数据准确性

Benefits of technology

1.实现全流程自动化,效率提升:本发明实现从图像读取到能谱生成的全自动处理,单张图像处理时间从传统人工的数十分钟缩短至秒级,适配高重频实验数据分析。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966670A_ABST
    Figure CN122966670A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on computer vision's thomson spectrometer ion track automatic identification and energy spectrum analysis method and system.The method includes: obtaining imaging plate digital image and generating two-dimensional floating point gray matrix;Based on pixel gray value order distribution, through sliding window scanning and gradient mutation detection adaptive acquisition image segmentation threshold;Based on threshold extraction imaging plate physical boundary and crop effective data area;Ion track is skeletonized processing, in combination with connected domain analysis separates each independent track curve;Determine the position of origin and extract each ion track trajectory point coordinate;Based on the joint objective function of multiple ion components physical association, solve the deflection field parameters of multiple tracks by joint trajectory fitting;According to fitting trajectory equation, each ion energy spectrum is inverted.The application realizes from original image to physical energy spectrum Full-automatic processing, significantly improve data analysis efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of plasma and particle detection, specifically to a method and system for automatic identification and energy spectrum analysis of ion tracks in a Thomson spectrometer based on computer vision. Background Technology

[0002] In the study of high-power laser-matter interaction, especially in laser-plasma ion acceleration experiments, accurately measuring the type and energy spectrum of ions is one of the core tasks. The Thomson spectrometer is a classic diagnostic device in this field. It relies on mutually perpendicular electric and magnetic fields to deflect charged particles. Since particles with different charge-to-mass ratios deflect in different trajectories, they will form a series of parabolic tracks on the detector. By analyzing the shape and intensity of the tracks, the energy and quantity of ions can be deduced.

[0003] Currently, data processing for the Thomson spectrometer primarily relies on semi-automatic or manual analysis software. Researchers manually determine the origin coordinates and select track data points, and then the software performs curve fitting to calculate the energy spectrum. While existing technology can meet basic energy spectrum analysis needs, it suffers from several drawbacks in modern high-repetition-rate, large-data laser experiments: First, it is inefficient; manual point selection is time-consuming and cannot meet the real-time analysis needs of massive amounts of data. Second, it suffers from significant subjective errors; the selection of origin and track points depends on the operator's experience, leading to large differences in results among different personnel and affecting experimental repeatability. Third, it lacks adaptability; a fixed grayscale threshold cannot adapt to different exposure levels, easily causing signal loss or noise misjudgment. Fourth, it suffers from insufficient fitting constraints; fitting proton tracks alone or relying on experience to set the imaging plate rotation angle can easily lead to curve parameter deviations. Fifth, it has poor weak signal recognition capabilities, making it difficult to extract weak signals from strong noise and easily underestimating the maximum cutoff energy. Sixth, it cannot quantitatively characterize errors, which is detrimental to the accuracy of data analysis.

[0004] To address the aforementioned issues, this invention proposes a method and system for automatic identification of ion tracks and energy spectrum analysis using a Thomson spectrometer based on computer vision. By combining computer vision with numerical optimization algorithms, it achieves end-to-end automated processing of input raw images and output physical energy spectra. Summary of the Invention

[0005] The technical problem to be solved by this invention is to address the shortcomings of the prior art by proposing an automatic identification and energy dispersive spectroscopy (EDS) method for ion tracks in a Thomson spectrometer based on computer vision, comprising the following steps: S1 acquires the digital image of the imaging plate of the Thomson spectrometer and preprocesses the image to obtain a two-dimensional floating-point grayscale matrix. S2 uses the pixel grayscale value sorting distribution based on the two-dimensional floating-point matrix to perform sliding window scanning and gradient change detection to obtain the grayscale threshold for image segmentation. S3 extracts the physical boundary of the imaging plate based on grayscale threshold and crops out the effective data area; S4 performs skeletonization on the ion tracks in the effective data region and separates each independent track curve based on connected component analysis. S5 determines the origin position based on the separated track curves and extracts the coordinates of the trajectory points of each ion track. S6 constructs a joint objective function based on the physical correlation of multiple ion components, performs joint trajectory fitting on multiple ion tracks, and solves for the deflection field parameters; S7 calculates the energy spectrum of each ion by inverting the trajectory equation obtained from the fitting.

[0006] Furthermore, step S2 specifically includes: Flatten the two-dimensional floating-point grayscale matrix into a one-dimensional array and sort it by grayscale value in ascending order; Set a sliding window to scan from the median of the sorted array towards the low and high grayscale areas; Gradient mutation detection is performed, and the relative change rate of the gray-scale mean of the current window and the gray-scale mean of the previous window is calculated. When scanning into a low gray-scale area, the decrease in the gray-scale mean of the window exceeds a first preset threshold, and the gray-scale value of the current window is determined to be the background boundary threshold. When scanning into a high gray-scale area, the increase in the gray-scale mean of the window exceeds a second preset threshold, and the gray-scale value of the current window is determined to be the signal threshold.

[0007] Furthermore, the physical boundaries of the imaging plate are extracted based on grayscale thresholding, including: Based on the background boundary threshold, the top, bottom, left, and right edge regions of the image are scanned respectively, and the coordinates of the first pixel in each edge region whose gray value is greater than the background boundary threshold are extracted. For the pixel coordinates extracted from each edge region, a random sampling consistency regression algorithm is used to fit a straight line, and the fitted line with the most interior points is taken as the boundary line of the corresponding edge. The effective data region is cut out based on the four boundary lines obtained from the fitting.

[0008] Furthermore, step S4 specifically includes: Binarize the effective data region based on the signal threshold; The skeletonization algorithm is applied to the binarized image to extract the morphological skeleton, and the wide trace is refined into lines with a single pixel width. Use convolutional kernels to detect branch points in the skeleton and mark the branch points as visited. Starting from any unvisited non-zero point in the skeleton, recursively search connected pixels along the neighborhood direction, and use a depth-first search algorithm to separate each independent continuous curve; The proton track region is identified based on the span of the curve in a preset direction, and candidate short line signals near the origin are filtered based on the length and position of the curve.

[0009] Further, step S5 includes: Calculate the average gray level of all candidate short line segments, select the line segment with the largest average gray level as the origin signal, calculate the gray level extreme points within the origin signal area as the origin coordinates, if there are multiple extreme points with the same gray level, take their geometric center as the origin coordinates; ions include gold ions, carbon ions and protons.

[0010] Further, step S6 includes: For the proton and carbon ion track regions, a line-by-line scanning method is used to detect grayscale peaks and extract the coordinates of trajectory points for each ion track. A rotation transformation matrix is ​​introduced to transform the image coordinate system to a physical coordinate system with the origin as the origin and the rotation angle corrected. Construct a total objective function that includes the residuals of proton tracks and carbon ion tracks, where the quadratic coefficients of the carbon ion track are constrained by the quadratic coefficients of the proton track through the charge-to-mass ratio relationship; By minimizing the overall objective function, the optimal quadratic coefficients and rotation angle are solved, and the effective electric field voltage is derived.

[0011] Further, step S7 includes: For each pixel on the track curve, the particle energy of the corresponding ion is calculated based on its longitudinal distance from the origin. The pixel grayscale value is converted into the light-excited luminous intensity value, and the number of ions is calculated based on the response function of the imaging plate to ions of different energies. The energy spectrum is calculated by combining the solid angle and the energy differential term, and an energy spectrum curve in logarithmic coordinates is generated. The background energy spectrum is calculated by selecting a signal-free region next to the track curve, which is used to quantitatively determine the confidence level of the signal and determine the cutoff energy.

[0012] An automatic ion track identification and energy dispersive spectroscopy analysis system based on computer vision for Thomson spectrometers, used to implement any of the above methods, includes the following modules: The parameter configuration and data input module is used to receive experimental parameters and read digital images from the imaging plate, and to normalize the images to obtain a grayscale matrix. The image adaptive preprocessing and effective region extraction module is used to adaptively determine the gray threshold based on the pixel gray statistical distribution of the gray matrix, and extract the physical boundary of the imaging plate based on the gray threshold to obtain the effective data region. The skeletonization and origin search module is used to skeletonize the binarized image and automatically identify the origin signal to determine the origin coordinates. The automatic trajectory point extraction module is used to extract the coordinates of trajectory points of each ion track by using a line-by-line scanning combined with a peak detection strategy; The joint constraint fitting module is used to construct the overall objective function that includes the track residuals of protons and carbon ions, and to solve for the optimal quadratic coefficients and rotation angles. The energy spectrum inversion and output module is used to invert and calculate the energy spectrum of each ion based on the fitted trajectory equation and output it.

[0013] Furthermore, the image adaptive preprocessing and effective region extraction module includes: The sub-image extraction and rotation unit is used to extract the sub-image of interest from the image and perform image rotation so that the ion track extends along a specific direction; The statistical adaptive thresholding unit is used to flatten and sort the grayscale matrix and then detect the jump points of the grayscale mean by scanning through a sliding window, and automatically calculate the background boundary threshold and the signal threshold. The random sampling consistency boundary fitting unit is used to perform line fitting on the coordinates of pixels with gray levels greater than the background boundary threshold in each edge region using the random sampling consistency regression algorithm. The effective data region is then cropped based on the four boundary lines obtained from the fitting.

[0014] Furthermore, the energy spectrum inversion and output module includes: The photoexcited emission conversion unit is used to convert pixel grayscale values ​​into photoexcited emission intensity values, and calculate ion flux by combining solid angle and exposure time; The energy scale and inversion unit is used to establish a one-to-one mapping relationship between position coordinates and particle energy based on the trajectory equation obtained by fitting, and to calculate the energy differential distribution of different types of ions such as gold, carbon, and protons respectively. The visualization and report generation unit is used to automatically draw fitted curves, grayscale distribution maps, and energy spectrum maps, and export data tables containing background error data.

[0015] Compared with the prior art, the present invention achieves the following technical effects: 1. Achieve full-process automation and improve efficiency: This invention realizes fully automated processing from image reading to energy spectrum generation, reducing the processing time of a single image from tens of minutes in traditional manual processing to seconds, and is suitable for high repetition rate experimental data analysis.

[0016] 2. Adaptive threshold mechanism: This invention features a unique threshold recommendation algorithm based on sorted pixel gradients, which solves the problem of fixed thresholds failing due to large differences in exposure between different experimental exposures. The threshold can be dynamically adjusted according to the statistical characteristics of each image to ensure complete data extraction.

[0017] 3. Introducing the RANSAC algorithm, the boundary recognition is robust: In view of the problem that traditional edge detection is easily affected by factors such as damage to the imaging plate, the present invention adopts the RANSAC algorithm, which can effectively remove outliers. Even if the boundary is incomplete or there are noise, it can accurately fit the physical boundary of the imaging plate.

[0018] 4. Employing multi-ion joint constraint fitting results in higher physical accuracy: Traditional methods use only the proton signal for fitting, which is easily affected by voltage instability and produces large deviations, making it impossible to accurately determine the type and valence state of high-Z ion signals; This invention utilizes the motion correlation between protons and carbon ions to establish a joint residual equation, using high-energy signals to constrain drifting low-energy proton signals, thereby improving fitting accuracy and the ability to predict high-Z ion signals.

[0019] 5. Highly sensitive weak signal recognition: This system can identify high-energy weak signals that are difficult to distinguish with the naked eye by scanning along the signal curve with a sliding window. It also has a special algorithm designed for heavy ions such as gold ions to search for the lowest charge state, which can display a more complete charge state distribution.

[0020] 6. Outputs rich and complete data and supports visualization: This system not only outputs the final energy spectrum, but also generates Excel files and diagnostic images containing information such as fitting residuals, intermediate process points, and background data, which facilitates secondary analysis and troubleshooting of experimental problems. Attached Figure Description

[0021] For ease of explanation, the present invention will be described in detail below with reference to specific embodiments and accompanying drawings.

[0022] Figure 1 A flowchart illustrating an automatic identification and energy dispersive spectroscopy (EDS) method for Thomson spectrometer ion tracks based on computer vision, provided for an embodiment of the present invention. Figure 2 This is a flowchart illustrating the adaptive threshold calculation method provided in an embodiment of the present invention. Figures 3(a)-(c) show the proton energy spectrum, the energy spectra of gold ions from +37 to +56 valence, and the energy spectra of carbon ions with +6 valence provided in the embodiments of the present invention. Figure 4 A schematic diagram of the functional module structure of a Thomson spectrometer ion track automatic identification and energy spectrum analysis system based on computer vision is provided in an embodiment of the present invention. Figure 5 This is a schematic diagram of the image adaptive preprocessing and effective region extraction module provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the energy spectrum inversion and output module provided in an embodiment of the present invention. Detailed Implementation

[0023] The following are specific embodiments of the present invention, described in conjunction with the accompanying drawings, to further illustrate the technical solutions of the present invention. However, the present invention is not limited to these embodiments. Specific details, such as particular configurations, are provided in the following description merely to aid in a comprehensive understanding of the embodiments of the present invention. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention.

[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.

[0025] Example 1 This invention provides a computer vision-based method for automatic ion track identification and energy dispersive spectroscopy analysis using a Thomson spectrometer. Figure 1 As shown, it includes the following steps: S1 acquires the digital image of the imaging plate of the Thomson spectrometer and preprocesses the image to obtain a two-dimensional floating-point grayscale matrix.

[0026] Specifically, it reads TPS digital image files acquired by a scanner, supporting image reading in various formats (such as .gel, .tif, etc.). After determining the image data type, it automatically performs normalization processing based on the image bit depth, mapping pixel values ​​to the [0, 1] interval to obtain a two-dimensional floating-point grayscale matrix with values ​​in the [0, 1] range, ensuring that subsequent processing algorithms are independent of specific hardware. The two-dimensional floating-point grayscale matrix is ​​obtained by using `img = tiffile.imread(filepath)` to read the image file (compatible with .gel, .tif, etc.), converting the image to floating-point using `img = img.astype(np.float64)`, and converting the image to a normalized matrix using `img = img / numpy.max(img)`.

[0027] S2 uses the pixel grayscale value distribution sorted by the size of a two-dimensional floating-point matrix to perform sliding window scanning and gradient abrupt change detection, and obtains the grayscale threshold for image segmentation.

[0028] Specifically, to address the uncertainty of manually setting thresholds, this invention employs an adaptive threshold recommendation algorithm based on global pixel sorting statistics, such as... Figure 2 As shown, it specifically includes: S21 Flattening Sorting: Flatten the two-dimensional floating-point grayscale matrix into a one-dimensional array and sort it according to the grayscale values ​​from smallest to largest.

[0029] S22 Sliding Window Scan: Sets a fixed-size stepwise scanning window, starting from the median of the sorted array, and scans towards the low grayscale area and the high grayscale area respectively, to find the background boundary and signal threshold.

[0030] S23 Gradient Abrupt Change Detection: Calculates the relative rate of change between the average grayscale value of the current window and the average grayscale value of the previous window. For background boundaries: When the decrease in the average grayscale value of a window exceeds a first preset threshold, the grayscale value of that window is determined to be the boundary between the imaging plate and the scanned background, i.e., the "background boundary threshold". For signal extraction: When the increase in the average grayscale value of a window drastically exceeds a second preset threshold, this grayscale value is determined to be the "signal threshold". The signal threshold is used as the criterion to perform binarization processing on the cropped effective imaging plate image. Pixel grayscale values ​​≥ the signal threshold are determined to be valid ion track signals, and grayscale values ​​< the threshold are determined to be background noise and removed. The grayscale image with mixed noise is converted into a binary image that retains the ion track and origin signal. The first preset threshold and the second preset threshold are set by those skilled in the art according to the actual situation. However, it should be noted that the background threshold is set to a small value, such as 5% or 10%, because the difference between the background grayscale of the overall image and the background (non-signal) grayscale on the IP board is small. The signal threshold is set to a large value, such as 70% or 80%, because the difference between the signal grayscale and the background (non-signal) grayscale on the IP board is large.

[0031] This step enables adaptive processing of images with different exposure levels, obtaining the optimal grayscale threshold for segmentation without manual intervention.

[0032] S3 extracts the physical boundary of the imaging plate based on grayscale thresholding and then crops out the effective data area.

[0033] To accurately determine the valid data area, the physical edges of the imaging plate need to be identified. Step S3 specifically includes: Based on the background boundary threshold obtained in step S2, the top, bottom, left, and right edge regions of the image are scanned, and the coordinates of the first edge pixel with a gray value greater than the threshold are extracted.

[0034] Since the edges of the imaging plate may have wear, stains, or scanning artifacts, direct linear fitting will result in a large error. Therefore, this invention employs the Random Sample Consensus (RANSAC) regression algorithm. For the pixel coordinates extracted from each edge region, random sampling is performed, and a linear model is iteratively fitted. The number of interior points is counted, and the model with the most interior points is taken as the final boundary line.

[0035] Based on the four fitted boundary lines (top, bottom, left, and right), the image region containing only valid data is cropped out.

[0036] S4 performs skeletonization on the ion tracks in the effective data region and separates each independent track curve based on connected component analysis.

[0037] To address the issues of overlapping and crossing ion signals, this invention employs a skeletonization combined with depth-first search scheme for skeleton extraction and track separation, specifically including: Binarization and Skeletonization: The effective data region is binarized using the signal threshold obtained in step S2, and a skeletonization algorithm is applied to extract the morphological skeleton, refining the wide track into lines of single-pixel width. The skeletonization algorithm utilizes the `skeletonize` function from the built-in `skimage.morphology` package in Python to distinguish signal lines of different ions, thus enabling the identification of proton signal regions in subsequent steps using the maximum length criterion.

[0038] Branch point detection: 3×3 convolutional kernels are used to detect branch points in the skeleton and mark them as visited to prevent the path tracing algorithm from getting stuck in an infinite loop. The 3×3 convolutional kernel detection of branch points involves creating a 3×3 convolutional kernel (core value 10, surrounding values ​​1) centered on each point and containing 8 surrounding points. The convolution value is calculated using the `cv2.filter2D` function from Python's built-in `cv` package. If the convolution value is greater than or equal to 15, it is determined to be a branch point.

[0039] Depth-first search tracing: Starting from any unvisited non-zero point in the skeleton, recursively search connected pixels along the neighborhood direction to separate each independent continuous curve and store it in a curve list. This invention uses 8-neighborhood recursion, that is, searching sequentially in 8 directions around the current point: if a branch point is found in a certain direction, the subsequent search process in that direction is terminated; if a non-branch point is found in that direction, the search continues downward along that direction until the entire target curve is completely extracted. The depth-first search is implemented using the standard depth-first search form.

[0040] Feature filtering: Based on the span of the curve in the preset direction (i.e., the longitudinal direction), the proton track region is identified. That is, by taking advantage of the physical property that the longitudinal deflection span of the proton is much larger than that of heavy ions, the exclusive region of the proton parabola is automatically identified, and the trajectories of the proton are separated from those of other ions.

[0041] Specifically, within the IP plate, the longitudinal diffusion range of ions is controlled by an electric field, and its extension characteristics are related to ion energy; while the lateral deflection of ions is controlled by a magnetic field. Protons have the highest charge-to-mass ratio among all ions, therefore their deflection is the smallest, corresponding to the smallest quadratic coefficient of the parabolic track distribution function. Thus, within the same longitudinal extension range, the proton track can typically cover the entire IP plate, meaning its lateral deflection is insufficient to exceed the IP plate boundary. Other ion types exhibit stronger lateral deflection effects; their lateral position exceeds the IP plate's detection range before their longitudinal extension reaches the IP plate boundary, resulting in shorter observed ion track lengths.

[0042] Based on the length and position of the curves, short line signals near the origin are selected as candidates. That is, by filtering the long parabolic curve of the ion and the short lines of noise around the origin on the IP board, most irrelevant curves are quickly eliminated, and only short lines near the origin that meet the physical characteristics are retained as candidates. This narrows the origin identification range, eliminates the false interference of ion trajectory and scanning noise, and improves the efficiency and accuracy of origin positioning. The origin on the IP board is located at the edge in the vertical direction and the center in the horizontal direction. The approximate range is set by the experimenter according to the actual situation. It is generally set at 80%-90% in the vertical direction (i.e., the edge) and 40%-60% in the horizontal direction (i.e., the center).

[0043] S5 determines the origin position based on the separated track curves and extracts the coordinates of the trajectory points of each ion track.

[0044] The specific method for high-precision origin positioning is as follows: calculate the average gray level of all candidate short line segments in step S4, select the line segment with the largest average gray level as the origin signal, and then calculate the gray level extreme point in the region as the precise origin coordinates (x0, y0).

[0045] S6 constructs a joint objective function based on the physical correlation of multiple ion components, performs joint trajectory fitting on multiple ion tracks, and solves for the deflection field parameters. Specifically, it includes: Data extraction: Using the proton line identification results in step S4, the grayscale peak value is detected by line-by-line scanning in the proton and carbon ion track regions, and the coordinates of the trajectory points of each ion track are extracted.

[0046] Fitting and optimization: A rotation transformation matrix is ​​introduced to transform the image coordinate system to a physical coordinate system with the origin coordinates (x0, y0) as the origin and corrected for the rotation angle θ. Specifically, the built-in Python function cv2.getRotationMatrix2D is used, and the rotated image can be obtained by inputting the origin coordinates (x0, y0) and the rotation angle θ.

[0047] Joint constraint fitting: Construct a total objective function that includes the residuals of proton and carbon ion tracks. Based on the physical principles of the Thomson spectrometer, the deflection trajectories of different ions in the same electromagnetic field satisfy a defined charge-to-mass ratio relationship; therefore, the quadratic coefficient of the carbon ion track... The coefficients of the quadratic term of the proton track By constraining the charge-to-mass ratio, and minimizing the joint residual objective function, the quadratic coefficients of the optimal carbon ion and proton tracks are calculated. , And the rotation angle θ. Not only was the curve fitted, but the deflection field parameters, such as the effective electric field voltage actually applied to the ions, were also derived.

[0048] The load-to-mass ratio constraint is: The new quadratic coefficients are obtained by dividing the coefficients of the quadratic term by the charge-to-mass ratio. The `least_squares` function from the built-in `scipy.optimize` package in Python is used directly for fitting. The deflection field parameters are obtained by curve fitting using carbon ions and protons. It should be noted that this invention uses the mutual constraint between the carbon ion curve and the proton curve for automated fitting, effectively eliminating fitting errors caused by electric field drift at the low-energy end of the proton line.

[0049] S7 calculates the energy spectrum of each ion by inverting the trajectory equation obtained from the fitting.

[0050] This step specifically includes: For each pixel on the track curve, the particle energy of the corresponding ion is calculated based on its distance from the origin in the vertical direction.

[0051] The pixel grayscale values ​​are converted into light-excited luminous intensity (PSL) values, and the number of ions is calculated based on the IP board's response function to ions of different energies.

[0052] First, determine the theoretical PSL value that the ion energy can produce, as follows: For proton p + : (1) For gold ions Au X+ : (2) For carbon ions C 6+ : (3) in, The values ​​are the PSL values ​​for protons, gold ions, and carbon ions after 30 minutes of exposure. E represents the energy of the proton, and E represents the energy of the gold ion. Carbon ion energy, measured in MeV; .

[0053] Then, the PSL value corresponding to the pixel's grayscale value in the actual experiment is calculated as follows: (4) Where R is the scanning resolution, S is the scanner sensitivity, L is the dynamic range dimension, G is the bit depth, and QL is the pixel quantum value, which is determined by the parameters provided by the scanning device used.

[0054] Because the metastable spontaneous decay of protons, gold ions, and carbon ions after exposure causes the imaging plate signal to decay exponentially over time, the PSL measured by scanning must be corrected for the interval between exposure and scanning. The PSL 30 minutes after exposure is used as the benchmark, and the correction formula is as follows: (5) Where t is the exposure to scan time in minutes, and PSL(t) is the uncorrected raw reading measured at any waiting time t.

[0055] Will respectively with Dividing them gives the number of protons, gold ions, and carbon ions at the corresponding pixel.

[0056] By combining the solid angle and the energy differential term, the energy spectrum is calculated, and the energy spectrum curve in logarithmic coordinates is generated.

[0057] The signal-free region is automatically selected on the side of the track curve, and the background energy spectrum is calculated using the above formulas (1)-(4). The spectrum is then displayed in the final chart as shown in Figure 3(a)-(c). By quantitatively comparing the signal energy spectrum and the background energy spectrum in Figure 3, the confidence level of the signal and the cutoff energy can be determined. When the energy spectrum calculated along the signal curve is the same as the ordinate of the energy spectrum calculated along the background curve, it is considered to be the cutoff energy.

[0058] Example 2 Based on the same inventive concept, embodiments of the present invention also provide a system for implementing the above-described method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision. The solution provided by this system is similar to the solution described in the above method; therefore, specific limitations in one or more system embodiments provided below can be found in the limitations of the automatic identification and energy dispersive spectroscopy analysis method for ion tracks using a Thomson spectrometer based on computer vision described above, and will not be repeated here.

[0059] In one exemplary embodiment, such as Figure 4 As shown, a computer vision-based automatic ion track identification and energy spectrum analysis system for Thomson spectrometers is provided, comprising the following modules: The parameter configuration and data input module is used to receive experimental parameters and read digital images from the imaging plate, and to normalize the images to obtain a grayscale matrix.

[0060] The image adaptive preprocessing and effective region extraction module is used to adaptively determine the gray level threshold based on the pixel gray level statistical distribution of the gray level matrix, and extract the physical boundary of the imaging plate based on the gray level threshold to obtain the effective data region.

[0061] The skeletonization and origin search module is used to skeletonize the binarized image and automatically identify the origin signal to determine the origin coordinates.

[0062] The automatic trajectory point extraction module is used to extract the coordinates of trajectory points of each ion track by employing a line-by-line scanning combined with a peak detection strategy.

[0063] The joint constraint fitting module is used to construct the overall objective function that includes the track residuals of protons and carbon ions, and to solve for the optimal quadratic coefficients and system rotation angle.

[0064] The energy spectrum inversion and output module is used to invert and calculate the energy spectrum of each ion based on the fitted trajectory equation and output it.

[0065] Among them, such as Figure 5 As shown, the image adaptive preprocessing and effective region extraction module includes: The sub-image extraction and rotation unit is used to extract the sub-image of interest from the image and perform image rotation so that the ion track extends in a specific direction.

[0066] The statistical adaptive thresholding unit is used to flatten and sort the grayscale matrix and then detect the abrupt changes in the grayscale mean by scanning through a sliding window, automatically calculating the background boundary threshold and the signal threshold.

[0067] The random sampling consistency boundary fitting unit is used to perform line fitting on the coordinates of pixels with gray levels greater than the background boundary threshold in each edge region using the random sampling consistency regression algorithm. The effective data region is then cropped based on the four boundary lines obtained from the fitting.

[0068] Among them, such as Figure 6 As shown, the energy spectrum inversion and output module includes: The light-excited emission conversion unit is used to convert pixel grayscale values ​​into light-excited emission intensity values, and calculate ion flux by combining solid angle and exposure time.

[0069] The energy scale and inversion unit is used to establish a one-to-one mapping relationship between position coordinates and particle energy based on the trajectory equation obtained by fitting, and to calculate the energy differential distribution of different types of ions such as gold, carbon, and protons.

[0070] The visualization and report generation unit is used to automatically draw fitted curves, grayscale distribution maps, and energy spectrum maps, and export data tables containing background error data.

[0071] Those skilled in the art to which this invention pertains may make various modifications or additions to the specific embodiments described or use similar methods to replace them, without departing from the inventive concept of this invention or exceeding the scope defined by the appended claims.

Claims

1. A method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, characterized in that, Includes the following steps: S1 acquires the digital image of the imaging plate of the Thomson spectrometer and preprocesses the image to obtain a two-dimensional floating-point grayscale matrix; S2 performs sliding window scanning and gradient abrupt change detection based on the pixel grayscale value sorting distribution of the two-dimensional floating-point matrix to obtain a grayscale threshold for image segmentation. S3 extracts the physical boundary of the imaging plate based on the grayscale threshold and crops out the effective data area; S4 performs skeletonization on the ion tracks in the effective data region and separates each independent track curve based on connected component analysis. S5 determines the origin position based on the separated track curves and extracts the coordinates of the trajectory points of each ion track. S6 constructs a joint objective function based on the physical correlation of multiple ion components, performs joint trajectory fitting on multiple ion tracks, and solves for the deflection field parameters; S7 calculates the energy spectrum of each ion by inverting the trajectory equation obtained from the fitting.

2. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... Step S2 specifically includes: Flatten the two-dimensional floating-point grayscale matrix into a one-dimensional array and sort it in ascending order of grayscale value; Set a sliding window to scan from the median of the sorted array towards the low and high grayscale areas; Gradient mutation detection is performed, and the relative change rate of the gray-scale mean of the current window and the gray-scale mean of the previous window is calculated. When scanning into a low gray-scale area, if the decrease in the gray-scale mean of the window exceeds a first preset threshold, the gray-scale value of the current window is determined to be the background boundary threshold. When scanning into a high gray-scale area, if the increase in the gray-scale mean of the window exceeds a second preset threshold, the gray-scale value of the current window is determined to be the signal threshold.

3. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... The extraction of the physical boundary of the imaging plate based on the grayscale threshold includes: Based on the background boundary threshold, the top, bottom, left, and right edge regions of the image are scanned respectively, and the coordinates of the first pixel point in each edge region whose gray value is greater than the background boundary threshold are extracted. For the pixel coordinates extracted from each edge region, a random sampling consistency regression algorithm is used to fit a straight line, and the fitted line with the most interior points is taken as the boundary line of the corresponding edge. The effective data region is cut out based on the four boundary lines obtained from the fitting.

4. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... Step S4 specifically includes: The effective data region is binarized according to the signal threshold. The skeletonization algorithm is applied to the binarized image to extract the morphological skeleton, and the wide trace is refined into lines with a single pixel width. Use convolutional kernels to detect branch points in the skeleton and mark the branch points as visited. Starting from any unvisited non-zero point in the skeleton, recursively search connected pixels along the neighborhood direction, and use a depth-first search algorithm to separate each independent continuous curve; The proton track region is identified based on the span of the curve in a preset direction, and candidate short line signals near the origin are filtered based on the length and position of the curve.

5. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... Step S5 includes: Calculate the average gray level of all candidate short line segments, select the line segment with the largest average gray level as the origin signal, calculate the gray level extreme points within the origin signal area as the origin coordinates, if there are multiple extreme points with the same gray level, take their geometric center as the origin coordinates; the ions include gold ions, carbon ions and protons.

6. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... Step S6 includes: For the proton and carbon ion track regions, a line-by-line scanning method is used to detect grayscale peaks and extract the coordinates of trajectory points for each ion track. A rotation transformation matrix is ​​introduced to transform the image coordinate system to a physical coordinate system with the origin as the origin and the rotation angle corrected. Construct a total objective function that includes the residuals of proton tracks and carbon ion tracks, where the quadratic coefficients of the carbon ion track are constrained by the quadratic coefficients of the proton track through the charge-to-mass ratio relationship; By minimizing the overall objective function, the optimal quadratic coefficients and rotation angle are solved, and the effective electric field voltage is derived.

7. The method for automatic identification and energy dispersive spectroscopy analysis of ion tracks using a Thomson spectrometer based on computer vision, as described in claim 1, is characterized in that... Step S7 includes: For each pixel on the track curve, the particle energy of the corresponding ion is calculated based on its longitudinal distance from the origin. The pixel grayscale value is converted into the light-excited luminous intensity value, and the number of ions is calculated based on the response function of the imaging plate to ions of different energies. The energy spectrum is calculated by combining the solid angle and the energy differential term, and an energy spectrum curve in logarithmic coordinates is generated. The background energy spectrum is calculated by selecting a signal-free region next to the track curve, which is used to quantitatively determine the confidence level of the signal and determine the cutoff energy.

8. A computer vision-based automatic ion track identification and energy dispersive spectroscopy analysis system for a Thomson spectrometer, characterized in that, A method for implementing any one of claims 1-7 includes the following modules: The parameter configuration and data input module is used to receive experimental parameters and read digital images from the imaging plate, and to normalize the images to obtain a grayscale matrix. The image adaptive preprocessing and effective region extraction module is used to adaptively determine the gray level threshold based on the pixel gray level statistical distribution of the gray level matrix, and extract the physical boundary of the imaging plate based on the gray level threshold to obtain the effective data region. The skeletonization and origin search module is used to skeletonize the binarized image and automatically identify the origin signal to determine the origin coordinates. The automatic trajectory point extraction module is used to extract the coordinates of trajectory points of each ion track by using a line-by-line scanning combined with a peak detection strategy; The joint constraint fitting module is used to construct the overall objective function that includes the track residuals of protons and carbon ions, and to solve for the optimal quadratic coefficients and rotation angles. The energy spectrum inversion and output module is used to invert and calculate the energy spectrum of each ion based on the fitted trajectory equation and output it.

9. The Thomson spectroscopy ion track automatic identification and energy dispersive spectroscopy analysis system based on computer vision according to claim 8, characterized in that, The image adaptive preprocessing and effective region extraction module includes: The sub-image extraction and rotation unit is used to extract the sub-image of interest from the image and perform image rotation so that the ion track extends along a specific direction; The statistical adaptive threshold unit is used to flatten and sort the grayscale matrix and then detect the jump points of the grayscale mean through a sliding window scan, and automatically calculate the background boundary threshold and the signal threshold. The random sampling consistency boundary fitting unit is used to perform line fitting on the coordinates of pixels with gray levels greater than the background boundary threshold in each edge region using the random sampling consistency regression algorithm, and to cut out the effective data region based on the four boundary lines obtained by fitting.

10. The Thomson spectroscopy ion track automatic identification and energy dispersive spectroscopy analysis system based on computer vision according to claim 8, characterized in that, The energy spectrum inversion and output module includes: The photoexcited emission conversion unit is used to convert pixel grayscale values ​​into photoexcited emission intensity values, and calculate ion flux by combining solid angle and exposure time; The energy scale and inversion unit is used to establish a one-to-one mapping relationship between position coordinates and ion energy based on the fitted trajectory equation, and to calculate the energy differential distribution of different types of ions such as gold, carbon, and protons. The visualization and report generation unit is used to automatically draw fitted curves, grayscale distribution maps, and energy spectrum maps, and export data tables containing background error data.