Ceramic package device x-ray image preprocessing method and system

By employing an adaptive dual-threshold segmentation method and an adaptive segmentation enhancement method, the problems of low contrast and noise interference in X-ray images of ceramic packaging devices were solved, achieving accurate segmentation of the ceramic packaging device region and improving image quality, thus laying a high-quality foundation for subsequent defect detection.

CN121616570BActive Publication Date: 2026-06-26NO 24 RES INST OF CETC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

X-ray images of ceramic packaged devices suffer from low contrast, high noise interference, and blurred details. Traditional preprocessing methods have limited effectiveness and are difficult to effectively identify minute defects.

Method used

An adaptive dual-threshold segmentation method is adopted, combining the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. Through connected component labeling and clustering screening, and combined with material properties, adaptive segmentation enhancement is performed to achieve accurate segmentation and image enhancement of the ceramic packaged device region.

Benefits of technology

It achieves precise segmentation of the ceramic packaged device area and improves image quality, significantly enhancing the accuracy of defect detection. It is adaptable to different models and imaging conditions and requires no manual adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616570B_ABST
    Figure CN121616570B_ABST
Patent Text Reader

Abstract

The application discloses a kind of ceramic packaging device X-ray image preprocessing method and system, the method comprises the following steps: obtaining the X-ray image of ceramic packaging device;Adopt adaptive double threshold segmentation method to the X-ray image is segmented, preliminary ceramic packaging device area image is obtained, and it is recorded as first image;Carry out connected domain marking and screen out effective ceramic packaging device area image by clustering to the area of each connected domain, and it is recorded as second image;According to the characteristics of ceramic packaging device in X-ray imaging, the second image is enhanced, and image preprocessing is completed.The image preprocessing method of the application can significantly improve the image quality, lay a high-quality image foundation for subsequent defect detection, and has important industrial application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-destructive testing technology for semiconductor packaging, and in particular to a method and system for preprocessing X-ray images of ceramic packaged devices. Background Technology

[0002] In X-ray defect detection of ceramic packaged devices, the original images often suffer from the following technical problems: ① Poor image quality: X-ray images generally suffer from low contrast, high noise interference, and blurred details; ② Weak defect features: Small defects inside the ceramic package are not obvious in X-ray images and are easily submerged by background noise; ③ Limited effectiveness of traditional preprocessing methods: Existing image enhancement algorithms are mostly general methods and do not take into account the special characteristics of X-ray images of ceramic packaged devices.

[0003] Existing X-ray image preprocessing methods mainly include traditional image processing techniques such as histogram equalization and Gaussian filtering. However, these methods have problems such as unsatisfactory enhancement effect and severe loss of detail when processing X-ray images of ceramic packaging devices, which directly affects the accuracy of subsequent defect identification. Summary of the Invention

[0004] To address the shortcomings of the prior art, the technical problem to be solved by the present invention is to provide a method and system for X-ray image preprocessing of ceramic packaging devices specifically for identifying defects in X-ray radiography of ceramic packaging devices.

[0005] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is to provide a method for preprocessing X-ray images of ceramic packaging devices, comprising the following steps:

[0006] Obtain X-ray images of ceramic packaged devices;

[0007] The X-ray image is segmented using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, which is denoted as the first image;

[0008] The image of the effective ceramic packaging device region is selected by clustering the areas of each connected component and labeled with connected components. This image is denoted as the second image.

[0009] Based on the characteristics of ceramic-encapsulated devices in X-ray imaging, image enhancement is performed on the second image to complete image preprocessing.

[0010] Furthermore, the adaptive dual-threshold segmentation method is an image segmentation method that combines the OTSU threshold segmentation method and the maximum entropy threshold segmentation method;

[0011] The step of segmenting the X-ray image using the adaptive dual-threshold segmentation method includes the following sub-steps:

[0012] The X-ray image is divided into several non-overlapping sub-regions;

[0013] The adaptive threshold for each sub-region is calculated based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method.

[0014] The corresponding sub-regions are segmented based on the adaptive threshold, and then the sub-regions are segmented according to their original spatial positions. The resulting images are then stitched together to obtain the first image.

