Threshold segmentation method for X-ray transmission image

CN119444788APending Publication Date: 2025-02-14CHINA EASTERN TECH APPL RES & DEV CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411480528.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The traditional threshold iteration method has the problem of inaccurate segmentation when processing X-ray security images, especially when the image has more than two peaks or the foreground and background variance is large, subtle features may be missed. Or objects with weak characteristics, with large calculations and low processing efficiency.

Method used

A threshold segmentation method for X-ray transmission images is proposed. By setting the initial grayscale segmentation threshold, the foreground, background and uncertain areas are obtained, and the updated threshold is calculated using the pixel grayscale of the uncertain areas, and iteratively segmented until it is The threshold is stable, which improves segmentation accuracy and reduces the calculation amount.

Benefits of technology

This method can more accurately capture the details and features of X-ray security images, improve detection effects, and significantly reduce the calculation amount. It is suitable for processing large images or high-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444788A_ABST
    Figure CN119444788A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of image segmentation, particularly relates to a threshold segmentation method for an X-ray transmission image, and aims to solve the technical problem that the traditional threshold iteration method is poor in X-ray security check image processing effect. The method comprises the steps of performing segmentation of a graying transmission image to be segmented according to a set gray segmentation threshold to obtain an uncertain segmentation threshold pair, segmenting the image into a foreground image, a background image and an uncertain region according to the uncertain segmentation threshold pair, updating the transmission image to be segmented and the gray segmentation threshold, and obtaining a transmission image to be segmented. And iteratively segmenting until the absolute value of the difference between adjacent gray segmentation thresholds is smaller than a set threshold, and obtaining the segmentation result of the transmission image. According to the method, the image is divided into the determined foreground image, the background image and the uncertain area, and the uncertain area is continuously refined and segmented, so that the calculation amount is reduced, the image segmentation precision is improved, and details and features of the X-ray security check image can be better captured.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] The traditional threshold iteration method is an image processing technology based on the grayscale histogram of the image. It usually assumes that the grayscale histogram of the image presents a bimodal distribution, that is, there are two obvious grayscale peaks in the image, representing the foreground and the background respectively.

[0003] However, in security inspection situations involving cargo transportation, postal delivery and other businesses, due to the different absorption of X-ray energy by organic matter, mixtures and inorganic substances in the package, the grayscale histogram of the X-ray security inspection image may show a single peak or multiple peaks. When the grayscale histogram has more than two peaks or there is a large variance in the foreground and background, the traditional threshold iteration method is still used to segment the X-ray security inspection image, which may miss some subtle features or objects with weak features. In addition, the traditional threshold iteration method requires the mean statistics of all pixels in different grayscale segments in each iteration. When processing large images or high-resolution images, the number of iterations is large and the time is long. As the number of iterations increases, the performance of the algorithm may decrease significantly.

[0004] Based on this, the present invention proposes a threshold segmentation method for X-ray transmission images. Summary of the invention

[0005] In order to solve the above-mentioned problem in the prior art, that is, the technical problem that the traditional threshold iteration method has poor processing effect on X-ray security inspection images, the present invention provides a threshold segmentation method for X-ray transmission images, comprising:

[0006] The grayscale segmentation threshold is set to segment the grayscale transmission image to be segmented, and a foreground area and a background area are obtained. An uncertain segmentation threshold pair is calculated according to the pixel grayscales of the foreground area and the background area, respectively, and the uncertain segmentation threshold pair includes a foreground threshold and a background threshold;

[0007] Segmenting the grayscale transmission image to be segmented using the uncertain segmentation threshold to obtain a foreground image, a background image, and an uncertain region;

[0008] Taking the uncertain region as the updated transmission image to be segmented, and calculating the updated grayscale segmentation threshold according to the uncertain segmentation threshold pair;

[0009] The image segmentation is performed iteratively until the absolute value of the difference between the grayscale segmentation threshold of the last iteration and the grayscale segmentation threshold of the previous iteration is less than the set threshold, thereby obtaining the segmentation result of the transmission image to be segmented.

[0010] Preferably, the segmentation of the grayscale transmission image to be segmented by setting a grayscale segmentation threshold comprises:

[0011] The grayscale segmentation threshold is used to perform pixel division of the grayscale transmission image to be segmented, and pixels greater than the set grayscale segmentation threshold are used as foreground areas, and the remaining pixels are used as background areas.

