Gas leakage detection method of device, gas leakage detection device and electronic device
By tracking the trajectory of air bubbles in the liquid, the location of leaks can be automatically identified, solving the problem of low efficiency and accuracy in traditional liquid detection and achieving efficient and accurate determination of leak locations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SEARI ELECTRIC TECH CO LTD
- Filing Date
- 2024-06-21
- Publication Date
- 2026-06-16
AI Technical Summary
Traditional methods for detecting leaks in liquid environments are inefficient and inaccurate, making it difficult to pinpoint the exact location of leaks.
By acquiring images of bubbles generated in the liquid by the device under test, tracing the bubble trajectory, identifying suspected leak locations, and confirming the actual leak location through automated image analysis methods.
It improves the accuracy and efficiency of leak detection, reduces interference caused by inherent air bubbles or gas in equipment gaps, and achieves automated and efficient leak location determination.
Smart Images

Figure CN118570452B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment testing technology, specifically to a method, device, and electronic equipment for detecting air leakage in equipment. Background Technology
[0002] In the production process of various instruments and equipment requiring liquid testing (such as gas meters, valves, pipe fittings, pressure vessels, etc.), leak detection is a critical quality control step. A common method is to completely immerse the equipment under test in a liquid and add air, then observe whether bubbles are generated to determine if there is a leak. However, because the bubble positions are random, the frequency of bubble generation is unpredictable, and the bubble trajectory is also random, and the instruments and equipment randomly carry bubbles into the liquid, it is difficult to accurately determine the leak location using conventional automated detection methods. Traditional leak detection in liquid testing environments is usually done manually, which is prone to missed or false positives. Therefore, traditional leak detection methods in liquid testing environments are insufficient in terms of efficiency and accuracy. Summary of the Invention
[0003] The purpose of this application is to provide a method, device, and electronic equipment for detecting air leaks, in order to solve the problem of low efficiency and accuracy of traditional methods for detecting air leaks in liquid environments.
[0004] To achieve the above objectives, the first aspect of this application provides a method for detecting air leakage in a device, comprising:
[0005] Acquire at least two target images, including an image of the device under test immersed in liquid generating bubbles;
[0006] Based on the target image, determine the trajectory of each generated bubble;
[0007] The suspected leak location of the device under test is determined by the trajectory of each bubble. The suspected leak location is the lowest position in the trajectory of the moving bubble.
[0008] Based on the suspected leak location, determine the actual leak location of the equipment under test.
[0009] In one embodiment of this application, determining the trajectory of each generated bubble based on the target image includes:
[0010] The target image is segmented into multiple detection regions;
[0011] Bubble detection is performed in each detection area to obtain the position information of the bubble in the corresponding detection area;
[0012] The position information of the bubbles in the corresponding detection areas is mapped onto the target image to obtain the trajectory of each bubble.
[0013] In one embodiment of this application, determining the trajectory of each generated bubble based on the target image includes:
[0014] Identify the first image frame in the target image;
[0015] For each first bubble in the first image frame, a first mapping library is determined. The first mapping library includes the identification information and corresponding attribute information of the first bubble, and the identification information, attribute information and first bubble correspond one-to-one.
[0016] Match the second bubble of the second image frame with the first bubble in the first mapping library. The second image frame is an image frame other than the first image frame in at least two target images.
[0017] If the second bubble matches the first bubble, the attribute information of the second bubble is mapped to the identification information of the matched first bubble.
[0018] In one embodiment of this application, determining the trajectory of each generated bubble based on the target image further includes:
[0019] If the second bubble does not match the first bubble, add the identification information and corresponding attribute information of the second bubble to the first mapping library.
[0020] In one embodiment of this application, after the second bubble matches the first bubble, and before mapping the attribute information of the second bubble to the identification information of the matched first bubble, the method includes:
[0021] The first crossover ratio of the matched first bubble and the second bubble is determined to be less than or equal to the first set crossover ratio.
[0022] In one embodiment of this application, matching the second bubble of the second image frame with the first bubble in the first mapping library includes:
[0023] If the position information of the second bubble and the position information of the first bubble meet the preset conditions, and the ratio of the area of the second bubble to the area of the first bubble meets the set ratio range, it is determined that the second bubble and the first bubble are matched. The preset condition is that the position of the second bubble is within a preset range centered on the position of the first bubble.
[0024] In one embodiment of this application, the attribute information includes the bubble's outline information and position information, where the position information is a preset position within the outline;
[0025] Based on the trajectory of each bubble, the suspected leak location of the device under test can be determined, including:
[0026] Determine the lowest position in the attribute information corresponding to the first identifier information in the first mapping library. The first identifier information is any identifier information in the first mapping library, and the position information includes the lowest position.
[0027] For the attribute information corresponding to the first identification information, determine the first ratio of the area corresponding to the lowest position to the area corresponding to the second position, and / or determine the second ratio of the width and height corresponding to the lowest position to the width and height corresponding to the second position, and / or determine the first area of the intersection of the contour corresponding to the lowest position and the contour corresponding to the second position, the second area of the union of the contour corresponding to the lowest position and the contour corresponding to the second position, and the third ratio of the first area to the second area, where the second position is the position other than the lowest position in the position information of the attribute information corresponding to the first identification information;
[0028] If the first ratio exceeds the set area ratio, and / or the second ratio exceeds the set width-to-height ratio, and / or the third ratio is less than the second set intersection-to-intersection ratio, the lowest position is identified as a suspected leak location.
[0029] In one embodiment of this application, determining the actual leak location of the device under test based on the suspected leak location includes:
[0030] The first attribute information corresponding to the suspected leak location is matched with the attribute information of the second identifier information, where the second identifier information is the identifier information in the first mapping library other than the first identifier information.
[0031] If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leak location will be determined as the actual leak location of the device under test.
[0032] A second aspect of this application provides a leak detection device for an equipment, comprising:
[0033] The acquisition module is used to acquire at least two frames of target images, including images of the device under test being immersed in liquid and generating bubbles.
[0034] The tracking module is used to determine the trajectory of each generated bubble based on the target image;
[0035] The determination module is used to determine the suspected leak location of the device under test based on the trajectory of each bubble, where the suspected leak location is the lowest position in the trajectory of the moving bubble; and to determine the actual leak location of the device under test based on the suspected leak location.
[0036] A third aspect of this application provides an electronic device, comprising:
[0037] The memory is configured to store instructions; and
[0038] The processor is configured to retrieve instructions from memory and, when executing the instructions, to implement the aforementioned method for detecting air leaks in the device.
[0039] A fourth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the aforementioned leakage detection method of the device.
[0040] This application first uses a target image of bubbles generated when the device under test is immersed in a liquid to determine the trajectory of each bubble. Then, the lowest position of the trajectory of the moving bubble is used to determine the suspected leak location of the device under test. Finally, the actual leak location of the device under test is determined based on the suspected leak location. In this way, by tracking the bubble trajectory and determining the leak location based on the bubble's trajectory, bubbles that have not moved are eliminated, reducing interference from bubbles inherent in the device under test during immersion or from gas in gaps in the device's casing, thereby improving the accuracy of leak detection. Furthermore, by using automated image analysis to detect the leak location, the detection efficiency is effectively improved compared to traditional manual inspection.
[0041] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram illustrating an application scenario of a device leakage detection method provided in an embodiment of this application.
[0044] Figure 2 A schematic flowchart illustrating a method for detecting air leakage in a device according to an embodiment of this application;
[0045] Figure 3 A flowchart illustrating a method for determining the trajectory of each bubble, provided in an embodiment of this application;
[0046] Figure 4 A schematic diagram illustrating the positional matching of a second bubble and a first bubble, provided for an embodiment of this application;
[0047] Figure 5 This is a schematic diagram of the structure of a leak detection device for an equipment provided in an embodiment of this application;
[0048] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified. In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to implement and use this application. In the following description, details are set forth for illustrative purposes. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid unnecessary detail that would obscure the description of this application. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0051] The device leakage detection method in this application embodiment is applied to a device leakage detection device, which can be installed in an electronic device. Figure 1 This is a schematic diagram of an application scenario for the air leakage detection method of the device in this application embodiment. The application scenario of the air leakage detection method in this application embodiment includes an electronic device 100, a display device 200, a background database 300, a device under test 400, and an image acquisition device 500 for implementing the air leakage detection method.
[0052] Understandable Figure 1The electronic devices in the application scenario of the device leakage detection method shown, or the devices contained in the electronic devices, do not constitute a limitation on the embodiments of this application. That is, the number or type of devices in the application scenario of the device leakage detection method, or the number or type of devices contained in each device, do not affect the overall implementation of the technical solution in the embodiments of this application, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of this application.
[0053] In this application embodiment, the electronic device 100 can be an independent device, or a device network or device cluster composed of devices. For example, the electronic device 100 described in this application embodiment includes, but is not limited to, a computer, a network host, a single network device, a set of multiple network devices, or a cloud device composed of multiple devices. Among them, the cloud device is composed of a large number of computers or network devices based on cloud computing.
[0054] Those skilled in the art will understand that Figure 1 The application scenarios shown are merely one application scenario corresponding to the technical solution of this application, and do not constitute a limitation on the application scenarios of the technical solution of this application. Other application scenarios may include more than one application scenario. Figure 1 The number of more or fewer electronic devices shown, or the network connections of electronic devices, for example Figure 1 Only one electronic device is shown in the diagram. It is understood that the scenario of this leak detection method may also include one or more other electronic devices, which are not limited here. The electronic device 100 may also include a memory and a processor. The memory is used to store information related to the leak detection method.
[0055] Furthermore, in the application scenario of the leakage detection method of the device in this application embodiment, the electronic device 100 can be equipped with a display device, or the electronic device 100 can be without a display device but connected to an external display device 200 for communication. The display device 200 is used to output the result of the leakage detection method executed in the electronic device. The electronic device 100 can access the background database 300. The background database 300 can be the local storage of the electronic device 100 or a cloud database located in the cloud. The background database 300 stores information related to the leakage detection method for the device under test 400. For example, image data can be collected from the device under test 400 by the image acquisition device 500 and saved to the background database 300. Then, the electronic device 100 executes the leakage detection method for the device under test 400 according to the image data saved in the background database 300.
[0056] It should be noted that, Figure 1The application scenario of the leakage detection method of the device shown is merely an example. The application scenario of the leakage detection method described in the embodiments of this application is to more clearly illustrate the technical solution of the embodiments of this application and does not constitute a limitation on the technical solution provided in the embodiments of this application.
[0057] Based on the application scenarios of the above-mentioned equipment leakage detection method, embodiments of the equipment leakage detection method are proposed. A detailed description is provided below with reference to the accompanying drawings.
[0058] Figure 2 This is a schematic flowchart illustrating a method for detecting air leakage in a device according to an embodiment of this application. Figure 2 As shown in the embodiments of this application, the leakage detection method can be executed by the processor in the above-mentioned electronic device 100 through steps 201-204, which will be described in detail below.
[0059] Step 201: Acquire at least two target images, including images of the device under test being immersed in liquid and generating bubbles.
[0060] In this embodiment, the device under test (DUT) refers to equipment requiring leak detection, such as gas meters, valves, pipe fittings, pressure vessels, and other instruments. Exemplarily, a liquid testing environment refers to immersing the DUT in a liquid for testing. Furthermore, the liquid can be a transparent liquid. For example, the DUT can be placed in water for water testing. The liquid water testing process involves completely immersing the DUT in water and adding air into the DUT. When air enters the water through the leak point, the gas forms bubbles in the water. By observing whether bubbles are generated, it can be determined whether the DUT is leaking. In other alternative examples, the liquid testing environment is not limited to a water environment; a free-flowing liquid can also be used instead of water to form a liquid testing environment.
[0061] After the device under test (DUT) is immersed in liquid, it is necessary to observe whether bubbles are generated around it. Therefore, it is necessary to acquire multi-view images of the DUT. In this embodiment, an image acquisition device can be used to acquire images of the DUT, and images containing bubbles can be selected from the acquired images to obtain at least two target images of the DUT. The target images include images of bubbles generated when the DUT is immersed in the liquid. In one example, the image acquisition device can be used to capture images of the DUT in the form of video or continuous photography. The image acquisition device can include one or more optical cameras that capture every detail of the DUT from different angles and distances.
[0062] Step 202: Determine the trajectory of each generated bubble based on the target image.
[0063] For each frame of the target image, the detected bubble locations may include those introduced during the process of the device under test entering the liquid, or bubbles generated from gaps in the device's casing. Since these bubbles are mobile, simply detecting them is insufficient to accurately pinpoint the leak location; therefore, bubble trajectory tracking is necessary. However, typical tracking algorithms continuously track detected bounding boxes, requiring that the identifier (IdentifyDocument, ID) of the tracked target be unique at any given moment. Using conventional tracking algorithms to detect leak locations has at least the following drawbacks: First, if the leak is severe, bubbles will rapidly form at the leak location and float upwards. At the same time, multiple bubbles may form at that leak location, but their identifiers will differ, hindering subsequent localization. Second, because the upward floating trajectory of bubbles is relatively random, different bubbles may overlap or intersect, leading to the exchange of identifiers among the tracked bubbles and resulting in tracking anomalies. Therefore, for tracking the bubble trajectory of the device under test in a liquid, this embodiment of the application can determine that bubbles detected in the same area originate from the same bubble, and bubbles detected at different times with overlapping detection frames within a certain range can also be determined to originate from the same bubble. Then, the identification information of at least two bubbles identified as the same bubble is set to the same identification information. In this way, the trajectory tracking of bubbles generated at each leak location can be completed, facilitating the subsequent determination of the leak location of the device under test based on the bubble identification information.
[0064] Step 203: Determine the suspected leak location of the device under test based on the trajectory of each bubble. The suspected leak location is the lowest position in the trajectory of the moving bubble.
[0065] In this embodiment, by detecting bubbles in the target image, the contour information of the bubble image contained in the target image can be obtained. The contour information is usually composed of a set of coordinates. When determining the position of the bubble, a point at a predetermined position in the contour information can be selected as the position of the bubble image according to a pre-set rule, such as selecting the coordinate point of the top left corner, the coordinate point of the bottom right corner, or the center point. In this way, the position information of the detected bubble in the target image can be obtained. Since bubbles are generally generated from leaks and gradually grow larger and float upwards, the lowest position in the trajectory of the bubble generated at each leak is the leak position. The lowest position refers to the position with the smallest vertical coordinate in the trajectory of the bubble. However, among these detected bubbles, there may be bubbles brought in by the process of the device under test entering the liquid, or bubbles generated by gaps in the shell of the device under test. Therefore, this embodiment determines the leak position for bubbles that have moved. If the bubble has not undergone any displacement or other changes, it is considered that there is no leak at that position. Specifically, this embodiment can first determine whether the trajectory of the bubble has moved, and then determine the leak position of the device under test based on the trajectory of the moved bubble. However, due to the complexity of bubble trajectories, if a rapidly rising bubble appears at a leak location, it may interfere with the trajectory tracking of bubbles corresponding to other marker information. Therefore, the location determined in this embodiment based on the lowest position in the trajectory of the moving bubble may not be the actual leak location. Thus, the suspected leak location is a preliminary determination based on the bubble trajectory and requires further evaluation. This improves the accuracy of leak location detection.
[0066] Step 204: Based on the suspected leak location, determine the actual leak location of the device under test.
[0067] In this embodiment, for each bubble's suspected leak location, if the suspected leak location matches the position in the trajectory of other bubbles—for example, the position information of the suspected leak location overlaps with the position information in the trajectory of other bubbles—it indicates that the suspected leak location is caused by interference from the rising process of other bubbles. In this case, the suspected leak location is determined not to be the actual leak location, and the leak location of the bubble can be re-detected. If the suspected leak location does not match the position in the trajectory of other bubbles, the suspected leak location can be determined as the actual leak location of the device under test. This secondary determination of the leak location improves the accuracy of leak detection in the device under test.
[0068] This application's embodiments improve the accuracy of leak detection by tracking the trajectory of air bubbles and determining the leak location based on those trajectories. This eliminates bubbles that haven't moved, reducing interference from air bubbles present during immersion or from gas in gaps in the device's casing. Furthermore, automated image analysis-based leak location detection significantly improves efficiency compared to traditional manual methods.
[0069] In this embodiment, step 202 firstly involves segmenting the target image into multiple detection regions, performing bubble detection on each region, and obtaining the position information of the bubble in the corresponding detection region. Then, the position information of the bubble in the corresponding detection region is mapped onto the target image to obtain the trajectory of each bubble.
[0070] Because the bubbles generated by the pressure applied after the device under test is immersed in liquid are affected by light, the brightness of the bubbles on the four sides varies, and most bubbles are relatively small in size relative to the overall device under test, which is not conducive to model detection. Therefore, in this embodiment, the target image can be segmented into multiple detection regions, and bubble detection can be performed on each individual detection region. For each detection region, the position information of the bubble in the current detection region can be obtained. Then, the position information of the bubble in the current detection region can be mapped onto the original target image to obtain the position information of each bubble in the target image. In this way, the position information of each bubble in the target image, that is, the trajectory of each bubble, can be determined.
[0071] In this embodiment, the target image can first be segmented using a first detection model to obtain multiple detection regions. Then, a second detection model is used to perform bubble detection on each detection region, and the detection results are mapped back to the original target image. In one example, both the first and second detection models can use the YOLO (You Only Look Once) v7 model. The backbone network used by YOLOv7 is typically a lightweight backbone network, such as CSPDarknet53 or other improved network structures, used to extract features from the input image. YOLOv7 usually adds some additional layers or modules after the backbone network to further process the extracted features for better object detection. The detection head in YOLOv7 is responsible for predicting the bounding box coordinates, confidence score, and class probability of the target. It typically uses detection layers of different scales to detect targets of different sizes. By controlling the shortest and longest gradient paths, it enables the network to learn more features and has stronger robustness. At the same time, YOLOv7 proposes a training method for the auxiliary head, the main purpose of which is to improve accuracy by increasing training cost without affecting inference time, because the auxiliary head only appears during the training process. It should be noted that the detection model in this application embodiment is not limited to the YOLOv7 model described above, but may also be other models capable of target image segmentation and bubble detection.
[0072] In this embodiment, to obtain the first detection model and the second detection model, sample data can be obtained through manual annotation. This sample data is then divided into training, validation, and test sets. The training set is used to train the two models, the validation set is used to optimize model parameters and hyperparameters, and the test set results are used to evaluate the final model's performance, obtaining the optimal pth model weights. Optionally, the segmented regions of the target image of the device under test are first annotated to obtain the segmentation data of the target image. For example, the device under test may include images of the front, back, left, and right sides. If the front and back of the device under test are roughly similar, they can be labeled as front, middle, and low (top, middle, and bottom). The sides of the device under test are labeled as sideup and sidebelow (top and bottom), resulting in a total of five labeled regions. Each detection region is then annotated to obtain bubble position data. For example, in each detection region, any bubble is labeled as "bubble." Based on the annotated segmentation data of the target image, the segmented bubble position data can be calculated. Annotation tools include, but are not limited to, LabelImg, Labelme, and VOTT.
[0073] Figure 3 This is a flowchart illustrating a method for determining the trajectory of each bubble, provided in an embodiment of this application. Figure 3As shown in the embodiments of this application, step 202 may include steps 301-305, which will be described in detail below with reference to the accompanying drawings.
[0074] Step 301: Determine the first image frame in the target image.
[0075] Bubbles generated at the same leak location exhibit a certain movement pattern along their trajectory. Therefore, this embodiment of the application, based on the bubble movement pattern and the attribute information of the detected bubbles, labels bubbles belonging to the same leak location with the same identification information. The bubble attribute information may include, but is not limited to, contour information, position information, width and height, area, etc., wherein the bubble position information, width and height, and area can all be calculated based on the contour information of the detected bubble image. Therefore, this embodiment of the application, by sequentially comparing at least two frames of target images, can label the collected bubbles according to the identification information. In this embodiment of the application, the first image frame is the first target image frame for labeling information. In one example, at least two target images can be arranged chronologically, with the target image at the beginning of the timestamp determined as the first image frame, and then compared sequentially with the image frames preceding the current image frame according to the time order of the timestamps.
[0076] Step 302: For each first bubble in the first image frame, determine the first mapping library. The first mapping library includes the identification information and corresponding attribute information of the first bubble, with a one-to-one correspondence between the identification information, attribute information, and the first bubble itself.
[0077] In this embodiment, the first bubble refers to a bubble in the first image frame. Each detected first bubble in the first image frame is assigned identification information, ensuring that the identification information is unique. Each identification information corresponds to the attribute information of the first bubble, forming a mapping relationship between the first bubble, the identification information, and the attribute information. Based on this mapping relationship, a first mapping library can be constructed. In the detection of subsequent frames, the first mapping library can be continuously updated according to the detection results, so that each identification information may correspond to multiple attribute information.
[0078] Step 303: Match the second bubble of the second image frame with the first bubble in the first mapping library. The second image frame is an image frame other than the first image frame in at least two target images.
[0079] In this embodiment, the second bubble is the bubble detected in the second image frame. The second bubble is matched with the first bubble stored in the first mapping library to update the information stored in the first mapping library, which facilitates the subsequent classification of bubbles in all image frames.
[0080] The movement of the bubbles conforms to the following conditions: the bubbles float upwards and do not move downwards; the bubbles may move left and right, but the lateral distance from the leak location is within a certain range; and the area ratio of bubbles generated at the same location is within a certain range. Therefore, in step 303, if the position information of the second bubble and the position information of the first bubble meet the preset conditions, the preset conditions are that the position of the second bubble is within a preset range centered on the position of the first bubble; and the area ratio of the second bubble to the area of the first bubble meets the set ratio range, it can be determined that the second bubble matches the first bubble.
[0081] Figure 4 This is a schematic diagram illustrating the positional matching of a second bubble and a first bubble, provided as an embodiment of this application. Figure 4 As shown, the position matching rule for determining whether a second bubble is the same as the first bubble is as follows: the horizontal coordinate is within the horizontal range dx of the first bubble, and the vertical coordinate is above the first bubble and within the vertical range dy of the first bubble. If the second bubble meets the above position matching rule, it means that the second bubble matches the first bubble in terms of position information. Simultaneously, if the area ratio of the second bubble to the first bubble also meets the set ratio range, it can be determined that the second bubble matches the first bubble. The preset range and the set ratio range can be obtained through prior experimentation and training based on the bubble movement patterns, and are used to determine whether the second bubble and the first bubble meet the matching rule.
[0082] In this embodiment of the application, in step 303, after the second bubble matches the first bubble, it is first determined that the first crossover ratio between the matched first bubble and the second bubble is less than or equal to the first set crossover ratio, and then the attribute information of the second bubble is mapped to the identification information of the matched first bubble.
[0083] During detection, due to the rapid rise of bubbles at some leakage locations, duplicate bubbles may be collected. Therefore, after the second bubble matches the first bubble, it can be determined whether the second bubble is a duplicate. If the second bubble is a duplicate, it is discarded, thereby improving detection efficiency. In this embodiment, the first cross-union ratio (CUNR) between the second and first bubbles can be used to determine whether they are duplicate bubbles. The CUNR is an indicator of the degree of overlap between two bubbles. The CUNR is calculated by comparing the bounding boxes of the second and first bubbles. If there is an overlap between the two bounding boxes and the CUNR is greater than the set first CUNR, then the second bubble and the first bubble are considered duplicate bubbles. Only when the first CUNR between the second and first bubbles is less than or equal to the set first CUNR is the attribute information of the second bubble mapped to the identification information of the matched first bubble. The first CUNR is a pre-set threshold for determining whether the second bubble and the first bubble are duplicate bubbles. This reduces the calculation of duplicate bubbles, lightens the processor load, and improves the efficiency of bubble detection.
[0084] Step 304: If the second bubble matches the first bubble, map the attribute information of the second bubble to the identification information of the matched first bubble.
[0085] In this embodiment, if the second bubble matches the first bubble in the first mapping library, it indicates that there is a bubble in the first bubble that originated from the same leak location as the second bubble. Therefore, the second bubble can be assigned the same identification information. It is only necessary to add the attribute information corresponding to the second bubble to this identification information. In this way, bubbles at the same leak location and their attribute information can be stored in the same mapping library corresponding to the same identification information.
[0086] Step 305: If the second bubble does not match the first bubble, add the identification information and corresponding attribute information of the second bubble to the first mapping library.
[0087] In this embodiment, if the second bubble does not match the first bubble, it indicates that the second bubble is generated at a new leakage location. In this case, the second bubble is assigned new identification information, and the attribute information of the second bubble is mapped to the new identification information to form a new mapping relationship between identification information and attribute information.
[0088] Please refer to Table 1, which is an example of a first mapping library in an embodiment of this application. Taking attribute information including contour information, position information, width, height, and area as an example, the contour information and position information can be represented by horizontal and vertical coordinates. Contour information is a set of coordinates, and position information is one coordinate in the set of coordinates included in the contour information. Assume that there are three first bubbles detected, and the corresponding identification information is ID1, ID2, and ID3, respectively. Each ID corresponds to the attribute information of the first bubble. Using [(x mn1 ,y mn1 ),(x mn2 ,y mn2 ),(x mn3 ,y mn3 ),…,(x mnp ,y mnp [)] represents contour information, and the position information is a coordinate in the contour information, WH mn Indicates width and height, A mn Let m represent the area, where m is the ID number, n is the nth attribute information of that ID number, and p is the pth contour coordinate of the contour information in the attribute information. Assume ID1 corresponds to 3 attribute information, ID2 corresponds to 2 attribute information, ID3 corresponds to 1 attribute information, and the position information is selected from the first contour coordinate in the contour information. Then the attribute information corresponding to ID1 can include [(x... 111 ,y 111 ),(x 112 ,y 112 ),…,(x 11p ,y 11p )],(x 111 ,y 111 WH 11 A 11 ;[(x 121 ,y 121 ),(x 122 ,y 122 ),…,(x 12p ,y 12p )],(x 121 ,y 121 WH 12 A 12 ; and [(x 131 ,y 131 ),(x 132 ,y 132 ),…,(x 13p ,y 13p )],(x 131 ,y 131 WH 13 A 13 The attribute information corresponding to ID2 can include [(x 211,y 211 ),(x 212 ,y 212 ),…,(x 21p ,y 21p )],(x 211 ,y 211 WH 21 A 21 ;[(x 221 ,y 221 ),(x 222 ,y 222 ),…,(x 22p ,y 22p )],(x 221 ,y 221 WH 22 A 22 The attribute information corresponding to ID3 can include [(x 311 ,y 311 ),(x 312 ,y 312 ),…,(x 31p ,y 31p )],(x 311 ,y 311 WH 31 A 31 In this way, each identification information can be mapped to a set of attribute information, thereby classifying the bubble images detected in at least two target images according to the identification information. This allows for quick retrieval of the attribute information of each identification information to determine the leak location, thus improving the efficiency of leak location determination.
[0089] Table 1
[0090]
[0091] The above steps create a first mapping library that establishes a mapping relationship between the meanings of bubbles, identification information, and attribute information. Bubbles are then categorized according to their identification information, with bubbles from the same leak location grouped under the same identification information, and each identification information corresponding to the attribute information of the bubble from that leak location.
[0092] In this embodiment, in step 203, the lowest position and the contour information of each position in the attribute information corresponding to the first identifier information in the first mapping library can be determined first. The first identifier information is any identifier information in the first mapping library. For the attribute information corresponding to the first identifier information, a first ratio of the area corresponding to the lowest position to the area corresponding to the second position is determined, and / or, a second ratio of the width and height corresponding to the lowest position to the width and height corresponding to the second position is determined, and / or, a first area corresponding to the intersection of the contours corresponding to the lowest position and the contours corresponding to the second position, a second area corresponding to the union of the contours corresponding to the lowest position and the contours corresponding to the second position, and a third ratio of the first area to the second area are determined, where the second position is the position in the position information of the attribute information corresponding to the first identifier information other than the lowest position; if the first ratio exceeds a set area ratio, and / or, the second ratio exceeds a set width and height ratio, and / or, the third ratio is less than a second set intersection-union ratio, the lowest position is determined as a suspected leak position.
[0093] In this embodiment, the bubble's position information may include its horizontal and vertical coordinates. Since bubbles typically originate from leaks, gradually increase in size, and float upwards, the position with the smallest vertical coordinate in the attribute information corresponding to each first identifier is the lowest position in that attribute information, and the positions in the first identifier information other than the lowest position are the second positions. Because some of the detected bubbles may be present from the process of the device under test entering the liquid, or bubbles generated from gaps in the device's casing, this embodiment determines the leak location for bubbles that have moved. If the bubble does not undergo any displacement or other changes, it is considered that there is no leak at that location.
[0094] Specifically, in this embodiment, the lowest position corresponding to the first identification information is compared with the second position to determine whether the trajectory of the bubble has moved. Since the bubble gradually increases in size during its movement, its area and width / height will change. Therefore, when the first ratio of the area corresponding to the lowest position to the area corresponding to the second position exceeds a set area ratio, and / or the second ratio of the width / height corresponding to the lowest position to the width / height corresponding to the second position exceeds a set width / height ratio, it indicates that the bubble has moved. Here, the set area ratio and set width / height ratio are thresholds used to determine the shape changes of the bubble at different positions. Exceeding the set area ratio and set width / height ratio indicates that the bubble's change meets the criteria for movement. Alternatively, the degree of overlap between the lowest and second positions can also be used to determine whether the bubble has moved. For example, a third ratio is determined based on the area corresponding to the intersection and the area corresponding to the union of the contours corresponding to the lowest and second positions. This third ratio represents the degree of overlap between the contours corresponding to the lowest and second positions, and the second set intersection / union ratio is a threshold used to determine the degree of overlap at different positions of the bubble. When the third ratio is less than the second set intersection / union ratio, it indicates that the bubble has moved. For example, if the second crossover ratio is set to 1, and the third ratio is 1, it indicates that the bubble overlap rate is 100%, meaning no movement has occurred. If the third ratio is less than 1, for example, 0.5, it indicates that the bubble has moved. The set area ratio, set aspect ratio, and second set crossover ratio are all thresholds used to determine whether the bubble has moved, and can be obtained beforehand through experimentation or training. The second set crossover ratio can be the same as or different from the first set crossover ratio, depending on the specific application scenario.
[0095] Taking the first mapping library shown in Table 1 as an example, assuming ID1 is the first identifier information, where the lowest position is (x 111 ,y 111 For ID1, we can respectively compare it with the lowest position (x) 111 ,y 111 ) as a group of attribute information and with the second position (x 121 ,y 121 ) or (x 131 ,y 131 The attribute information is compared in groups of (x) to determine whether the bubble corresponding to ID1 has moved. 111 ,y 111 ) and (x 121 ,y 121 Taking the comparison as an example, determine the area A corresponding to the lowest position. 111 Area A corresponding to the second position 12 Whether the first ratio exceeds the set area ratio, and / or determine the width and height WH corresponding to the lowest position. 11 Width and height (WH) corresponding to the second position 12Whether the second ratio exceeds the set aspect ratio, and / or first calculate the contour information corresponding to the lowest position [(x 111 ,y 111 ),(x 112 ,y 112 ),…,(x 11p ,y 11p The contour information corresponding to the second position [(x)] 121 ,y 121 ),(x 122 ,y 122 ),…,(x 12p ,y 12p The area of the intersection and union of x and y is calculated, and the ratio of the intersection area to the union area is obtained to obtain a third ratio. Then, it is determined whether the third ratio is less than the second set intersection-union ratio. If the above comparison conditions are met, the lowest position (x) can be determined. 111 ,y 111 ) relative to the second position (x) 121 ,y 121 The position (x) has shifted. Next, compare the lowest position (x) again in the same manner as described above. 111 ,y 111 ) and the second position (x) 131 ,y 131 If the above comparison conditions are also met, then the lowest position of ID1 can be determined as a suspected leak location. By judging the movement of the bubble, skipping the detection of non-leak locations can save bubble detection time and improve the efficiency of bubble detection.
[0096] In this embodiment, in step 204, the first attribute information corresponding to the suspected leak location can be matched with the attribute information corresponding to the second identification information, where the second identification information is the identification information in the first mapping library other than the first identification information. If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leak location is determined as the actual leak location of the device under test.
[0097] Because the floating trajectory of bubbles is complex, if a rapidly rising bubble appears at a leak location, it may interfere with the trajectory tracking of bubbles corresponding to other identification information. Therefore, the location determined based on the lowest position in the trajectory of the moving bubble in this embodiment may not be the actual leak location. Further judgment is needed for suspected leak locations. In this embodiment, the first attribute information of the suspected leak location is matched with the attribute information corresponding to the second identification information (excluding the first identification information) in the first mapping library. If no match is found for the attribute information corresponding to the second identification information, the suspected leak location is considered the actual leak location. If a match is found for the attribute information corresponding to the second identification information, the suspected leak location is not the actual leak location, but rather caused by interference from the rising bubble corresponding to the matched second identification information. In one example, the matching of the attribute information of the first attribute information and the attribute information of the second identification information can refer to the matching method in step 303 above. If the attribute information of the second identification information and the first attribute information meet the preset conditions and the area ratio of the attribute information of the second identification information to the first attribute information meets the set ratio range, it indicates that there is attribute information of the second identification information that matches the first attribute information. In this case, the bubble corresponding to the first attribute information does not belong to the bubble of the current identification information, but is caused by the interference of the bubble of other identification information. Therefore, the suspected leak location is not the actual leak location.
[0098] Taking the first mapping library shown in Table 1 as an example, assuming that in ID1 (x 111 ,y 111 (x) is a suspected leak location. At this point, it is necessary to... 111 ,y 111 The information is compared sequentially with the attribute information in ID2 and ID3, that is, (x) 111 ,y 111 The first attribute information corresponding to (x) and (x) 211 ,y 211 ), (x 221 ,y 221 ) and (x 311 ,y 311 The corresponding attribute information is compared sequentially. By judging (x) 111 ,y 111 ) and (x 211 ,y 211 ), (x 221 ,y 221 ) and (x 311 ,y 311 Does the positional relationship of A meet the preset conditions, and A 11 With A 21 A 22 and A 21The system checks whether the area ratio between the two values meets a set range to determine if the suspected leak location of ID1 matches the attribute information of non-ID1, thus determining whether the suspected leak location of ID1 is the actual leak location. This secondary determination of the leak location further improves the accuracy of leak location detection.
[0099] Based on the same inventive concept, this application also provides a leak detection device for implementing the aforementioned equipment. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in the embodiments of the leak detection device for one or more devices provided below can be found in the limitations of the leak detection method for equipment described above, and the specific limitations will not be repeated here.
[0100] Figure 5 This is a schematic diagram of the structure of a leak detection device for an embodiment of this application. Figure 5 As shown, this application embodiment provides a leak detection device for a device, which can be integrated into... Figure 1 The electronic device 100 shown may include an acquisition module 501, a tracking module 502, and a determination module 503. The acquisition module 501 acquires at least two target images, including images of the device under test (DUT) immersed in liquid generating bubbles. The tracking module 502 determines the trajectory of each generated bubble based on the target images. The determination module 503 determines the suspected leak location of the DUT based on the trajectory of each bubble, where the suspected leak location is the lowest position on the trajectory of the moving bubble, and determines the actual leak location of the DUT based on the suspected leak location.
[0101] The acquisition module 501, tracking module 502 and determination module 503 described above can respectively execute steps 201-204 in the above method embodiments. For a detailed introduction of these modules, please refer to the description of the corresponding steps in the above method, which will not be repeated here.
[0102] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Figure 6 As shown, this application also provides an electronic device that integrates a leak detection device to run a computer-readable storage medium corresponding to a leak detection method, to perform the steps of the leak detection method, including:
[0103] Memory 601 is configured to store instructions; and
[0104] The processor 602 is configured to retrieve instructions from the memory 601 and, when executing the instructions, to implement the aforementioned method for detecting air leakage in the device.
[0105] Based on the same inventive concept, embodiments of this application also provide a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the aforementioned device leakage detection method.
[0106] Since the instructions stored in the electronic device and the machine-readable storage medium can execute the steps in the leakage detection method of any device provided in the embodiments of this application, the beneficial effects that the leakage detection method of any device provided in the embodiments of this application can achieve can be realized, as detailed in the previous embodiments, and will not be repeated here.
[0107] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0109] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0111] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0112] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0113] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other classes of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0114] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0115] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for detecting air leakage in equipment, characterized in that, include: Acquire at least two target images, including an image of the device under test being immersed in a liquid and generating bubbles; Determine the first image frame in the target image; For each first bubble in the first image frame, a first mapping library is determined. The first mapping library includes the identification information and corresponding attribute information of the first bubble, and the identification information, attribute information and first bubble correspond one-to-one. Match the second bubble of the second image frame with the first bubble in the first mapping library, wherein the second image frame is an image frame other than the first image frame in the at least two target images; If the second bubble matches the first bubble, the attribute information of the second bubble is mapped to the identification information of the matched first bubble; the attribute information includes the bubble's outline information and position information, and the position information is a preset position in the outline; Determine the lowest position in the attribute information corresponding to the first identifier information in the first mapping library, wherein the first identifier information is any identifier information in the first mapping library, and the position information includes the lowest position; For the attribute information corresponding to the first identification information, determine a first ratio of the area corresponding to the lowest position to the area corresponding to the second position, and / or determine a second ratio of the width and height corresponding to the lowest position to the width and height corresponding to the second position; And / or, determine the first area of the intersection of the contour corresponding to the lowest position and the contour corresponding to the second position, the second area of the union of the contour corresponding to the lowest position and the contour corresponding to the second position, and the third ratio of the first area to the second area, wherein the second position is the position other than the lowest position in the position information in the attribute information corresponding to the first identification information; If the first ratio exceeds the set area ratio, and / or the second ratio exceeds the set width-to-height ratio, and / or the third ratio is less than the second set intersection-to-union ratio, the lowest position is determined as a suspected leak position, and the suspected leak position is the lowest position in the trajectory of the moving bubble. Based on the suspected leak location, the actual leak location of the device under test is determined.
2. The leak detection method according to claim 1, characterized in that, Determining the trajectory of each generated bubble based on the target image includes: The target image is segmented into multiple detection regions; Bubble detection is performed on each of the detection areas to obtain the position information of the bubble in the corresponding detection area; The position information of the bubbles in the corresponding detection areas is mapped onto the target image to obtain the trajectory of each bubble.
3. The leak detection method according to claim 1, characterized in that, The step of determining the trajectory of each generated bubble based on the target image further includes: If the second bubble does not match the first bubble, add the identification information and corresponding attribute information of the second bubble to the first mapping library.
4. The leak detection method according to claim 1, characterized in that, After the second bubble matches the first bubble, before mapping the attribute information of the second bubble to the identification information of the matched first bubble, the process includes: The first crossover ratio between the matched first bubble and the second bubble is determined to be less than or equal to a first set crossover ratio.
5. The leak detection method according to claim 1, characterized in that, The step of matching the second bubble in the second image frame with the first bubble in the first mapping library includes: If the position information of the second bubble and the position information of the first bubble meet a preset condition, and the ratio of the area of the second bubble to the area of the first bubble meets a set ratio range, it is determined that the second bubble matches the first bubble. The preset condition is that the position of the second bubble is within a preset range centered on the position of the first bubble.
6. The leak detection method according to claim 1, characterized in that, The step of determining the actual leak location of the device under test based on the suspected leak location includes: The first attribute information corresponding to the suspected leak location is matched with the attribute information corresponding to the second identification information, wherein the second identification information is the identification information in the first mapping library other than the first identification information; If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leak location is determined as the actual leak location of the device under test.
7. A leak detection device for equipment, characterized in that, include: The acquisition module is used to acquire at least two frames of target images, including images of the device under test being immersed in liquid and generating bubbles; The tracking module is used to determine a first image frame in the target image; for each first bubble in the first image frame, a first mapping library is determined, the first mapping library includes the identification information and corresponding attribute information of the first bubble, and the identification information, attribute information and first bubble of the first bubble correspond one-to-one; the second bubble of the second image frame is matched with the first bubble in the first mapping library, and the second image frame is the image frame other than the first image frame in the at least two target images; If the second bubble matches the first bubble, the attribute information of the second bubble is mapped to the identification information of the matched first bubble; the attribute information includes the bubble's outline information and position information, and the position information is a preset position in the outline; The determining module is used to determine the lowest position in the attribute information corresponding to the first identifier information in the first mapping library, wherein the first identifier information is any identifier information in the first mapping library, and the position information includes the lowest position; for the attribute information corresponding to the first identifier information, it determines a first ratio of the area corresponding to the lowest position to the area corresponding to the second position, and / or determines a second ratio of the width and height corresponding to the lowest position to the width and height corresponding to the second position; And / or, determine the first area of the intersection of the contour corresponding to the lowest position and the contour corresponding to the second position, the second area of the union of the contour corresponding to the lowest position and the contour corresponding to the second position, and the third ratio of the first area to the second area, wherein the second position is the position in the position information of the attribute information corresponding to the first identification information other than the lowest position; if the first ratio exceeds a set area ratio, and / or, the second ratio exceeds a set aspect ratio, and / or, the third ratio is less than a second set intersection-union ratio, the lowest position is determined as a suspected leak position, wherein the suspected leak position is the lowest position in the trajectory of the moving bubble; and based on the suspected leak position, determine the actual leak position of the device under test.
8. An electronic device, characterized in that, include: The memory is configured to store instructions; as well as The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the leak detection method of the device according to any one of claims 1 to 6.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions that, when executed by a processor, configure the processor to perform the leak detection method of the device according to any one of claims 1 to 6.