[0015] Furthermore, for each sub-region, the method for calculating its adaptive threshold based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method includes:

[0016] The local thresholds of a sub-region are calculated using the OTSU threshold segmentation method and the maximum entropy threshold segmentation method, respectively, to obtain the first local threshold and the second local threshold.

[0017] Weights are assigned to the sub-regions based on the segmentation effect of the first and second local thresholds.

[0018] The first local threshold and the second local threshold are weighted and averaged based on the assigned weights to obtain the adaptive threshold.

[0019] Furthermore, the step of labeling connected components and filtering out effective ceramic packaging device regions by clustering the areas of each connected component includes the following sub-steps:

[0020] The first image is filled with holes, and connected components in the image are identified to obtain a set of connected components;

[0021] Perform connected component labeling and assign a unique number to each connected component;

[0022] Calculate the area of ​​each connected component, cluster the area data of each connected component, and select the effective image of the ceramic packaging device region based on the clustering results.

[0023] Furthermore, the step of clustering the area data of each connected component and selecting the effective image regions of ceramic packaging devices based on the clustering results includes the following sub-steps:

[0024] The target clustering categories are determined to be two types: device connected components and noise connected components.

[0025] Initialize cluster centers by randomly selecting two connected component area data as the initial cluster centers for the two classes;

[0026] Assign connected component areas, iterate through all other connected component area data, calculate the Euclidean distance between each connected component area data and the two initial cluster centers, and select the connected component area data with the smallest Euclidean distance to each cluster center to be assigned to the category of the corresponding cluster center;

[0027] Update the cluster centers by taking the arithmetic mean of the areas of all connected components in both categories as the new cluster centers;

[0028] Repeat the steps of allocating the area of ​​connected components and updating the cluster centers until the deviation between the currently calculated cluster centers and the previously calculated cluster centers is less than a preset threshold or the preset number of iterations is reached.

[0029] Furthermore, the step of enhancing the second image based on the characteristics of the ceramic packaged device in X-ray imaging specifically includes:

[0030] Preset the grayscale boundary threshold between the ceramic and metal areas;

[0031] Based on the grayscale boundary threshold, a piecewise enhancement function is constructed, which includes a first enhancement function for the ceramic region and a second enhancement function for the metal region.

[0032] Adaptive image enhancement is performed on the second image based on the piecewise enhancement function.

[0033] Furthermore, the formula for calculating the adaptive threshold is as follows:

[0034] (one)

[0035] In formula (1), Indicates the first Adaptive threshold for each sub-region Indicates the first The first local threshold of each sub-region Indicates the first The second local threshold for each sub-region Indicates the first The weights of the first local thresholds for each sub-region Indicates the first The weights of the second local threshold for each sub-region and The sum of is 1.

[0036] Furthermore, the formula for calculating the weight of the first local threshold is as follows:

[0037] (two)

[0038] In formula (ii), Indicates the first local threshold Segmentation Inter-class variance of the segmentation results of each sub-region Indicates the second local threshold Segmentation The inter-class variance of the segmentation results of each sub-region.

[0039] Furthermore, the first enhancement function is:

[0040] (three)

[0041] In formula (iii), This represents the grayscale value of the pixel to be enhanced. Represents the normalization coefficient. Indicates the grayscale threshold. This indicates an adaptive parameter that is positively correlated with the contrast within the ceramic region;

[0042] The second enhancement function is:

[0043] (Four)

[0044] In formula (iv), This represents the maximum grayscale value that the image can achieve. This indicates the intensity of the enhancement in the metallic region, which is positively correlated with the kurtosis of the grayscale value in the metallic region.

[0045] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is: to provide an X-ray image preprocessing system for ceramic packaging devices, comprising:

[0046] The image acquisition module is used to acquire X-ray images of ceramic packaged devices;

[0047] The image segmentation module is used to segment the X-ray image using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, denoted as the first image;

[0048] The image filtering module is used to label connected components and filter out images of valid ceramic packaging device regions by clustering the areas of each connected component, denoted as the second image;