[0012] Preferably, segmenting the grayscale transmission image to be segmented using the uncertain segmentation threshold comprises:

[0013] The pixels of the grayscale image are divided using the uncertain segmentation threshold pair, pixels greater than the foreground threshold in the uncertain segmentation threshold pair are used as foreground images, pixels less than the background threshold in the uncertain segmentation threshold pair are used as background images, and the remaining pixels are used as uncertain areas.

[0014] Preferably, the calculating of the uncertain segmentation threshold pair according to the pixel grayscales of the foreground area and the background area comprises:

[0015] The average grayscale values ​​of the foreground area and the background area are calculated according to the pixel grayscales of the foreground area and the background area respectively, and are used as an uncertain segmentation threshold pair.

[0016] Preferably, calculating the updated grayscale segmentation threshold according to the uncertain segmentation threshold pair includes:

[0017]

[0018] Among them, T (1) Represents the grayscale segmentation threshold after the first iteration update, is the foreground threshold in the uncertain segmentation threshold pair of the first iteration, is the background threshold in the uncertain segmentation threshold pair of the first iteration.

[0019] Preferably, the segmentation result of the transmission image to be segmented is:

[0020] All foreground images and the foreground area of ​​the last iteration are taken as the final foreground image, and all background images and the background area of ​​the last iteration are taken as the final background image to obtain the segmentation result of the transmission image to be segmented.

[0021] Preferably, the calculating the average grayscale value of the foreground area and the background area includes:

[0022] The foreground area and the background area are respectively used as the images of the area to be calculated, and the grayscale histogram of the images of the area to be calculated is calculated to obtain the pixel frequency H(i) at each grayscale level i of the images of the area to be calculated;

[0023] Based on the pixel frequency H(i) at each gray level i, calculate the cumulative frequency C(i) of the image in the area to be calculated and the weighted sum W(i) of the pixel values ​​accumulated in the image in the area to be calculated up to the gray level i;

[0024] Based on the cumulative frequency C(i) and the weighted sum of pixel values ​​W(i), the grayscale level i of the image in the area to be calculated is calculated. 1 to i 2 The average gray value m(i 1 ,i 2 ), where i 1 ≤i 2 .

[0025] Preferably, the cumulative frequency C(i) of the image in the area to be calculated is:

[0026]

[0027] Among them, i represents the gray level to be accumulated, j represents the gray level variable, and H(j) represents the number of pixels with gray level j.

[0028] Preferably, the weighted sum W(i) of the pixel values ​​accumulated in the image of the area to be calculated to gray level i is:

[0029]

[0030] Among them, i represents the gray level to be accumulated, j represents the gray level variable, i ≥ j, and H(j) represents the number of pixels with gray level j.

[0031] Preferably, the gray level i of the regional image 1 to i 2 The average gray value m(i 1 ,i 2 )for:

[0032]

[0033] Among them, W(i 1 -1) represents the accumulation to gray level i 1 -1 pixel value weighted sum, C(i 1 -1) represents the accumulation to gray level i 1 -1 pixels, W(i 2 ) represents the accumulation to gray level i 2 The weighted sum of pixel values, C(i 2 ) represents the accumulation to gray level i 2 The number of pixels.

[0034] Beneficial effects of the present invention:

[0035] (1) For application scenarios where the histogram of an image has more than two peaks or the foreground and background have a large variance, the method of the present invention segments the image into a definite foreground, a definite background, and an uncertain region based on the initial foreground and background thresholds. By continuously refining the segmentation of the uncertain region in an iterative process, the image segmentation accuracy is improved, and the details and features of the X-ray security inspection image can be better captured, and the detection effect of the X-ray security inspection image is more accurate.

[0036] (2) The method of the present invention keeps the determined foreground and background unchanged during the iterative segmentation, and only needs to perform statistical calculations on the pixels in the uncertain area. Compared with the traditional threshold iteration method, the amount of calculation is significantly reduced, and the effect is better when processing large images or high-resolution images.

[0037] (3) The method of the present invention does not need to count the mean values ​​of all pixels in different grayscale segments multiple times. It only needs to calculate the histogram once and accumulate the frequency and grayscale weighted sum in the statistical histogram. The mean value of all pixels between different grayscale levels can be quickly obtained during the iteration process. Because the histogram and the cumulative frequency and grayscale weighted sum of the histogram only need to be required once, the algorithm can quickly process high-resolution images, and the performance will not be affected by the number of iterations. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0039] Figure 1 It is a schematic diagram of the process of the present invention;

