Control method and device of bubble detection equipment and medium
By performing X-ray image preprocessing and gradient sharpening processing on the bubble detection equipment, combined with deep learning model and expanded image operation, the problems of low contrast and noise interference in bubble detection are solved, and the high accuracy and reliability of bubble detection are achieved.
Patent Information
- Application Number
- CN202410125480.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2025-07-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The contrast between the bubble background and the bubbles in existing bubble detection equipment is low, resulting in low detection accuracy and susceptible to noise interference.
By X-ray detection of the object to be detected, the image is acquired and pre-processed, the bubble area is highlighted using the image deep learning model, and the edge information is strengthened through gradient sharpening processing, and gradient operation is performed in combination with the expanded image, retaining the edge information of the bubble area, and finally outputting bubble characteristics.
It improves the accuracy and reliability of bubble detection, effectively avoids the impact of noise characteristics on bubble characteristics, and ensures the accurate positioning of bubble position and shape information.
Smart Images

Figure CN120387966A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bubble detection equipment, and in particular to a control method, device, and medium for bubble detection equipment. Background Art
[0002] With the development of science and technology, bubble detection equipment serves as industrial equipment or experimental equipment, and is used to detect bubbles existing in the object to be detected. In the existing technology, in the traditional bubble detection process, due to the low contrast between the bubble background and the bubble, there is likely to be more noise in the bubble detection, which will affect the detection of bubbles, resulting in the low accuracy of bubble detection in the existing technology. Summary of the Invention
[0003] The embodiments of the present application provide a control method, device, and medium for a bubble detection device, which performs gradient sharpening processing based on a preprocessed image at least to a certain extent, and strengthens the edge information of the bubble area, thereby ensuring the accuracy of the bubble area, and then performs gradient operation on the enhanced image and the expanded image to retain the edge information of the bubble area, and outputs the bubble features based on the contour processing of the edge information of the bubble area, effectively improving the detection accuracy of the bubble, and performing multi-layer processing based on the X-ray image to ensure the detection reliability of the bubble, avoiding the influence of noise characteristics on the bubble characteristics.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a method for controlling a bubble detection device is provided, comprising:
[0006] Perform X-ray inspection on the object to be inspected and obtain X-ray images;
[0007] forming a pre-processed image based on image pre-processing of the X-ray image, and highlighting a bubble region in the pre-processed image;
[0008] An enhanced image is formed based on the gradient sharpening process of the pre-processed image, and the edge information of the bubble area is strengthened;
[0009] Performing a gradient operation on the enhanced image and the expanded image after the X-ray image expansion to output a processed image while retaining the edge information of the bubble area;
[0010] The bubble features are output based on the contour processing of the edge information of the bubble area, wherein the bubble features include bubble position information or bubble shape information.
[0011] Optionally, performing X-ray detection on the object to be detected and acquiring an X-ray image includes:
[0012] Place the object to be detected on the workbench of the X-ray device;
[0013] Collect the in-place signal of the object to be detected relative to the workbench of the X-ray device. Meanwhile, the workbench of the X-ray device is in the detection state;
[0014] Obtain the off-line detection schedule of the object to be detected, and trigger the off-line detection signal based on the off-line detection schedule;
[0015] Trigger the detection end of the X-ray device to perform X-ray detection on the object to be detected on the workbench based on the off-line detection signal, so as to obtain an X-ray image.
[0016] Optionally, forming a preprocessed image based on the image preprocessing of the X-ray image, and highlighting the bubble area in the preprocessed image, including:
[0017] Obtain the X-ray image;
[0018] Perform convolution processing on the X-ray image, and use a convolution kernel of corresponding size
[0019] Input the X-ray image after convolution processing into the first image deep learning model, and form a preprocessed image;
[0020] Screen the bubble area based on the preprocessed image, and highlight the bubble area in the preprocessed image.
[0021] Optionally, forming an enhanced image based on the gradient sharpening processing of the preprocessed image, and strengthening the edge information of the bubble area, including:
[0022] Obtain the preprocessed image;
[0023] Perform gradient sharpening processing on the preprocessed image, and form an enhanced image;
[0024] In the enhanced image, perform edge processing on the bubble area, and strengthen the edge information of the bubble area;
[0025] Perform filtering processing on the enhanced image, and weight the filtered image, so that the edge information of the bubble area is better retained, and the noise is completely removed.
[0026] Optionally, forming an enhanced image based on the gradient sharpening processing of the preprocessed image, and strengthening the edge information of the bubble area, further including:
[0027] In the gradient sharpening process of preprocessing an image, the sharpening operation formula is: USM = (X - w * G) / (1 - w), where X represents the edge enhancement map after bilateral filtering, G represents the Gaussian blurred image, and w represents the weight, and its value range is (0.1 - 0.9); among them, the contrast generated by the edge enhancement map and the blurred map is used to achieve the effect of sharpening the edges of the picture;
[0028] The gradient operation formula is: G(X) = X ⊕ K - X, where X represents the edge enhancement map obtained after the above improved sharpening operation, and K represents the kernel for morphological gradient; X ⊕ K represents the dilation of the edge enhancement image; the edges of the area to be detected are highlighted;
[0029] Alternatively, in the filtering process, each weight calculated by the spatial proximity of each point to the center point is optimized and optimized into the product of the weight calculated by the spatial proximity and the weight calculated by the pixel value similarity. The optimized weight is then convolved with the image to achieve the effect of edge-preserving denoising.
[0030] Optionally, the gradient operation of the enhanced image and the dilated image after dilating the X-ray image to output the processed image and retain the edge information of the bubble area includes:
[0031] Perform binarization processing on the X-ray image to form a binary image;
[0032] Form a dilated image based on the dilation processing of the binary image;
[0033] Perform a gradient operation on the enhanced image and the dilated image;
[0034] Remove the overlapping areas and noise areas, and output the processed image, where the edge information of the bubble area is retained in the processed image.
[0035] Optionally, the gradient operation of the enhanced image and the dilated image after dilating the X-ray image to output the processed image and retain the edge information of the bubble area further includes:
[0036] Obtain the processed image;
[0037] Perform region division on the processed image and screen out the background area;
[0038] Perform type recognition based on the background area to determine the background type;
[0039] Trigger the corresponding target parameters according to the background type, and adjust the current working parameters of the bubble detection device based on the target parameters;
[0040] When the bubble detection device works based on the target parameters, regulate the contrast between the background area and the bubble area and highlight the bubble area.
[0041] Optionally, bubble features are output based on contour processing of edge information of the bubble region, where the bubble features include bubble position information or bubble shape information, and it includes:
[0042] Obtain the bubble region;
[0043] Perform edge processing based on the bubble region and highlight the edge features of the bubble region;
[0044] Perform contour processing based on the edge features of the bubble region to complete the bubble contour in the bubble region;
[0045] Determine the bubble features based on the bubble contour, where the bubble features include bubble position information or bubble shape information.
[0046] According to one aspect of the embodiments of the present application, a control device for a bubble detection device is provided, including:
[0047] An X-ray detection module, configured to perform X-ray detection on an object to be detected and obtain an X-ray image;
[0048] An image preprocessing module, configured to form a preprocessed image based on image preprocessing of the X-ray image and highlight the bubble region in the preprocessed image;
[0049] An image enhancement module, configured to form an enhanced image based on gradient sharpening processing of the preprocessed image and strengthen the edge information of the bubble region;
[0050] A gradient operation module, configured to perform a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image and retain the edge information of the bubble region;
[0051] A contour processing module, configured to output bubble features based on contour processing of edge information of the bubble region, where the bubble features include bubble position information or bubble shape information.
[0052] According to one aspect of the embodiments of the present application, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the control method of the bubble detection device as described in the above embodiments.
[0053] According to one aspect of the embodiments of the present application, an electronic device is provided, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the control method of the bubble detection device as described in the above embodiments.
[0054] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the control method of the bubble detection device provided in the above embodiments.
[0055] In the technical solutions provided by some embodiments of the present application, an object to be detected is subjected to X-ray detection, and an X-ray image is obtained; a preprocessed image is formed based on the image preprocessing of the X-ray image, and the bubble region in the preprocessed image is highlighted; an enhanced image is formed based on the gradient sharpening processing of the preprocessed image, and the edge information of the bubble region is strengthened; a gradient operation is performed on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and the edge information of the bubble region is retained; a bubble feature is output based on the contour processing of the edge information of the bubble region, where the bubble feature includes bubble position information or bubble shape information. At this time, the object to be detected is subjected to X-ray detection, and enhancement processing is performed after the preprocessing of the X-ray image, so as to perform gradient sharpening processing based on the preprocessed image and strengthen the edge information of the bubble region, thereby ensuring the accuracy of the bubble region. Furthermore, a gradient operation is performed on the enhanced image and the dilated image to retain the edge information of the bubble region, and a bubble feature is output based on the contour processing of the edge information of the bubble region, effectively improving the detection accuracy of the bubble, and ensuring the detection reliability of the bubble through multi-layer processing based on the X-ray image, and avoiding the influence of noise features on the bubble features.
[0056] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. In the drawings:
[0058] Figure 1 A schematic flowchart of a control method of a bubble detection device according to an embodiment of the present application is shown;
[0059] Figure 2 Shows Figure 1 The flowchart of S110 in
[0060] Figure 3 shows Figure 1 the schematic flowchart of S120 in
[0061] Figure 4 shows Figure 1 the schematic flowchart of S130 in
[0062] Figure 5 shows Figure 1 the schematic flowchart of S140 in
[0063] Figure 6 shows Figure 1 the schematic flowchart of S150 in
[0064] Figure 7 shows the block diagram of the control device of the bubble detection device according to an embodiment of the present application;
[0065] Figure 8 shows the schematic structural diagram of the computer system of the electronic device suitable for implementing the embodiments of the present application. Detailed implementation manners
[0066] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0067] In addition, the described features, structures or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0068] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0069] The flowcharts shown in the accompanying drawings are merely illustrative and not necessarily inclusive of all content and operations / steps, nor are they necessarily to be executed in the order described. For example, some operations / steps may be decomposed, while some operations / steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0070] Figure 1 The flowchart showing the control method of the bubble detection device according to an embodiment of the present application is shown. This method can be applied to a bubble detection device to detect bubbles in an object to be detected.
[0071] Please refer to Figures 1 to 8 , the control method of the bubble detection device at least includes steps S110 to S150, which are introduced in detail as follows (hereinafter, this method is described by taking its application to a bubble detection device as an example):
[0072] Step S110: Perform X-ray detection on the object to be detected and obtain an X-ray image;
[0073] Step S120: Form a preprocessed image based on the image preprocessing of the X-ray image, and highlight the bubble region in the preprocessed image;
[0074] Step S130: Form an enhanced image based on the gradient sharpening processing of the preprocessed image, and strengthen the edge information of the bubble region;
[0075] Step S140: Perform a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and retain the edge information of the bubble region;
[0076] Step S150: Output bubble features based on the contour processing of the edge information of the bubble region, where the bubble features include bubble position information or bubble shape information.
[0077] In the technical solutions provided by some embodiments of the present application, an X-ray detection is performed on the object to be detected, and an X-ray image is obtained; a preprocessed image is formed based on the image preprocessing of the X-ray image, and the bubble region in the preprocessed image is highlighted; an enhanced image is formed based on the gradient sharpening processing of the preprocessed image, and the edge information of the bubble region is strengthened; a gradient operation is performed on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and the edge information of the bubble region is retained; a bubble feature is output based on the contour processing of the edge information of the bubble region, where the bubble feature includes bubble position information or bubble shape information. At this time, an X-ray detection is performed on the object to be detected, and enhancement processing is performed after the preprocessing of the X-ray image, so as to perform gradient sharpening processing based on the preprocessed image and strengthen the edge information of the bubble region, thereby ensuring the accuracy of the bubble region. Furthermore, a gradient operation is performed on the enhanced image and the dilated image to retain the edge information of the bubble region, and a bubble feature is output based on the contour processing of the edge information of the bubble region, effectively improving the detection accuracy of the bubble, and ensuring the detection reliability of the bubble through multi-layer processing based on the X-ray image, and avoiding the influence of noise features on the bubble features.
[0078] In step S110, an X-ray detection is performed on the object to be detected, and an X-ray image is obtained.
[0079] In the embodiments of the present application, an X-ray detection is performed on the object to be detected, so that an X-ray image is formed during the X-ray detection of the object to be detected, and a targeted detection is performed on the bubbles, so as to present the bubbles in the X-ray image and reduce the influence of the contrast between the bubble background and the bubbles.
[0080] The specific steps are as follows:
[0081] Step S111: Place the object to be detected on the workbench of the X-ray device;
[0082] Step S112: Collect the in-place signal of the object to be detected relative to the workbench of the X-ray device. At the same time, the workbench of the X-ray device is in the detection state;
[0083] In the embodiments of the present application, the X-ray device is used as the detection device for the object to be detected, and the X-ray device outputs X-rays to the object to be detected. At this time, the object to be detected is placed on the workbench of the X-ray device, and the in-place signal is triggered according to the fact that the detection object is within the detection range of the X-ray device, so as to collect the in-place signal of the object to be detected relative to the workbench of the X-ray device. At the same time, the workbench of the X-ray device is in the detection state and can receive the offline detection schedule.
[0084] Step S113: Obtain the offline detection schedule of the object to be detected, and trigger an offline detection signal based on the offline detection schedule;
[0085] Step S114: Trigger the detection end of the X-ray device based on the offline detection signal to perform X-ray detection on the object to be detected on the workbench, so as to obtain an X-ray image.
[0086] In an embodiment of the present application, an offline detection schedule of the object to be detected is obtained, and the offline detection schedule of the object to be detected is parsed, so as to trigger an offline detection signal based on the offline detection schedule, and then trigger the X-ray device to perform X-ray detection on the object to be detected within the corresponding time according to the offline detection signal, so as to obtain an X-ray image, so as to realize the timing control and remote control of the X-ray device. At this time, the bubble detection device combines X-ray imaging technology with image processing technology, so as to overcome the problems of low contrast and uneven shape in traditional detection. This innovation makes bubble detection perform better in more complex environments.
[0087] In step S120, a preprocessed image is formed based on the image preprocessing of the X-ray image, and the bubble region in the preprocessed image is highlighted.
[0088] In an embodiment of the present application, the X-ray image is processed in multiple layers. At this time, the X-ray image is subjected to image preprocessing, and a preprocessed image is formed based on the image preprocessing of the X-ray image, so as to highlight the bubble region in the preprocessed image, so as to perform subsequent processing on the bubble region in the preprocessed image and ensure the control of the bubble region in the preprocessed image.
[0089] The specific steps are as follows:
[0090] Step S121: Obtain the X-ray image;
[0091] Step S122: Perform convolution processing on the X-ray image and use a convolution kernel of corresponding size;
[0092] Step S123: Input the X-ray image after convolution processing into the first image deep learning model to form a preprocessed image;
[0093] Step S124: Screen the bubble region based on the preprocessed image and highlight the bubble region in the preprocessed image.
[0094] In an embodiment of the present application, the X-ray image is obtained, so as to perform convolution processing on the X-ray image, so as to perform image preprocessing on the X-ray image, so as to use a convolution kernel of corresponding size for the X-ray image, and further ensure the image processing of the X-ray image.
[0095] At this time, the X-ray image after convolution processing is input into the first image deep learning model to form a preprocessed image, making full use of the first image deep learning model. The first image deep learning model is trained based on previous X-ray images and preprocessed images, and receives the X-ray image after convolution processing to output the corresponding preprocessed image, thus ensuring the further processing of the X-ray image after convolution processing. At the same time, deep image processing is introduced. Through the training of the deep neural network of the first image deep learning model, it can identify and highlight the details of the bubbles, making the imaging stage more intelligent, and automatically extracting the region of interest of the image to preliminarily reduce noise interference.
[0096] In addition, the X-ray image is binarized, and dilation operation is used to improve the contrast between the bubbles and the background, making the bubbles more prominent. And the image is processed by a deep learning model to improve the sensitivity to the bubble contrast and more accurate edge localization.
[0097] In step S130, an enhanced image is formed based on the gradient sharpening processing of the preprocessed image, and the edge information of the bubble region is strengthened.
[0098] In the embodiment of the present application, the preprocessed image is further processed, and an enhanced image is formed based on the gradient sharpening processing of the preprocessed image, so as to form an enhanced image based on the preprocessed image. At the same time, the edge information of the bubble region is strengthened. At this time, an improved gradient sharpening operation is introduced, where the gradient sharpening operation is used to strengthen the edge information of the image. Bilateral filtering and Gaussian filtering with different kernel sizes are added to the sharpening operation, and the filtered image and the input image are weighted, so that the edge information is better retained and the noise is completely removed.
[0099] Advanced deep learning corrected images are introduced, including improved gradient operations, sharpening operations, feature extraction, and composite operations, to improve the accuracy and robustness of bubble detection. This enables our device to better denoise, retain edge information, and more precisely locate bubbles when processing complex images.
[0100] The specific steps are as follows:
[0101] Step S131: Obtain the preprocessed image;
[0102] Step S132: Perform gradient sharpening processing on the preprocessed image to form an enhanced image;
[0103] Step S133: In the enhanced image, perform edge processing on the bubble region and strengthen the edge information of the bubble region;
[0104] Step S134: Perform filtering on the enhanced image, and weight the filtered image to better retain the edge information of the bubble region and completely remove noise.
[0105] In an embodiment of the present application, a preprocessed image is obtained, and the preprocessed image is subjected to gradient sharpening processing so that the preprocessed image forms an enhanced image under the gradient sharpening processing. Based on the gradient sharpening processing, the preprocessed image is subjected to gradient sharpening, and the bubble region is gradually presented.
[0106] At this time, in the gradient sharpening processing of the preprocessed image, the sharpening operation formula is: USM = (X - w*G) / (1 - w), where X represents the edge enhancement map after bilateral filtering, G represents the Gaussian blurred image, and w represents the weight, and its value range is (0.1 to 0.9); among them, the contrast generated by the edge enhancement map and the blurred map is used to achieve the effect of sharpening the image edge.
[0107] The gradient operation formula is: G(X) = X⊕K - X, where X represents the edge enhancement map obtained after the above improved sharpening operation, K represents the kernel for morphological gradient; X⊕K represents the dilation of the edge enhancement image; the edge of the region to be detected is highlighted.
[0108] At this time, in the enhanced image, edge processing is performed on the bubble region, and the edge information of the bubble region is strengthened; filtering is performed on the enhanced image, and the filtered image is weighted to better retain the edge information of the bubble region and completely remove noise.
[0109] Therefore, in the filtering process, each weight calculated by the spatial proximity of each point to the center point is optimized to the product of the weight calculated by the spatial proximity and the weight calculated by the pixel value similarity. The optimized weight is then convolved with the image to achieve the effect of edge-preserving denoising.
[0110] The formula can be expressed as
[0111] g(i,j) represents the output point; S(i,j) refers to the range of size (2N + 1)(2N + 1) centered on (i,j); f(k,l) represents (multiple) input points; w(i,j,k,l) represents the value calculated by two Gaussian functions (not the weight).
[0112] In addition, the Gaussian filter is a linear filter that can effectively suppress noise and smooth the image. Its principle of action is similar to that of the mean filter, which is to take the mean of the pixels within the filter window as the output.
[0113] where σ is the standard deviation.
[0114] In addition, the image features generated by deep learning introduced after enhancement processing are used to assist the gradient and sharpening operations to better adapt to the complex scenarios of bubble detection, which can better retain fine features, optimize the image to improve the detection performance. At the same time, the advanced features generated by deep learning are used to weight the sharpening and gradient operations, making the operations more refined, which can better highlight the edge features of bubbles and improve the detection sensitivity. Ensure the interpretability of parameters during the training process, reduce the training resource overhead, and use the extracted features to more easily solve the bubble detection problem.
[0115] In step S140, a gradient operation is performed on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and the edge information of the bubble region is retained.
[0116] In the embodiment of the present application, a binary image is formed based on the X-ray image, and a dilated image is formed based on the dilation processing of the binary image, so as to utilize the dilated image obtained by dilating the X-ray image, and perform a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image, thereby performing image control on the enhanced image and the dilated image obtained by dilating the X-ray image, so as to output a processed image and retain the edge information of the bubble region.
[0117] The specific steps are as follows:
[0118] Step S141: Perform binarization processing on the X-ray image to form a binary image;
[0119] Step S142: Form a dilated image based on the dilation processing of the binary image;
[0120] Step S143: Perform a gradient operation on the enhanced image and the dilated image;
[0121] Step S144: Remove the overlapping regions and noise regions, and output a processed image, wherein the edge information of the bubble region is retained in the processed image.
[0122] In the embodiment of the present application, binarization processing is performed on the X-ray image to form a binary image, and a dilated image is formed by the dilation processing of the binary image, thereby realizing the conversion from the X-ray image to the dilated image and making full use of the dilated image.
[0123] Then, perform a gradient operation on the enhanced image and the dilated image; remove the overlapping regions and noise regions, and output the processed image, where the processed image retains the edge information of the bubble region. At this time, perform a further gradient operation - repetition and noise on the image with improved sharpening operation and the dilated image (original image) to denoise and retain the edge information simultaneously, improving the situation where the original gradient operation cannot handle low contrast, resulting in poor subsequent detection results. Subtracting the edge-enhanced image with improved sharpening operation from the dilated image results in only the bubble information remaining, which is more beneficial for subsequent detection.
[0124] The step of performing a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image to output the processed image and retain the edge information of the bubble region further includes: obtaining the processed image; dividing the processed image into regions and screening out the background regions; performing type recognition based on the background regions to determine the background type; triggering the corresponding target parameters according to the background type and adjusting the current working parameters of the bubble detection device based on the target parameters; when the bubble detection device operates based on the target parameters, regulating the contrast between the background region and the bubble region and highlighting the bubble region. At this time, the background region is fully utilized, and a deep learning algorithm is added to the background region, enabling the device to adaptively adjust the parameters. By learning the features of the image, the deep learning model can dynamically adjust the parameters in each processing step to adapt to different image situations and improve the robustness of bubble detection.
[0125] In step S150, bubble features are output based on the contour processing of the edge information of the bubble region, where the bubble features include bubble position information or bubble shape information.
[0126] At this time, the bubble features include bubble position information or bubble shape information. At this time, perform X-ray detection on the object to be detected, and perform enhancement processing after preprocessing the X-ray image, so as to perform gradient sharpening processing based on the preprocessed image and strengthen the edge information of the bubble region, thus ensuring the accuracy of the bubble region. Furthermore, perform a gradient operation on the enhanced image and the dilated image to retain the edge information of the bubble region, and output bubble features based on the contour processing of the edge information of the bubble region, effectively improving the detection accuracy of the bubble, and ensuring the detection reliability of the bubble through multi-layer processing based on the X-ray image, avoiding the influence of noise features on the bubble features.
[0127] The specific steps are as follows:
[0128] Step S151: Obtain the bubble region;
[0129] Step S152: Perform edge processing according to the bubble region and highlight the edge features of the bubble region;
[0130] Step S153: Perform contour processing based on the edge features of the bubble region to complete the bubble contours in the complete bubble region;
[0131] Step S154: Determine the bubble features based on the bubble contours, where the bubble features include bubble position information or bubble shape information.
[0132] In the embodiments of the present application, the bubble region is controlled to avoid overall control of the X-ray image, so as to improve the efficiency of bubble detection. At the same time, edge processing is performed according to the bubble region, and the edge features of the bubble region are highlighted. The contour of the processed image is searched to accurately locate the bubble region. Based on image processing, we accurately locate the position and shape of the bubble through contour search.
[0133] At this time, perform contour processing based on the edge features of the bubble region to complete the bubble contours in the complete bubble region; determine the bubble features based on the bubble contours, where the bubble features include bubble position information or bubble shape information. Therefore, by adopting advanced contour analysis technology, we can effectively identify the edge information of the bubble, providing a solid foundation for subsequent analysis and storage.
[0134] In addition, a user-defined parameter output function is introduced in the result analysis stage, enabling users to adjust the parameters in the analysis process according to specific requirements. This includes specific attributes of the bubble, such as shape, size, position, etc. Users can input parameters through the interface to customize the result analysis to better adapt to different scenarios and application requirements.
[0135] At the same time, we further upgrade the display device to make it have the function of adjustable parameters. Users can adjust the image display effect in real time through the display device interface, including contrast, brightness, color, etc. This enables users to optimize the image display according to the actual situation and observe the bubble detection results more clearly. Then, a general chart display and analysis function is introduced to display the comprehensive analysis results of bubble detection in a graphical way. This includes statistical information, trend charts, histograms, etc., providing users with a more intuitive and comprehensive data presentation. Users can clearly understand information such as bubble distribution and size distribution at a glance on the general chart, so as to better understand the detection results.
[0136] In addition, we allow users to adjust the analysis parameters of the bubble area ratio and the good product rate according to specific requirements. Users can flexibly set these parameters to adapt to different production environments and product requirements. This feature gives users more autonomy, making the bubble detection device more flexible and universal.
[0137] In the technical solutions provided by some embodiments of the present application, an X-ray detection is performed on the object to be detected, and an X-ray image is obtained; a preprocessed image is formed based on the image preprocessing of the X-ray image, and the bubble region in the preprocessed image is highlighted; an enhanced image is formed based on the gradient sharpening processing of the preprocessed image, and the edge information of the bubble region is strengthened; a gradient operation is performed on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and the edge information of the bubble region is retained; a bubble feature is output based on the contour processing of the edge information of the bubble region, where the bubble feature includes bubble position information or bubble shape information. At this time, an X-ray detection is performed on the object to be detected, and an enhancement process is performed after the preprocessing of the X-ray image, so as to perform gradient sharpening processing based on the preprocessed image and strengthen the edge information of the bubble region, thereby ensuring the accuracy of the bubble region. Furthermore, a gradient operation is performed on the enhanced image and the dilated image to retain the edge information of the bubble region, and a bubble feature is output based on the contour processing of the edge information of the bubble region, effectively improving the detection accuracy of the bubble, and ensuring the detection reliability of the bubble through multi-layer processing based on the X-ray image, and avoiding the influence of noise features on the bubble features.
[0138] The following describes the device embodiments of the present application, which can be used to execute the control method of the bubble detection device in the above embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the embodiments of the control method of the bubble detection device in the above of the present application.
[0139] Figure 7 The block diagram of the control device of the bubble detection device according to an embodiment of the present application is shown.
[0140] Refer to Figure 7 As shown, the control device of the bubble detection device according to an embodiment of the present application includes:
[0141] An X-ray detection module 210, configured to perform X-ray detection on the object to be detected and obtain an X-ray image;
[0142] An image preprocessing module 220, configured to form a preprocessed image based on the image preprocessing of the X-ray image and highlight the bubble region in the preprocessed image;
[0143] An image enhancement module 230, configured to form an enhanced image based on the gradient sharpening processing of the preprocessed image and strengthen the edge information of the bubble region;
[0144] A gradient operation module 240, configured to perform a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image and retain the edge information of the bubble region;
[0145] The contour processing module 250 is configured to output bubble features based on contour processing of the edge information of the bubble region, where the bubble features include bubble position information or bubble shape information.
[0146] In an embodiment of the present application, an electronic device is further provided. The electronic device includes:
[0147] One or more processors;
[0148] A storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the control method of the bubble detection device as described in the foregoing embodiments.
[0149] In an example, Figure 8 FIG. shows a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application.
[0150] It should be noted that, Figure 8 The computer system of the electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0151] As Figure 8 shown, the computer system includes a central processing unit (CPU) 301 (i.e., the processor as described above), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage section 308 into the random access memory (RAM) 303, such as executing the method described in the foregoing embodiments. It should be understood that RAM 303 and ROM 302 are the storage devices as described above. In RAM 303, various programs and data required for system operation are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other through a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.
[0152] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. The drive 310 is also connected to the I / O interface 305 as required. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is installed on the drive 310 as required so that a computer program read therefrom can be installed into the storage section 308 as required.
[0153] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 309, and / or installed from the removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, various functions defined in the system of the present application are executed.
[0154] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0155] In this application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0157] The units described in the embodiments of the present application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation to the unit itself in some cases.
[0158] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device implements the methods described in the above embodiments.
[0159] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0160] Through the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0161] After considering the specification and practicing the embodiments disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application.
[0162] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A control method for a bubble detection device, characterized in that, Applied to a bubble detection device; The control method of the bubble detection device includes: Performing X-ray detection on an object to be detected and obtaining an X-ray image; Forming a preprocessed image based on image preprocessing of the X-ray image, and highlighting the bubble region in the preprocessed image; Forming an enhanced image based on gradient sharpening processing of the preprocessed image, and strengthening the edge information of the bubble region; Performing a gradient operation on the enhanced image and the dilated image obtained by dilating the X-ray image to output a processed image, and retaining the edge information of the bubble region; Outputting bubble features based on contour processing of the edge information of the bubble region, where the bubble features include bubble position information or bubble shape information.
2. The method according to claim 1, wherein The performing X-ray detection on the object to be detected and obtaining an X-ray image includes: Placing the object to be detected on the workbench of the X-ray device; Collecting the in-place signal of the object to be detected relative to the workbench of the X-ray device, and at the same time, the workbench of the X-ray device is in the detection state; Obtaining the offline detection schedule of the object to be detected and triggering an offline detection signal based on the offline detection schedule; Triggering the detection end of the X-ray device to perform X-ray detection on the object to be detected on the workbench based on the offline detection signal to obtain an X-ray image.
3. The method according to claim 1, characterized in that, The forming a preprocessed image based on image preprocessing of the X-ray image, and highlighting the bubble region in the preprocessed image includes: Obtaining the X-ray image; Performing convolution processing on the X-ray image and using a convolution kernel of corresponding size; Inputting the X-ray image after convolution processing into the first image deep learning model to form a preprocessed image; Screening the bubble region based on the preprocessed image and highlighting the bubble region in the preprocessed image.
4. The method according to claim 3, wherein The forming an enhanced image based on gradient sharpening processing of the preprocessed image, and strengthening the edge information of the bubble region includes: Obtaining the preprocessed image; Performing gradient sharpening processing on the preprocessed image to form an enhanced image; In the enhanced image, performing edge processing on the bubble region and strengthening the edge information of the bubble region; Performing filtering processing on the enhanced image, weighting the filtered image, so that the edge information of the bubble region is better retained and noise is completely removed.
5. The method according to claim 4, wherein The forming an enhanced image based on gradient sharpening processing of the preprocessed image, and strengthening the edge information of the bubble region further includes: In the gradient sharpening processing of the preprocessed image, the sharpening operation formula: USM=(X - w*G) / (1 - w), where X represents the edge enhancement map after bilateral filtering, G represents the Gaussian blurred image, w represents the weight, and its value range is (0.1~0.9); wherein, the contrast generated by the edge enhancement map and the blurred map is used to achieve the effect of sharpening the image edge; The gradient operation formula: G(X)=X⊕K - X, where X represents the edge enhancement map obtained by the above improved sharpening operation, K represents the kernel for morphological gradient; X⊕K represents dilating the edge enhancement image; highlighting the edge of the region to be detected; Alternatively, in the filtering process, each weight calculated by the spatial proximity of each point to the center point is optimized and optimized into the product of the weight calculated by the spatial proximity and the weight calculated by the pixel value similarity. The optimized weight is then convolved with the image to achieve the effect of edge-preserving denoising.
6. The method according to claim 4, characterized in that, The gradient operation of the enhanced image and the dilated image dilated from the X-ray image to output the processed image and retain the edge information of the bubble region includes: Performing binarization processing on the X-ray image to form a binary image; Forming a dilated image based on the dilation processing of the binary image; Performing a gradient operation on the enhanced image and the dilated image; Removing the overlapping regions and noise regions and outputting the processed image, wherein the processed image retains the edge information of the bubble region.
7. The method according to claim 6, wherein The gradient operation of the enhanced image and the dilated image dilated from the X-ray image to output the processed image and retain the edge information of the bubble region further includes: Obtaining the processed image; Performing region division on the processed image and screening out the background region; Performing type recognition based on the background region to determine the background type; Triggering the corresponding target parameters according to the background type and adjusting the current working parameters of the bubble detection device based on the target parameters; When the bubble detection device works based on the target parameters, adjusting the contrast between the background region and the bubble region and highlighting the bubble region.
8. The method according to claim 6, wherein The output of the bubble feature based on the contour processing of the edge information of the bubble region, wherein the bubble feature includes bubble position information or bubble shape information, includes: Obtaining the bubble region; Performing edge processing on the bubble region and highlighting the edge features of the bubble region; Performing contour processing based on the edge features of the bubble region to complete the bubble contour in the bubble region; Determining the bubble feature based on the bubble contour, wherein the bubble feature includes bubble position information or bubble shape information.
9. A control device for a bubble detection device, characterized in that, Including: An X-ray detection module for performing X-ray detection on the object to be detected and obtaining an X-ray image; An image preprocessing module for forming a preprocessed image based on the image preprocessing of the X-ray image and highlighting the bubble region in the preprocessed image; An image enhancement module for forming an enhanced image based on the gradient sharpening processing of the preprocessed image and strengthening the edge information of the bubble region; A gradient operation module for performing a gradient operation on the enhanced image and the dilated image dilated from the X-ray image to output the processed image and retain the edge information of the bubble region; A contour processing module for outputting a bubble feature based on the contour processing of the edge information of the bubble region, wherein the bubble feature includes bubble position information or bubble shape information.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the control method of the bubble detection device according to any one of claims 1 to 8.