[0049] The image enhancement module is used to enhance the second image based on the characteristics of the ceramic packaged device in X-ray imaging, thereby completing image preprocessing.

[0050] The X-ray image preprocessing method and system for ceramic packaging devices of the present invention have at least the following beneficial effects: The present invention effectively overcomes the shortcomings of traditional single-threshold methods in adapting to complex grayscale distributions by integrating the OTSU threshold segmentation method and the maximum entropy threshold segmentation method, achieving accurate and complete segmentation of the ceramic packaging device region; through connected region area clustering screening, it can effectively distinguish between the real device region and noise interference; it innovatively proposes an adaptive segmented enhancement method based on material properties, matching the optimal enhancement function to the differences in imaging characteristics between the ceramic region and the metal region in X-ray images, enabling simultaneous highlighting of low-contrast defects such as microcracks and pores inside the ceramic and edge details of the metal structure in a single processing, solving the problem of general enhancement methods neglecting certain aspects; key parameters (such as segmentation weights and enhancement function parameters) in the entire preprocessing process are automatically calculated based on local image features without manual intervention, intelligently adapting to different models and imaging conditions of ceramic packaging devices, exhibiting strong adaptability; it significantly improves image quality, laying a high-quality image foundation for subsequent defect detection, and has significant industrial application value. Attached Figure Description

[0051] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0052] Figure 1 This is a flowchart of one embodiment of the X-ray image preprocessing method for ceramic packaging devices of the present invention.

[0053] Figure 2 for Figure 1 Flowchart of step S200.

[0054] Figure 3 for Figure 2 Flowchart of step S220.

[0055] Figure 4 for Figure 1 Flowchart of step S300.

[0056] Figure 5 for Figure 1 Flowchart of step S400.

[0057] Figure 6 This is a system block diagram of one embodiment of the X-ray image preprocessing system for ceramic packaging devices of the present invention. Detailed Implementation

[0058] The invention will now be further described with reference to the accompanying drawings.

[0059] Please see Figure 1 The flowchart below shows an embodiment of the X-ray image preprocessing method for ceramic packaging devices according to the present invention, which includes the following steps:

[0060] S100. Image Acquisition. Acquire X-ray images of the ceramic packaged device. Specifically, a high-resolution X-ray imaging device is used to acquire X-ray images of the ceramic packaged device. The image resolution is set according to the detection accuracy requirements.

[0061] S200. Image Segmentation. The X-ray image is segmented using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, denoted as the first image. Specifically, the adaptive dual-threshold segmentation method is an image segmentation method that combines the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. It should be understood that the OTSU threshold segmentation method and the maximum entropy threshold segmentation method are only choices for this embodiment; other segmentation methods can also be used. Please refer to... Figure 2 This step S200 includes the following sub-steps:

[0062] S210. Divide the X-ray image into several non-overlapping sub-regions.

[0063] When X-ray imaging systems capture images of ceramic packaged devices, slight differences in brightness may exist in different areas of the image. However, within each small sub-region, the illumination can be considered relatively uniform. Therefore, this approach divides the image into several sub-regions and then performs segmentation processing on each sub-region separately, ensuring high-quality segmentation results in each locality.

[0064] S220. Calculate the adaptive threshold for each sub-region based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. For details, please refer to [link / reference]. Figure 3 This step S220 includes the following sub-steps:

[0065] S221. Calculate the first local threshold and the second local threshold. The OTSU thresholding method and the maximum entropy thresholding method are used to calculate the local threshold of a sub-region, respectively, to obtain the first local threshold and the second local threshold. The specific algorithms for calculating the first local threshold based on the OTSU thresholding method and the second local threshold based on the maximum entropy thresholding method are mature existing technologies and will not be elaborated here.

[0066] S222. Assign weights. Weights are assigned based on the segmentation performance of the first local threshold and the second local threshold in the sub-region. Specifically, the corresponding sub-regions are binarized using the first local threshold and the second local threshold respectively, resulting in two segmentation results. The inter-class variance of each segmentation result is calculated, and this inter-class variance is used as an indicator to evaluate the segmentation performance for weight allocation. Specifically, the formula for calculating the weight of the first local threshold is as follows:

[0067]

[0068] in, Indicates the first local threshold Segmentation Inter-class variance of the segmentation results of each sub-region Indicates the second local threshold Segmentation The inter-class variance of the segmentation results of each sub-region.

[0069] The formula for calculating the weight of the second local threshold is as follows:

[0070]

[0071] It can be seen that the weight of the first local threshold Weights with the second local threshold The sum is 1.

[0072] S223. Calculate the adaptive threshold. The first local threshold and the second local threshold are weighted and averaged based on the assigned weights to obtain the adaptive threshold. Specifically, the formula for calculating the adaptive threshold is as follows:

[0073]

[0074] in, Indicates the first Adaptive threshold for each sub-region Indicates the first The first local threshold of each sub-region Indicates the first The second local threshold for each sub-region Indicates the first The weights of the first local thresholds for each sub-region Indicates the first The weights of the second local threshold for each sub-region and The sum of is 1.

[0075] S230. Image segmentation and stitching. Based on the adaptive threshold, the corresponding sub-regions are segmented, and then the sub-regions are segmented according to their original spatial positions. The resulting images are then stitched together to obtain the first image.

[0076] The following section uses a sub-region R^(i) of a ceramic packaged device image as an example to illustrate the process of segmenting the X-ray image using the adaptive dual-threshold segmentation method:

[0077] First, the first local threshold of the sub-region is calculated using the OTSU threshold segmentation method. The second local threshold of this sub-region was calculated using the maximum entropy threshold segmentation method. Next, the sub-region is segmented using a first local threshold, and the inter-class variance of the first local threshold is calculated. The sub-region is segmented using a second local threshold, and the inter-class variance of the second local threshold is calculated. Then, the weight of the first local threshold is calculated as follows: The weight of the second local threshold is Calculations show that the OTSU thresholding method achieves better segmentation results within this sub-region, therefore it is given a higher weight, and the final calculated adaptive threshold is... The sub-region is binarized using the adaptive threshold to obtain the segmented image of the sub-region. Similarly, after traversing all sub-regions and integrating them, a complete and accurate segmented image, namely the first image, is obtained.

[0078] S300. Image Filtering. Connected component labeling is performed, and images of valid ceramic packaged device regions are filtered out by clustering the areas of each connected component. This second image is denoted as the second image. For details, please refer to [link to relevant documentation]. Figure 4 This step S300 includes the following sub-steps:

[0079] S310. Perform hole filling. Specifically, perform hole filling on the first image and identify connected components in the image to obtain a set of connected components. To correct erroneous holes generated inside the foreground target due to image noise, uneven grayscale, and / or limitations of threshold segmentation, restore the true physical continuity of the device structure, and reduce the false alarm rate of subsequent defect detection, it is necessary to perform hole filling on the first image. In this embodiment, a flood filling method is used for hole filling. This is a mature existing technology and will not be described in detail here. A connected component is an independent region composed of interconnected white pixels; one connected component is an independent white spot.

[0080] S320. Mark connected components and assign a unique number to each connected component.

[0081] S330. Clustering and Filtering Connected Component Areas. Calculate the area of ​​each connected component and cluster the area data. Based on the clustering results, filter out images of valid ceramic packaging device regions. Specifically, calculate the total number of pixels contained in each connected component, which is the area of ​​that connected component.

[0082] The specific method of step S330 is as follows: The target clustering categories are determined to be two categories: device connected domains and noise connected domains. Cluster centers are initialized by randomly selecting two connected domain area data points as the initial cluster centers for each category. Connected domain areas are allocated by iterating through all other connected domain area data points, calculating the Euclidean distance between each connected domain area data point and the two initial cluster centers, and selecting the connected domain area data point with the smallest Euclidean distance to be assigned to the corresponding cluster center category. Cluster centers are updated by taking the arithmetic mean of all connected domain area data points in both categories as the new cluster centers. The steps of allocating connected domain areas and updating cluster centers are repeated until the deviation between the currently calculated cluster center and the previously calculated cluster center is less than a preset threshold or the preset number of iterations is reached. In this embodiment, clustering is completed when the currently calculated cluster center is the same as the previously calculated cluster center.