[0040] Figure 2 Schematic diagram of the flow of the traditional threshold iteration method. DETAILED DESCRIPTION

[0041] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0042] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0043] See also Figure 1 , is a flow chart of the method of the present invention, the present invention provides a threshold segmentation method for X-ray transmission images, the image segmentation method comprising:

[0044] The grayscale segmentation threshold is set to segment the grayscale transmission image to be segmented, and a foreground area and a background area are obtained. An uncertain segmentation threshold pair is calculated according to the pixel grayscales of the foreground area and the background area, respectively, and the uncertain segmentation threshold pair includes a foreground threshold and a background threshold;

[0045] Segmenting the grayscale transmission image to be segmented using the uncertain segmentation threshold to obtain a foreground image, a background image, and an uncertain region, wherein the foreground image and the background image are determined foreground regions and background regions;

[0046] Taking the uncertain region as the updated transmission image to be segmented, and calculating the updated grayscale segmentation threshold according to the uncertain segmentation threshold pair;

[0047] The image segmentation is performed iteratively until the absolute value of the difference between the grayscale segmentation threshold of the last iteration and the grayscale segmentation threshold of the previous iteration is less than the set threshold, thereby obtaining the segmentation result of the transmission image to be segmented.

[0048] The present invention is based on the improvement of the classic iterative method for finding the threshold. After the image is divided into two parts according to the threshold in each iteration process to obtain the mean, the area with a pixel value greater than the larger mean is used as the determined foreground, the area with a pixel value less than the smaller mean is used as the determined background, and the area between the two means is used as the uncertain area. In the next iteration, the foreground and background areas determined in the previous iteration are kept unchanged, and the iterative method is reused for the uncertain area until the difference between the thresholds of the previous and next iterations is less than a predetermined value. In the last iteration, the uncertain area is divided into two areas instead of three areas. The final foreground is the union of all determined foreground areas, and the background is the union of all determined background areas in the iteration process.

[0049] See also Figure 2 , is a flowchart of the traditional threshold iteration method, which includes:

[0050] (1) Initialization threshold: Select a suitable threshold T as the initial threshold, which can usually be the mean grayscale value of the image, that is, the average grayscale value of the image.

[0051] (2) Image segmentation: The image is divided into foreground and background according to the current threshold T. Pixels with grayscale values ​​greater than or equal to T are grouped as I 1 , pixels smaller than T are used as another group I 2 .

[0052] (3) Calculate the grayscale mean: Calculate the grayscale mean of the segmented foreground and background respectively, that is, 1 and I 2 The average gray value of the pixels in is calculated to obtain m 1 and m 2 , T=(m1 +m 2 ) / 2.

[0053] (4) Update the threshold: Take the average of the grayscale means of the foreground and background as the new threshold, that is, m 1 and m 2 The new threshold T is obtained by averaging.

[0054] (5) Determine threshold stability: compare the difference between the new and old thresholds T. If the difference is less than the preset threshold △T, the threshold T is considered to be stable; otherwise, return to step (2) and continue iterating.

[0055] (6) Output segmentation results: When the threshold is stable, output the final segmentation results.

[0056] This process updates the threshold value through continuous iteration until a suitable threshold value is found so that the foreground and background of the image can be effectively separated. This method has a wide range of applications in the field of image segmentation, especially in scenarios where large amounts of image data need to be processed automatically.

[0057] The grayscale threshold can be automatically and efficiently obtained based on the iterative algorithm. For most images with obvious differences between the foreground and background (the histogram shows a bimodal characteristic), the results of the iterative algorithm are convergent, that is, the ideal threshold can be obtained within a limited number of iterations. However, the X-ray image of the security inspection machine takes into account the organic matter, mixtures, and inorganic matter in the foreground. Due to the different absorption of radiation energy, it may show multi-peak characteristics, and the imaging of some thin organic matter will also show weak features. When the histogram has more than two peaks or there is a large variance in the foreground and background, the results of the traditional iterative method are not ideal and may miss some subtle structures or objects with weak features. In addition, the iterative method needs to count the mean of all pixels in different grayscale segments multiple times. For large images or high-resolution images with a large number of iterations, the performance will degrade. The present invention optimizes these two points.