[0083] After clustering, two sets of results are obtained: the larger cluster represents the device connected regions, and the smaller cluster represents the noise connected regions. The average area of ​​all connected regions within the device connected regions is taken as the selection criterion. Connected regions with areas greater than the criterion are considered connected regions of the ceramic packaged devices, thus obtaining an image of the effective ceramic packaged device region, i.e., the second image.

[0084] S400. Image Enhancement. Based on the characteristics of ceramic packaged devices in X-ray imaging, image enhancement is performed on the second image to complete image preprocessing. Addressing the problem of large differences in absorption rates between the ceramic substrate and metal components in X-ray images of ceramic packaged devices, and the difficulty of simultaneously optimizing details of both using a single enhancement function, this solution proposes an adaptive piecewise enhancement method based on material priors. For details, please refer to... Figure 5 This step S400 includes the following sub-steps:

[0085] S410, Preset grayscale boundary threshold between ceramic and metal areas.

[0086] Based on the prior knowledge that ceramics have weak X-ray absorption and appear as dark, low-grayscale areas in images, while metals have strong X-ray absorption and appear as bright, high-grayscale areas, we pre-set a grayscale boundary threshold. This threshold is used to divide the image into two segments: pixels with grayscale values ​​less than the threshold belong to the ceramic region; pixels with grayscale values ​​greater than the threshold belong to the metal region.

[0087] S420. Based on the grayscale boundary threshold, a piecewise enhancement function is constructed. Specifically, the piecewise enhancement function includes a first enhancement function for the ceramic region and a second enhancement function for the metal region. The first enhancement function is:

[0088]

[0089] in, This represents the grayscale value of the pixel to be enhanced. Represents the normalization coefficient. Indicates the grayscale threshold. This represents the adaptive parameter, and the contrast (standard deviation) within the ceramic region. Positive correlation, , This represents the adjustment coefficient. This is a key parameter of the first enhancement function. If the grayscale inside the ceramic region is very uniform, i.e., the contrast is low, it indicates that potential defects (such as cracks and pores) are not obvious, and the algorithm will perform stronger enhancement. Smaller dimensions result in a steeper curve. If the contrast is already sufficient, the enhancement will be less pronounced.

[0090] The second enhancement function is:

[0091]

[0092] in, This represents the maximum grayscale value that the image can achieve. This represents the intensity of the enhancement in the metallic region, and the kurtosis of the grayscale value in the metallic region. Positive correlation ,in, It is a basic strength coefficient that sets the basic strength level of the metal zone reinforcement. It is a key parameter of the second enhancement function, determined by the shape (kurtosis) of the grayscale distribution in the metal region. If the grayscale distribution in the metal region is highly concentrated, i.e., with high kurtosis, the algorithm will increase β to enhance local contrast.

[0093] S430. Adaptive image enhancement is performed on the second image based on the piecewise enhancement function. Specifically, based on the material properties of ceramics and metals, differentiated enhancement curves are matched for different grayscale regions in the image, thereby simultaneously improving the visibility of internal defects in ceramics and the structure of metals in a single transformation. In this embodiment, pixels with a grayscale value greater than the grayscale threshold are metal regions, and pixels with a grayscale value less than or equal to the grayscale threshold are ceramic regions.

[0094] Please see Figure 6 This is a system block diagram of an embodiment of the X-ray image preprocessing system for ceramic packaging devices according to the present invention. The X-ray image preprocessing system for ceramic packaging devices of this embodiment is used to implement the X-ray image preprocessing method for ceramic packaging devices described in the above embodiment. Specifically, the X-ray image preprocessing system for ceramic packaging devices of this embodiment includes an image acquisition module 100, an image segmentation module 200, an image filtering module 300, and an image enhancement module 400. Wherein:

[0095] The image acquisition module 100 is used to acquire X-ray images of the ceramic packaged device. Specifically, the image acquisition module 100 is a high-resolution X-ray imaging device, and the image resolution is set according to the detection accuracy requirements.

[0096] The image segmentation module 200 is used to segment the X-ray image acquired by the image acquisition module 100 using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, denoted as the first image. Specifically, the image segmentation module 200 is used to divide the X-ray image into several non-overlapping sub-regions; calculate an adaptive threshold for each sub-region based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method; segment the corresponding sub-regions based on the adaptive thresholds; and then stitch the images obtained after segmenting each sub-region according to its original spatial position to obtain the first image.

[0097] The image filtering module 300 is used to label connected components and filter out images of valid ceramic packaging device regions by clustering the areas of each connected component, denoted as the second image. Specifically, the image filtering module 300 is used to fill holes in the first image obtained by the image segmentation module 200, identify connected components in the image to obtain a set of connected components; label the connected components and assign a unique number to each connected component; calculate the area of ​​each connected component, and cluster the area data of each connected component; and filter out images of valid ceramic packaging device regions based on the clustering results, thus obtaining the second image.

[0098] The image enhancement module 400 is used to enhance the second image obtained by the image screening module 300 according to the characteristics of the ceramic packaged device in X-ray imaging, thus completing image preprocessing. Specifically, the image enhancement module 400 is used to preset a grayscale boundary threshold between the ceramic region and the metal region; based on the grayscale boundary threshold, a piecewise enhancement function is constructed, which includes a first enhancement function for the ceramic region and a second enhancement function for the metal region; and adaptive image enhancement is performed on the second image based on the piecewise enhancement function.

[0099] This invention employs an adaptive dual-threshold segmentation method that integrates the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. This effectively overcomes the shortcomings of traditional single-threshold methods in adapting to complex grayscale distributions, achieving accurate and complete segmentation of the ceramic packaged device region. Through connected component area clustering, it effectively distinguishes between the real device region and noise interference. An innovative adaptive segmented enhancement method based on material properties is proposed. Addressing the differences in imaging characteristics between the ceramic and metal regions in X-ray images, it matches optimal enhancement functions for each region. This allows for the simultaneous highlighting of low-contrast defects such as microcracks and pores within the ceramic and edge details of the metal structure in a single processing step, solving the problem of general enhancement methods neglecting certain aspects. Key parameters throughout the preprocessing process (such as segmentation weights and enhancement function parameters) are automatically calculated based on local image features, requiring no manual adjustment. This method intelligently adapts to different models and imaging conditions of ceramic packaged devices, demonstrating strong adaptability. It significantly improves image quality, laying a high-quality image foundation for subsequent defect detection and possessing significant industrial application value.

[0100] The above description merely illustrates preferred embodiments of the present invention and is quite specific and detailed; however, it should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of this invention should be determined by the appended claims.

Claims

1. A method for preprocessing X-ray images of ceramic packaged devices, characterized in that, Includes the following steps: Obtain X-ray images of ceramic packaged devices; The X-ray image is segmented using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, which is denoted as the first image; The image of the effective ceramic packaging device region is selected by clustering the areas of each connected component and labeled with connected components. This image is denoted as the second image. Based on the characteristics of ceramic-encapsulated devices in X-ray imaging, image enhancement is performed on the second image to complete image preprocessing; This step specifically includes: Preset the grayscale boundary threshold between the ceramic and metal areas; Based on the grayscale boundary threshold, a piecewise enhancement function is constructed, which includes a first enhancement function for the ceramic region and a second enhancement function for the metal region. Adaptive image enhancement is performed on the second image based on the piecewise enhancement function; The first enhancement function is: (three) In formula (iii), This represents the grayscale value of the pixel to be enhanced. Represents the normalization coefficient. Indicates the grayscale threshold. This indicates an adaptive parameter that is positively correlated with the contrast within the ceramic region; The second enhancement function is: (Four) In formula (iv), This represents the maximum grayscale value that the image can achieve. This indicates the intensity of the enhancement in the metallic region, which is positively correlated with the kurtosis of the grayscale value in the metallic region.