[0058] In order to more clearly illustrate a threshold segmentation method for an X-ray transmission image of the present invention, each module in an embodiment of the present invention is described in detail below with reference to the accompanying drawings.

[0059] A threshold segmentation method for an X-ray transmission image according to a first embodiment of the present invention comprises the following steps:

[0060] Step S100 , segmenting the grayscale transmission image to be segmented by setting the grayscale segmentation threshold, obtaining the foreground area and the background area, and calculating the uncertain segmentation threshold pair according to the pixel grayscale of the foreground area and the background area respectively.

[0061] Step S110, setting the grayscale segmentation threshold to T (0) , use T (0)To segment the image I, the grayscale segmentation threshold T (0) Part of it is recorded as foreground area The rest is recorded as background area Image I is a grayscale image corresponding to the projection image to be segmented.

[0062] Step S120, respectively calculating the segmented foreground area and background area The average gray value and As an uncertain segmentation threshold pair:

[0063] Step S200 , segmenting the grayscale transmission image to be segmented using an uncertain segmentation threshold to obtain a foreground image, a background image, and an uncertain region.

[0064] The image I with the content greater than the foreground threshold As the foreground image F (1) , the image I is smaller than the background threshold As background image B (1) , and the rest is the uncertain area As shown in formula (1):

[0065]

[0066] Step S300, with the uncertain area As the updated transmission image to be segmented, an updated grayscale segmentation threshold is calculated according to the uncertain segmentation threshold pair.

[0067] The updated grayscale segmentation threshold is calculated based on the uncertain segmentation threshold pair, as shown in formula (2):

[0068]

[0069] Among them, T (1) Represents the grayscale segmentation threshold after the first iteration update, is the foreground threshold in the uncertain segmentation threshold pair of the first iteration, is the background threshold in the uncertain segmentation threshold pair of the first iteration.

[0070] Step S400, iteratively perform image segmentation until the absolute value of the difference between the grayscale segmentation threshold of the last iteration and the grayscale segmentation threshold of the previous iteration is less than a set threshold.

[0071] Update the image segmentation threshold to T (1) , the transmission image to be segmented is Then, jump to step S100 and use T (1) right The pixels are divided into and The corresponding grayscale average value is and Will Medium to large As the foreground image F (2) , less than As background image B (2) , and the rest is taken as the uncertainty area of ​​the second iteration As shown in formula (3):

[0072]

[0073] Similarly, the uncertainty region of the n-1th iteration is and the foreground image F of the nth iteration (n) , background image B (n) , Uncertain Area The relationship is shown in formula (4):

[0074]

[0075] The condition for iterative termination is shown in formula (5):

[0076] |T (n+1) -T (n) |<ε (5)

[0077] Among them, ε is the pre-set iteration cutoff threshold, and finally Segmented into foreground image F (n+1) and background image B (n+1) , as shown in formula (6):

[0078]

[0079] Step S500, taking all foreground images and the foreground area of ​​the last iteration as the final foreground image, taking all background images and the background area of ​​the last iteration as the final background image, and obtaining the segmentation result of the transmission image to be segmented.

[0080] The present invention is based on iteration of the determined area (foreground image and background image in each round of iteration) / uncertain area (uncertain area in each round of iteration), and can obtain a more accurate threshold than the traditional iterative method. At the same time, since the part of calculating the mean in the iterative process excludes almost half of the pixels, the amount of calculation is greatly reduced.

[0081] In the first embodiment of the present invention, it is necessary to calculate the mean grayscale values ​​of all pixels between two different grayscale levels for multiple times. The second embodiment of the present invention provides a method for quickly calculating the average grayscale value of an image, including:

[0082] Step B100, calculating the grayscale histogram of the image in the area to be calculated, and obtaining the pixel frequency H(i) at each grayscale level i of the image in the area to be calculated.

[0083] Step B200, based on the pixel frequency H(i) at each gray level i, calculate the cumulative frequency C(i) of the image in the area to be calculated and the weighted sum W(i) of the pixel values ​​accumulated in the image in the area to be calculated up to gray level i.

[0084] The cumulative frequency C(i) of the image in the area to be calculated is shown in formula (7):

[0085]

[0086] Among them, i represents the gray level to be accumulated, j represents the gray level variable, and H(j) represents the number of pixels with gray level j.

[0087] The weighted sum W(i) of the pixel values ​​accumulated in the image of the area to be calculated up to gray level i is shown in formula (8):

[0088]

[0089] Among them, i represents the gray level to be accumulated, j represents the gray level variable, and H(j) represents the number of pixels with gray level j.

[0090] Step B300, based on the cumulative frequency C(i) and the weighted sum of pixel values ​​W(i), calculate the gray level i of the image in the area to be calculated 1 to i 2 The average gray value m(i 1 ,i 2 ),i 1 ≤i 2 , as shown in formula (9):

[0091]

[0092] Among them, W(i 1 -1) represents the accumulation to gray level i 1 -1 pixel value weighted sum, C(i 1 -1) represents the accumulation to gray level i 1 -1 pixels, W(i 2 ) represents the accumulation to gray level i 2 The weighted sum of pixel values, C(i 2 ) represents the accumulation to gray level i 2 The number of pixels.

[0093] The present invention improves the traditional iterative method by continuously refining the segmentation during the iteration process, thereby improving the accuracy of segmentation. Especially when processing images with complex structures or faint features, by dividing the images into more categories and gradually determining the final foreground and background during iteration, the method can better capture the details and features of the security inspection X-ray images, providing a more reliable basis for subsequent prohibited and restricted goods detection and package extraction.

[0094] Although the various steps in the above embodiment are described in the above-mentioned order, those skilled in the art can understand that in order to achieve the effect of this embodiment, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in a reverse order. These simple changes are within the scope of protection of the present invention.

[0095] A threshold segmentation system for X-ray transmission images according to a third embodiment of the present invention includes a grayscale module, a grayscale segmentation module, an uncertain segmentation module, an update iteration module, and an output module;

[0096] A grayscale module configured to perform grayscale processing on the segmented transmission image;

[0097] A grayscale segmentation module is configured to segment the grayscale transmission image to be segmented by setting a grayscale segmentation threshold value, obtain a foreground area and a background area, and calculate an uncertain segmentation threshold pair according to the pixel grayscales of the foreground area and the background area, respectively, wherein the uncertain segmentation threshold pair includes a foreground threshold value and a background threshold value;

[0098] An uncertain segmentation module is configured to segment the grayscale transmission image to be segmented using an uncertain segmentation threshold to obtain a foreground image, a background image, and an uncertain region, wherein the foreground image and the background image are determined foreground regions and background regions;

[0099] An update iteration module is configured to use the uncertain region as an updated transmission image to be segmented, calculate an updated grayscale segmentation threshold according to the uncertain segmentation threshold, and iteratively perform image segmentation;

[0100] The output module is configured to output the segmentation result of the transmission image to be segmented when the absolute value of the difference between the iterative grayscale segmentation threshold and the grayscale segmentation threshold of the previous iteration is less than the set threshold.

[0101] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0102] It should be noted that the above embodiment provides a method and system for threshold segmentation of X-ray transmission images, and only uses the division of the above functional modules as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be decomposed or combined. For example, the modules in the above embodiments can be combined into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not regarded as improper limitations of the present invention.

[0103] An electronic device according to a fourth embodiment of the present invention includes:

[0104] at least one processor;

[0105] and a memory communicatively coupled to at least one of the processors;

[0106] The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned threshold segmentation method for X-ray transmission images.

[0107] A fifth embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned threshold segmentation method for an X-ray transmission image.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the storage device and processing device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0109] Those skilled in the art should be able to appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two, and the programs corresponding to the software modules and method steps can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0110] The terms "first", "second", etc. are used to distinguish similar objects rather than to describe or indicate a particular order or sequence.

[0111] The term "comprise" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus / device.

[0112] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A threshold segmentation method for X-ray transmission images, characterized in that: The image segmentation method comprises: The grayscale segmentation threshold is set to segment the grayscale transmission image to be segmented, and a foreground area and a background area are obtained. An uncertain segmentation threshold pair is calculated according to the pixel grayscales of the foreground area and the background area, respectively, and the uncertain segmentation threshold pair includes a foreground threshold and a background threshold; Segmenting the grayscale transmission image to be segmented using the uncertain segmentation threshold to obtain a foreground image, a background image, and an uncertain region; Taking the uncertain region as the updated transmission image to be segmented, and calculating the updated grayscale segmentation threshold according to the uncertain segmentation threshold pair; The image segmentation is performed iteratively until the absolute value of the difference between the grayscale segmentation threshold of the last iteration and the grayscale segmentation threshold of the previous iteration is less than the set threshold, thereby obtaining the segmentation result of the transmission image to be segmented.