2. The X-ray image preprocessing method for ceramic packaged devices as described in claim 1, characterized in that, The adaptive dual-threshold segmentation method is an image segmentation method that combines the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. The step of segmenting the X-ray image using the adaptive dual-threshold segmentation method includes the following sub-steps: The X-ray image is divided into several non-overlapping sub-regions; The adaptive threshold for each sub-region is calculated based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method. The corresponding sub-regions are segmented based on the adaptive threshold, and then the sub-regions are segmented according to their original spatial positions. The resulting images are then stitched together to obtain the first image.

3. The X-ray image preprocessing method for ceramic packaged devices as described in claim 2, characterized in that, For each sub-region, the method for calculating its adaptive threshold based on the OTSU threshold segmentation method and the maximum entropy threshold segmentation method includes: The local thresholds of a sub-region are calculated using the OTSU threshold segmentation method and the maximum entropy threshold segmentation method, respectively, to obtain the first local threshold and the second local threshold. Weights are assigned to the sub-regions based on the segmentation effect of the first and second local thresholds. The first local threshold and the second local threshold are weighted and averaged based on the assigned weights to obtain the adaptive threshold.

4. The X-ray image preprocessing method for ceramic packaged devices as described in claim 1, characterized in that... The step of labeling connected components and filtering out effective ceramic packaging device regions by clustering the areas of each connected component includes the following sub-steps: The first image is filled with holes, and connected components in the image are identified to obtain a set of connected components; Perform connected component labeling and assign a unique number to each connected component; Calculate the area of ​​each connected component, cluster the area data of each connected component, and select the effective image of the ceramic packaging device region based on the clustering results.

5. The X-ray image preprocessing method for ceramic packaged devices as described in claim 4, characterized in that, The step of clustering the area data of each connected region and selecting the effective ceramic packaging device regions based on the clustering results includes the following sub-steps: The target clustering categories are determined to be two types: device connected components and noise connected components. Initialize cluster centers by randomly selecting two connected component area data as the initial cluster centers for the two classes; Assign connected component areas, iterate through all other connected component area data, calculate the Euclidean distance between each connected component area data and the two initial cluster centers, and select the connected component area data with the smallest Euclidean distance to each cluster center to be assigned to the category of the corresponding cluster center; Update the cluster centers by taking the arithmetic mean of the areas of all connected components in both categories as the new cluster centers; Repeat the steps of allocating the area of ​​connected components and updating the cluster centers until the deviation between the currently calculated cluster centers and the previously calculated cluster centers is less than a preset threshold or the preset number of iterations is reached.

6. The X-ray image preprocessing method for ceramic packaged devices as described in claim 3, characterized in that, The formula for calculating the adaptive threshold is as follows: (one) In formula (1), Indicates the first Adaptive threshold for each sub-region Indicates the first The first local threshold of each sub-region Indicates the first The second local threshold for each sub-region Indicates the first The weights of the first local thresholds for each sub-region Indicates the first The weights of the second local threshold for each sub-region and The sum of is 1.

7. The X-ray image preprocessing method for ceramic packaged devices as described in claim 6, characterized in that, The formula for calculating the weight of the first local threshold is as follows: (two) In formula (ii), Indicates the first local threshold Segmentation Inter-class variance of the segmentation results of each sub-region Indicates the second local threshold Segmentation The inter-class variance of the segmentation results of each sub-region.

8. A ceramic packaged device X-ray image preprocessing system, characterized in that, A method for preprocessing X-ray images of ceramic packaged devices as described in any one of claims 1-7, comprising: The image acquisition module is used to acquire X-ray images of ceramic packaged devices; The image segmentation module is used to segment the X-ray image using an adaptive dual-threshold segmentation method to initially obtain an image of the ceramic packaging device region, denoted as the first image; The image filtering module is used to label connected components and filter out images of valid ceramic packaging device regions by clustering the areas of each connected component, denoted as the second image; The image enhancement module is used to enhance the second image based on the characteristics of the ceramic packaged device in X-ray imaging, thereby completing image preprocessing.