2. The threshold segmentation method of an X-ray transmission image according to claim 1, characterized in that: The segmentation of the grayscale transmission image to be segmented by setting the grayscale segmentation threshold comprises: The grayscale segmentation threshold is used to perform pixel division of the grayscale transmission image to be segmented, and pixels greater than the set grayscale segmentation threshold are used as foreground areas, and the remaining pixels are used as background areas.

3. The threshold segmentation method of an X-ray transmission image according to claim 2, characterized in that: The segmenting of the grayscale transmission image to be segmented using the uncertain segmentation threshold comprises: The pixels of the grayscale image are divided using the uncertain segmentation threshold pair, pixels greater than the foreground threshold in the uncertain segmentation threshold pair are used as foreground images, pixels less than the background threshold in the uncertain segmentation threshold pair are used as background images, and the remaining pixels are used as uncertain areas.

4. A threshold segmentation method for X-ray transmission images according to any one of claims 1 to 3, characterized in that: The calculating of the uncertain segmentation threshold pair according to the pixel grayscales of the foreground area and the background area comprises: The average grayscale values ​​of the foreground area and the background area are calculated according to the pixel grayscales of the foreground area and the background area respectively, and are used as an uncertain segmentation threshold pair.

5. The threshold segmentation method of X-ray transmission image according to any one of claims 1 to 3, characterized in that: The step of calculating an updated grayscale segmentation threshold according to the uncertain segmentation threshold pair includes: Among them, T (1) Represents the grayscale segmentation threshold after the first iteration update, is the foreground threshold in the uncertain segmentation threshold pair of the first iteration, is the background threshold in the uncertain segmentation threshold pair of the first iteration.

6. The method for threshold segmentation of an X-ray transmission image according to any one of claims 1 to 3, characterized in that: The segmentation result of the transmission image to be segmented is: All foreground images and the foreground area of ​​the last iteration are taken as the final foreground image, and all background images and the background area of ​​the last iteration are taken as the final background image to obtain the segmentation result of the transmission image to be segmented.

7. The threshold segmentation method of X-ray transmission image according to claim 4, characterized in that: The step of calculating the average grayscale value of the foreground area and the background area includes: The foreground area and the background area are respectively used as the images of the area to be calculated, and the grayscale histogram of the image of the area to be calculated is calculated to obtain the pixel frequency H(i) at each grayscale level i of the image of the area to be calculated; Based on the pixel frequency H(i) at each gray level i, calculate the cumulative frequency C(i) of the image in the area to be calculated and the weighted sum W(i) of the pixel values ​​accumulated in the image in the area to be calculated up to the gray level i; Based on the cumulative frequency C(i) and the weighted sum of pixel values ​​W(i), the average grayscale value m(i1, i2) of all pixels between grayscale levels i1 and i2 of the image in the area to be calculated is calculated, where i1≤i2.

8. The threshold segmentation method of X-ray transmission image according to claim 7, characterized in that: The cumulative frequency C(i) of the image in the area to be calculated is: Among them, i represents the gray level to be accumulated, j represents the gray level variable, and H(j) represents the number of pixels with gray level j.

9. The method for threshold segmentation of an X-ray transmission image according to claim 8, characterized in that: The weighted sum W(i) of the pixel values ​​accumulated to gray level i in the image of the area to be calculated is: Among them, i represents the gray level to be accumulated, j represents the gray level variable, and H(j) represents the number of pixels with gray level j.

10. The method for threshold segmentation of an X-ray transmission image according to claim 9, characterized in that: The average gray value m(i1, i2) of all pixels between gray levels i1 and i2 of the regional image is: Among them, W(i1-1) represents the weighted sum of pixel values ​​accumulated to gray level i1-1, C(i1-1) represents the number of pixels accumulated to gray level i1-1, W(i2) represents the weighted sum of pixel values ​​accumulated to gray level i2, and C(i2) represents the number of pixels accumulated to gray level i2.