Equipment air leakage detection method, air leakage detection device and electronic equipment
Using image analysis technology to determine the bubble trajectory and accurately locate the air leakage location, it solves the problem of low efficiency and accuracy of air leakage detection in traditional liquid detection, and achieves efficient and accurate air leakage detection.
Patent Information
- Application Number
- CN202410816588.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-21
AI Technical Summary
The efficiency and accuracy of air leak detection methods in traditional liquid detection environments are low, making it difficult to accurately locate air leaks and prone to missed or misjudgments.
By obtaining the target image of the device under test immersed in the liquid, the trajectory of the bubble is determined, and the suspected air leakage location is determined based on the lowest position in the trajectory. Through automatic detection through image analysis, interfering bubbles are eliminated and the actual air leakage location is accurately located.
It improves the accuracy and efficiency of air leakage detection, reduces manual judgment errors, and realizes automated air leakage location detection.
Smart Images

Figure CN118570452A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment detection, and in particular to an equipment leakage detection method, a leakage detection device and an electronic device. Background Art
[0002] In the production process of various instruments and equipment that require liquid detection (such as gas meters, valves, pipe fittings, pressure vessels, etc.), leak detection is a key quality control step. The common detection method is to completely immerse the device to be tested in the liquid and add air, and then observe whether bubbles are generated to determine whether the device is leaking. However, due to the random position of the bubbles, the frequency of bubble generation is uncertain, the bubble movement trajectory is also random, and the instrument equipment will randomly carry bubbles when entering the liquid, it is difficult to use conventional automated detection to accurately determine the leak location. Leak detection in traditional liquid detection environments is usually determined manually, which is prone to missed judgments and misjudgments. Therefore, traditional leak detection methods in liquid detection environments have shortcomings in terms of efficiency and accuracy. Summary of the invention
[0003] The purpose of the present application is to provide a leakage detection method, a leakage detection device and an electronic device for equipment, so as to solve the problem of low efficiency and accuracy of the leakage detection method in the liquid detection environment in the traditional technology.
[0004] In order to achieve the above-mentioned object, the present application provides, in a first aspect, a method for detecting a gas leakage of a device, comprising:
[0005] Acquire at least two frames of target images, where the target images include images of the device under test immersed in liquid and generating bubbles;
[0006] According to the target image, the trajectory of each bubble generated is determined;
[0007] Determine the suspected leakage position of the device under test according to the trajectory of each bubble, where the suspected leakage position is the lowest position in the trajectory of the moving bubble;
[0008] Determine the actual leak location of the device under test based on the suspected leak location.
[0009] In one embodiment of the present application, determining the trajectory of each bubble generated according to the target image includes:
[0010] Segment the target image into multiple detection areas;
[0011] Perform bubble detection on 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 area is mapped to the target image to obtain the trajectory of each bubble.
[0013] In one embodiment of the present application, determining the trajectory of each bubble generated according to the target image includes:
[0014] Determining a first image frame in a target image;
[0015] For each first bubble in the first image frame, determine a first mapping library, the first mapping library including identification information of the first bubble and corresponding attribute information, the identification information of the first bubble, the attribute information, and the first bubble being in one-to-one correspondence;
[0016] Matching a second bubble of a second image frame with a first bubble in the first mapping library, wherein the second image frame is an image frame other than the first image frame in at least two frames of 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 the present application, determining the trajectory of each bubble generated according to the target image further includes:
[0019] If the second bubble does not match the first bubble, the identification information and corresponding attribute information of the second bubble are added to the first mapping library.
[0020] In one embodiment of the present application, after the second bubble is matched to the first bubble, before the attribute information of the second bubble is mapped to the identification information of the matched first bubble, the method includes:
[0021] It is determined that a first intersection-over-union ratio of the matched first bubble and the second bubble is less than or equal to a first set intersection-over-union ratio.
[0022] In one embodiment of the present 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 area ratio of the second bubble to the area of the first bubble meets the set ratio range, it is determined that the second bubble matches the first bubble, and 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 the present application, the attribute information includes contour information and position information of the bubble, and the position information is a preset position in the contour;
[0025] Determine the suspected leak location of the device under test based on the trajectory of each bubble, including:
[0026] Determine the lowest position in the attribute information corresponding to the first identification information in the first mapping library, the first identification information is any identification 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 a first ratio of an area corresponding to the lowest position to an area corresponding to the second position, and / or determine a second ratio of a width and height corresponding to the lowest position to a width and height corresponding to the second position, and / or determine a first area of an intersection of a contour corresponding to the lowest position and a contour corresponding to the second position, a second area of a union of a contour corresponding to the lowest position and a contour corresponding to the second position, and a third ratio of the first area to the second area, wherein the second position is a position other than the lowest position in the position information in 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 aspect ratio, and / or the third ratio is less than the second set intersection ratio, the lowest position is determined as the suspected leak position.
[0029] In one embodiment of the present application, determining the actual leakage position of the device to be tested according to the suspected leakage position includes:
[0030] Matching the first attribute information corresponding to the suspected leak position with the attribute information of the second identification information, where the second identification information is the identification information in the first mapping library except the first identification information;
[0031] If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leak position is determined to be the actual leak position of the device under test.
[0032] A second aspect of the present application provides a gas leakage detection device for equipment, comprising:
[0033] An acquisition module, used to acquire at least two frames of target images, the target images including images of bubbles generated when the device under test is immersed in liquid;
[0034] A tracking module, used to determine the trajectory of each bubble generated according to the target image;
[0035] The determination module is used to determine the suspected leakage position of the device under test according to the trajectory of each bubble, the suspected leakage position being the lowest position in the trajectory of the moving bubble; and to determine the actual leakage position of the device under test according to the suspected leakage position.
[0036] A third aspect of the present application provides an electronic device, including:
[0037] a memory configured to store instructions; and
[0038] The processor is configured to call instructions from the memory and implement the above-mentioned gas leakage detection method of the device when executing the instructions.
[0039] A fourth aspect of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the gas leakage detection method for the above-mentioned device.
[0040] The present application first determines the trajectory of each bubble generated by the target image of the device to be tested immersed in the liquid. Then, the suspected leakage position of the device to be tested is determined according to the lowest position in the trajectory of the moving bubble. Finally, the actual leakage position of the device to be tested is determined according to the suspected leakage position. In this way, by tracking the trajectory of the bubbles and determining the leakage position according to the trajectory of the bubbles, the bubbles that have not moved are eliminated, and the interference caused by the bubbles brought by the device to be tested during the immersion process or the bubbles generated by the gas in the device shell gap on the judgment of the leakage position is reduced, thereby improving the accuracy of the leakage detection of the device to be tested. In addition, the leakage position detection of the equipment is realized by automated analysis based on image analysis, which effectively improves the detection efficiency compared with the traditional manual detection.
[0041] Other features and advantages of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A schematic diagram of an application scenario of a gas leakage detection method for a device provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of a flow chart of a method for detecting air leakage of a device provided in an embodiment of the present application;
[0045] Figure 3 A schematic flow chart of a method for determining the trajectory of each bubble provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the position matching of a second bubble and a first bubble provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the structure of a gas leakage detection device for a device provided in an embodiment of the present application;
[0048] Figure 6 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0050] In the description of the present application, it should be understood that the terms "first" and "second" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined. In the present application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in the present application is not necessarily interpreted as being more preferred or more advantageous than other embodiments. In order to enable any technician in the field to implement and use the present application, the following description is given. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can also be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.
[0051] The gas leakage detection method of the device in the embodiment of the present application is applied to a gas leakage detection device of the device, and the gas leakage detection device can be arranged in the electronic device. Figure 1 Schematic diagram of an application scenario of the air leakage detection method for a device in an embodiment of the present application. The application scenario of the air leakage detection method in an embodiment of the present application includes an electronic device 100, a display device 200, a background database 300, a device to be tested 400 and an image acquisition device 500 for implementing the air leakage detection method.
[0052] Understandably, Figure 1The electronic device in the application scenario of the gas leakage detection method of a device shown, or the device included in the electronic device, does not constitute a limitation on the embodiments of the present application, that is, the number of devices and types of devices included in the application scenario of the gas leakage detection method of the device, or the number of devices and types of devices included in each device do not affect the overall implementation of the technical solution in the embodiments of the present application, and can all be regarded as equivalent replacements or derivatives of the technical solution claimed to be protected in the embodiments of the present application.
[0053] The electronic device 100 in the embodiment of the present application may be an independent device, or a device network or device cluster composed of devices. For example, the electronic device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network device, a plurality of network device sets or a cloud device composed of a plurality of devices. 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 scenario shown in the figure is only an application scenario corresponding to the technical solution of the present application, and does not constitute a limitation on the application scenario of the technical solution of the present application. Other application scenarios may also include Figure 1 More or fewer electronic devices shown in, or electronic device network connection relationships, such as Figure 1 Only one electronic device is shown. It can be understood that the scenario of the leakage detection method can also include one or more other electronic devices, which are not limited here. The electronic device 100 can also include a memory and a processor, and the memory is used to store information related to the leakage detection method.
[0055] In addition, in the application scenario of the air leakage detection method of the device in the embodiment of the present application, the electronic device 100 can be provided with a display device, or the electronic device 100 is not provided with a display device and is communicatively connected to an external display device 200, and the display device 200 is used to output the result of the execution of the air leakage detection method in the electronic device. The electronic device 100 can access the background database 300. The background database 300 can be a local memory of the electronic device 100, or it can be a cloud database set in the cloud, and the background database 300 stores information related to the air leakage detection method for the device to be tested 400. For example, the image data of the device to be tested 400 can be first collected by the image acquisition device 500, and the image data can be saved in the background database 300. Then, the electronic device 100 executes the air leakage detection method for the device to be tested 400 according to the image data saved in the background database 300.
[0056] It should be noted that Figure 1The application scenario of the air leakage detection method of the device shown is merely an example. The application scenario of the air leakage detection method described in the embodiment of the present application is intended to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided in the embodiment of the present application.
[0057] Based on the application scenario of the gas leakage detection method of the above equipment, an embodiment of the gas leakage detection method of the equipment is proposed, which is described in detail below with reference to the accompanying drawings.
[0058] Figure 2 A schematic diagram of a flow chart of a method for detecting air leakage in a device provided in an embodiment of the present application. Figure 2 As shown, in the embodiment of the present application, the air leakage detection method can execute the following steps 201-204 by the processor in the above-mentioned electronic device 100, which is described in detail below.
[0059] Step 201: Acquire at least two frames of target images, where the target images include images of bubbles generated when the device under test is immersed in liquid.
[0060] In an embodiment of the present application, the device to be tested refers to equipment that needs to be leak-detected, such as gas meters, valves, pipe fittings, pressure vessels and other instruments. Exemplarily, the liquid detection environment refers to placing the device to be tested in liquid for detection. Further, the liquid can be a transparent liquid. For example, the device to be tested can be placed in water for water detection. The liquid water detection process refers to completely immersing the device to be tested in water and adding air to the device to be tested. When air enters the water through the leak at the leak position, the gas will form bubbles in the water. By observing whether bubbles are generated, it can be determined whether the device to be tested is leaking. In other alternative examples, the liquid detection environment is not limited to a water environment, and a flowable liquid can be used to replace water to form a liquid detection environment.
[0061] After the device to be tested is immersed in the liquid, it is necessary to observe whether bubbles are generated around it. Therefore, it is necessary to collect multi-angle images of the device to be tested. In the embodiment of the present application, the image acquisition device can be used to acquire images of the device to be tested, and images with bubbles are screened out from the acquired images to obtain at least two frames of target images of the device to be tested. The target image includes an image of bubbles generated when the device to be tested is immersed in the liquid. In one example, the image acquisition device can be used to shoot the device to be tested in the form of video or continuous photography. Among them, the image acquisition device may include one or more optical cameras, which capture every detail of the device to be tested from different angles and distances.
[0062] Step 202: Determine the trajectory of each bubble generated according to the target image.
[0063] For the bubble position detected in each frame of the target image, there may be bubbles in these bubbles that are brought by the device under test entering the liquid, or bubbles generated by the shell gap of the device under test, and because the bubbles are moving, it is impossible to accurately locate the leak position by only relying on the detected bubbles, so it is necessary to track the bubble trajectory. The general tracking algorithm continuously tracks the detected detection frame, and the identification information (IdentifyDocument, ID) of the tracking target at the same time must be different. If the leak position is detected by a general tracking algorithm, there are at least the following disadvantages. First, if the leak is serious, bubbles will quickly generate at the leak position and float upward. At this time, at the same time, the leak position may generate multiple bubbles, but the identification information of the marked multiple bubbles is different, which is not conducive to later positioning. In addition, since the upward floating trajectory of the bubble is relatively random, different bubbles may overlap or the trajectory intersects, and the identification information of the tracked bubbles is easily exchanged, resulting in tracking abnormalities. Therefore, for the bubble trajectory tracking of the device under test in the liquid, the embodiment of the present application can determine the bubbles detected in the same area as being generated from the same bubble, and determine the bubbles detected at different times that have intersections and the intersections are within a certain range as being generated from the same bubble. Then, the identification information of at least two bubbles determined to be the same bubble among the detected bubbles is set to the same identification information. In this way, the trajectory tracking of the bubbles generated at each leakage position can be completed, which facilitates the subsequent determination of the leakage position of the device under test according to the identification information of the bubble.
[0064] Step 203: determine the suspected leakage position of the device under test according to the trajectory of each bubble, where the suspected leakage position is the lowest position in the trajectory of the moving bubble.
[0065] In the embodiment of the present application, by detecting the bubbles in the target image, the contour information of the bubble image contained in the target image can be obtained, and the contour information is usually composed of a set of coordinates. When determining the position of the bubble, the point of the set position in the contour information can be selected as the position of the bubble image according to the pre-set rules, for example, the coordinate point of the upper left corner, the coordinate point of the lower right corner, the center point, etc. are selected. In this way, the position information of the bubble detected in the target image can be obtained. Since the bubble is generally generated by the leaking position, and gradually becomes larger and floats upward, the lowest position in the bubble trajectory generated by each leaking position is the leaking position. Among them, the lowest position refers to the position with the smallest ordinate in the bubble trajectory. However, among the detected bubbles, there may be bubbles that are brought by the device to be tested during the process of entering the liquid, or bubbles generated by the shell gap of the device to be tested. Therefore, the embodiment of the present application determines the leaking position for the bubble that has moved. If the bubble does not undergo a change such as displacement, it is considered that the position is not leaking. Specifically, the embodiment of the present application can first determine whether the trajectory where the bubble is located has moved, and then determine the leaking position of the device to be tested according to the trajectory where the bubble that has moved is located. However, due to the complexity of the bubble floating trajectory, if a bubble quickly floats up at a certain leaking position, it may interfere with the tracking of the bubble trajectory corresponding to other identification information. Therefore, the position determined by the embodiment of the present application based on the lowest position in the trajectory of the moving bubble is not necessarily the actual leaking position. Therefore, the suspected leaking position is the leaking position preliminarily determined based on the bubble trajectory, and further judgment of the suspected leaking position is required. In this way, the accuracy of leaking position detection can be improved.
[0066] Step 204: Determine the actual leak position of the device under test according to the suspected leak position.
[0067] In an embodiment of the present application, for each suspected leakage position of a bubble, if the suspected leakage position matches the position in the trajectory of other bubbles, for example, the position information of the suspected leakage position coincides with the position information in the trajectory of other bubbles, etc., then it indicates that the suspected leakage position is caused by interference from the floating process of other bubbles. At this time, it is determined that the suspected leakage position is not the actual leakage position, and the leakage position of the bubble can be re-detected. If the suspected leakage position does not match the position of the trajectory of other bubbles, the suspected leakage position can be determined as the actual leakage position of the device to be tested. By making a secondary judgment on the leakage position, the accuracy of leakage detection of the device to be tested is higher.
[0068] The embodiment of the present application tracks the trajectory of the bubbles and determines the leakage position according to the trajectory of the bubbles, thereby eliminating the bubbles that have not moved, reducing the interference caused by the bubbles brought by the device under test during immersion or the bubbles generated by the gas in the device shell gap on the judgment of the leakage position, thereby improving the accuracy of the leakage detection of the device under test. In addition, the leakage position detection of the device is realized through automated analysis based on image analysis, which effectively improves the detection efficiency compared with traditional manual detection.
[0069] In the embodiment of the present application, in step 202, the target image can be first divided into multiple detection areas, and bubble detection is performed on each detection area to obtain the position information of the bubble in the corresponding detection area. Then, the position information of the bubble in the corresponding detection area is mapped to the target image to obtain the trajectory of each bubble.
[0070] Since the bubbles generated by the pressurization after the device to be tested is immersed in the liquid are affected by the light, the bubbles on the four surfaces are not uniformly bright, and most of the bubbles are relatively small in size relative to the device to be tested as a whole, which is not conducive to model detection. Therefore, the embodiment of the present application can divide the target image into multiple detection areas, and then perform bubble detection on each detection area separately. For each detection area, the position information of the bubble in the current detection area can be obtained, and then the position information of the bubble in the current detection area is mapped to the original target image, and the position information of each bubble in the target image can be obtained. 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 an embodiment of the present application, the target image can be first segmented by a first detection model to obtain multiple detection areas, and then a bubble detection can be performed on each detection area by a second detection model, and the detection result can be mapped to the original target image. In one example, both the first detection model and the second detection model can adopt the YOLO (You Only Look Once) v7 model. The backbone network used by YOLOv7 is usually a lightweight backbone network, such as CSPDarknet53 or other improved network structures, which is used to extract features of the input image. YOLOv7 usually adds some additional layers or modules after the backbone network to further process the extracted features in order to better detect the target. The detection head in YOLOv7 is responsible for predicting the bounding box coordinates, confidence scores, and category probabilities of the target, and usually uses detection layers of different scales to detect targets of different sizes. It enables the network to learn more features and has stronger robustness by controlling the shortest and longest gradient paths. At the same time, YOLOV7 proposes a training method for auxiliary heads, the main purpose of which is to increase the training cost and improve the accuracy without affecting the reasoning time, because the auxiliary heads only appear during the training process. It should be noted that the detection model of the embodiment of the present application is not limited to the above-mentioned YOLOv7 model, but can also be other models that can perform target image segmentation and bubble detection.
[0072] In an embodiment of the present application, in order to obtain the first detection model and the second detection model, sample data can be obtained by manual annotation, and then the sample data can be divided into a training set, a validation set, a test set, etc. The two models are trained using the training set, and the model parameters and hyperparameters are optimized using the validation set. The effect of the final model is evaluated according to the test set results to obtain the optimal PTH model weight. Optionally, the segmented area of the target image of the device to be tested is first annotated to obtain the segmentation data of the target graphic. For example, the device to be tested may include images of four surfaces, front, back, left, and right. If the front and back of the device to be tested are roughly similar, they can be marked as front, middle, and low according to the upper, middle, and lower sides, and the sides of the device to be tested can be marked as sideup and sidebelow according to the upper and lower sides, and a total of 5 label areas can be marked. Then each detection area is annotated to obtain bubble position data. For example, in each detection area, as long as bubbles appear, they are all marked as bubble, and then the segmented bubble position data can be calculated according to the segmentation data of the annotated target image. Among them, the annotation tools include but are not limited to LabelImg, Labelme, VOTT, etc.
[0073] Figure 3 A flow chart of a method for determining the trajectory of each bubble provided in an embodiment of the present application. Figure 3As shown, in the embodiment of the present application, step 202 may include steps 301-305, etc., which are described in detail below in conjunction with the accompanying drawings.
[0074] Step 301: Determine the first image frame in the target image.
[0075] The bubbles generated at the same leakage position have a certain movement pattern on the trajectory. Therefore, the embodiment of the present application marks the bubbles belonging to the same leakage position with the same identification information based on the movement pattern of the bubbles and the attribute information of the detected bubbles. The attribute information of the bubble may include but is not limited to contour information, position information, width, height, area, etc., wherein the position information, width, height and area of the bubble can be calculated based on the contour information of the detected bubble image. Therefore, the embodiment of the present application can mark the collected bubbles according to the identification information by comparing at least two frames of target images in sequence. The first image frame in the embodiment of the present application is the first frame of the target image marked with identification information. In one example, at least two frames of target images can be arranged in time sequence, and the target image with the front timestamp is determined as the first image frame, which is compared with the image frame before the current image frame in the time order of the timestamp.
[0076] Step 302: determine a first mapping library for each first bubble in the first image frame, wherein the first mapping library includes identification information of the first bubble and corresponding attribute information, and the identification information, attribute information and first bubble of the first bubble correspond to each other one by one.
[0077] In the embodiment of the present application, the first bubble refers to the bubble in the first image frame. The first bubbles detected in the first image frame are assigned identification information respectively. At this time, the identification information is not repeated. Each identification information corresponds to the attribute information corresponding to the first bubble, and a mapping relationship between the first bubble, the identification information and the attribute information can be formed. Based on the 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, where the second image frame is an image frame other than the first image frame in the at least two frames of target images.
[0079] In the embodiment of the present application, the second bubble is a 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, so as to facilitate the subsequent classification of bubbles in all image frames.
[0080] The movement pattern of bubbles meets the following conditions: bubbles will float upwards and will not move downwards; bubbles may move left and right, but the lateral distance from the leak position is within a certain range; and the area ratio of bubbles generated at the same position 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 first bubble meets the set ratio range, it can be determined that the second bubble matches the first bubble.
[0081] Figure 4 A schematic diagram of a second bubble matching the first bubble position provided in an embodiment of the present application. Figure 4 As shown, the position matching rule for determining whether the second bubble is the same as the first bubble is: the horizontal coordinate is within the horizontal range dx of the first bubble, the vertical coordinate is above the first bubble, and within the longitudinal 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. At the same time, when 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. Among them, the preset range and the set ratio range can be obtained by prior testing and training according to the movement law of the bubble, so as to determine whether the second bubble and the first bubble meet the matching rule.
[0082] In an embodiment of the present application, in step 303, after the second bubble is matched to the first bubble, it is first determined that the first intersection-and-union ratio of the matched first bubble and the second bubble is less than or equal to a first set intersection-and-union ratio, and then the attribute information of the second bubble is mapped to the identification information of the matched first bubble.
[0083] In the detection, since some air leakage positions have bubbles that float up faster, it may be possible to collect repeated bubbles. Therefore, after the second bubble matches the first bubble, it can be determined whether the second bubble is a repeated bubble. If the second bubble is a repeated bubble, the bubble is discarded, thereby improving the detection efficiency. In an embodiment of the present application, the first intersection and union ratio of the second bubble and the first bubble can be used to determine whether the second bubble and the first bubble are repeated bubbles. The intersection and union ratio refers to an indicator of the degree of overlap of two bubbles. The intersection and union ratio of the marked frame positions of the second bubble and the first bubble is calculated. If there is an overlapping part between the two marked frames and it is greater than the set first set intersection and union ratio, it means that the second bubble and the first bubble are repeated bubbles. Only when the first intersection and union ratio of the second bubble and the first bubble is less than or equal to the first set intersection and union ratio, the attribute information of the second bubble is mapped to the identification information of the matched first bubble. The first set intersection and union ratio refers to the intersection and union ratio threshold value set in advance for judging whether the second bubble and the first bubble are repeated bubbles. In this way, the calculation of repeated bubbles can be reduced, the burden of the processor can be reduced, and the efficiency of bubble detection can be improved.
[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 the embodiment of the present application, if the second bubble matches the first bubble in the first mapping library, it means that there is a bubble in the first bubble that is generated at the same leak position 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 the identification information. In this way, the bubbles at the same leak position and their attribute information can be stored in the mapping corresponding to the same identification information.
[0086] Step 305: If the second bubble does not match the first bubble, add identification information and corresponding attribute information of the second bubble to the first mapping library.
[0087] In the embodiment of the present application, if the second bubble does not match the first bubble, it means that the second bubble is a bubble generated at a new leak position. At this time, the second bubble is assigned new identification information, and the attribute information of the second bubble is mapped with the new identification information to form a new mapping relationship between the identification information and the attribute information.
[0088] Please refer to Table 1, which is an example of a first mapping library in an embodiment of the present application. Taking the 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 coordinates and vertical coordinates. Contour information is a set of coordinates, and position information is one of the coordinates in the set of coordinates included in the contour information. Assume that there are three first bubbles currently detected, and the corresponding identification information is ID1, ID2 and ID3, respectively, and each ID corresponds to the attribute information of the first bubble. Use [(x mn1 ,y mn1 ),(x mn2 ,y mn2 ),(x mn3 ,y mn3 ),…,(x mnp ,y mnp )] represents the contour information, the position information is a coordinate in the contour information, WH mn Indicates width and height, A mn represents the area, where m is the ID number, n is the nth attribute information of the ID number, and p is the pth contour coordinate of the contour information in the attribute information. Assume that ID1 corresponds to 3 attribute information, ID2 corresponds to 2 attribute information, and ID3 corresponds to 1 attribute information, and the position information selects 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 may 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 may 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 establish a mapping relationship with a set of attribute information, so that the bubble images detected in at least two frames of target images can be classified according to the identification information, so as to quickly find the attribute information of each identification information to determine the leakage position, thereby improving the efficiency of leakage position determination.
[0089] Table 1
[0090]
[0091] Through the above steps, a first mapping library including a mapping relationship between bubbles, identification information and attribute information can be formed, so that bubbles are classified according to identification information, bubbles generated at the same leaking position are classified as the same identification information, and each identification information corresponds to the attribute information of the bubble generated at the leaking position.
[0092] In the embodiment of the present application, in step 203, the lowest position and contour information of each position in the attribute information corresponding to the first identification information in the first mapping library can be determined first, and the first identification information is any identification information in the first mapping library. 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 corresponding to 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, 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 and height ratio, and / or the third ratio is less than the second set intersection-joint ratio, the lowest position is determined as the suspected leak position.
[0093] In an embodiment of the present application, the position information of the bubble may include the horizontal coordinate and the vertical coordinate of the bubble. Since the bubble is generally generated by the leakage position, gradually becomes larger and floats upward, the position with the smallest vertical coordinate in the attribute information corresponding to each first identification information is the lowest position in the attribute information corresponding to the first identification information, and the position other than the lowest position in the first identification information is the second position. Since the detected bubbles may be bubbles brought by the device to be tested entering the liquid, or bubbles generated by the shell gap of the device to be tested. Therefore, the embodiment of the present application determines the leakage position for the bubbles that have moved. If the bubble does not undergo displacement or other changes, it is considered that there is no leakage at that position.
[0094] Specifically, the embodiment of the present application can first compare the lowest position corresponding to the first identification information with the second position to determine whether the trajectory of the bubble has moved. Since the bubble gradually increases during the movement process, the area and width and height of the bubble will change. Therefore, when the first ratio of the area corresponding to the lowest position to the area corresponding to the second position exceeds the set area ratio, and / or the second ratio of the width and height corresponding to the lowest position to the width and height corresponding to the second position exceeds the set width and height ratio, it means that the bubble has moved. Among them, the set area ratio and the set width and height ratio are thresholds for judging the shape change of different positions of the bubble. Exceeding the set area ratio and the set width and height ratio indicates that the change of the bubble reaches the judgment condition of movement. At the same time, it is also possible to judge whether the bubble has moved according to the degree of overlap between the lowest position and the second position. For example, a third ratio is determined based on the area corresponding to the intersection of the contours corresponding to the lowest position and the second position and the area corresponding to the union. The third ratio characterizes the degree of overlap between the contour corresponding to the lowest position and the contour corresponding to the second position, and the second set intersection and union ratio is a threshold for judging the degree of overlap between different positions of the bubble. When the third ratio is less than the second set intersection and union ratio, it means that the bubble has moved. For example, the second intersection-and-union ratio is set to 1. If the third ratio is 1, it means that the bubble overlap rate is 100% and no movement has occurred. If the third ratio is less than 1, for example, the third ratio is 0.5, it means that the bubble has moved. Among them, the set area ratio, the set aspect ratio and the second set intersection-and-union ratio are all thresholds for judging whether the bubble has moved, and can also be obtained in advance through experiments or training. The second set intersection-and-union ratio can be the same as or different from the first set intersection-and-union ratio, and can be set according to the actual application scenario.
[0095] Taking the first mapping library shown in Table 1 as an example, assuming that ID1 is the first identification information, the lowest position is (x 111 ,y 111 ), for ID1, you can respectively 111 ,y 111 ) is a set of attribute information and the second position (x 121 ,y 121 ) or (x 131 ,y 131 ) as a group of attribute information to determine whether the bubble corresponding to ID1 has moved. 111 ,y 111 ) and (x 121 ,y 121 ) as an example, determine the area A corresponding to the lowest position 111 The area A corresponding to the second position 12 whether the first ratio value 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 )] and the contour information corresponding to the second position [(x 121 ,y 121 ),(x 122 ,y 122 ),…,(x 12p ,y 12p )], and calculate the ratio of the intersection area and the union area to obtain a third ratio, and then determine whether the third ratio is less than the second set intersection-union ratio. If the above comparison conditions are met, the lowest position (x 111 ,y 111 ) relative to the second position (x 121 ,y 121 ) has moved. Then, compare the lowest position (x 111 ,y 111 ) and the second position (x 131 ,y 131 ), if the above comparison conditions are also met, the lowest position of ID1 can be determined as the suspected leak position. By judging the movement of bubbles and skipping the detection of non-leakage positions, the time of bubble detection can be saved and the efficiency of bubble detection can be improved.
[0096] In the embodiment of the present application, in step 204, the first attribute information corresponding to the suspected leak position may be matched with the attribute information corresponding to the second identification information, where the second identification information is identification information other than the first identification information in the first mapping library. If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leak position is determined to be the actual leak position of the device under test.
[0097] Due to the complexity of bubble floating trajectories, if a fast-floating bubble appears at a certain leakage position, it may interfere with the trajectory tracking of bubbles corresponding to other identification information. Therefore, the position determined by the embodiment of the present application based on the lowest position in the trajectory where the moving bubble is located is not necessarily the actual leakage position. Therefore, further judgment of the suspected leakage position is required. In the embodiment of the present application, the first attribute information of the suspected leakage position is matched with the attribute information corresponding to the second identification information other than the first identification information in the first mapping library. When the attribute information corresponding to the second identification information is not matched, it indicates that the suspected leakage position is the actual leakage position. If the attribute information corresponding to the second identification information is matched, it means that the suspected leakage position is not the actual leakage position, but is caused by the interference of the floating of the bubble corresponding to the matched second identification information. In one example, the matching of the first attribute information and the attribute information of the second identification information can refer to the matching method in the above step 303. 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 means that there is attribute information of the second identification information that matches the first attribute information. Then, 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 bubbles of other identification information. Therefore, the suspected leakage position is not the actual leakage position.
[0098] Still taking the first mapping library shown in Table 1 as an example, assuming that (x 111 ,y 111 ) is the suspected leak location. At this time, you need to 111 ,y 111 ) is compared with the attribute information in ID2 and ID3 in turn, that is, (x 111 ,y 111 ) and (x 211 ,y 211 )、(x 221 ,y 221 ) and (x 311 ,y 311 ) are compared in turn. By judging (x 111 ,y 111 ) and (x 211 ,y 211 )、(x 221 ,y 221 ) and (x 311 ,y 311 ) meets the preset conditions, and A 11 With A 21 , A 22 and A 21Whether the area ratio between the two meets the set ratio range is used to determine whether the suspected leak position of ID1 matches the attribute information of non-ID1, thereby determining whether the suspected leak position of ID1 is the actual leak position. The accuracy of leak position detection is further improved through secondary judgment of the leak position.
[0099] Based on the same inventive concept, the embodiment of the present application also provides a gas leakage detection device for implementing the above-mentioned equipment. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of the gas leakage detection device for one or more devices provided below can refer to the limitations of the gas leakage detection method for the device above, and the specific limitations will not be repeated here.
[0100] Figure 5 This is a schematic diagram of the structure of a gas leakage detection device of a device provided in an embodiment of the present application. Figure 5 As shown, the embodiment of the present application provides a gas leakage detection device for a device, which can be integrated in Figure 1 In the electronic device 100 shown, the air leakage detection device may include an acquisition module 501, a tracking module 502 and a determination module 503. The acquisition module 501 is used to acquire at least two frames of target images, the target images including images of bubbles generated when the device under test is immersed in a liquid. The tracking module 502 is used to determine the trajectory of each bubble generated according to the target image. The determination module 503 is used to determine the suspected air leakage position of the device under test according to the trajectory of each bubble, the suspected air leakage position being the lowest position in the trajectory of the moving bubble, and to determine the actual air leakage position of the device under test according to the suspected air leakage position.
[0101] The acquisition module 501, tracking module 502 and determination module 503 may respectively execute steps 201-204 in the above method embodiment. For a detailed introduction of these modules, please refer to the introduction of the corresponding steps of 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 the present application. Figure 6 As shown, an embodiment of the present application further provides an electronic device, in which a gas leakage detection device is integrated to run a computer-readable storage medium corresponding to the gas leakage detection method to perform the steps of the gas leakage detection method, including:
[0103] Memory 601, configured to store instructions; and
[0104] The processor 602 is configured to call instructions from the memory 601 and implement the above-mentioned gas leakage detection method of the device when executing the instructions.
[0105] Based on the same inventive concept, an embodiment of the present application further provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the gas leakage detection method of the above-mentioned device.
[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 the present application, the beneficial effects that can be achieved by the leakage detection method of any device provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions 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] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0113] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0114] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0115] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for detecting air leakage of equipment, characterized in that: include: Acquire at least two frames of target images, wherein the target images include images of the device under test immersed in liquid and generating bubbles; Determining the trajectory of each bubble generated according to the target image; Determine a suspected leak position of the device under test according to the trajectory of each bubble, wherein the suspected leak position is the lowest position in the trajectory of the moving bubble; The actual leakage position of the device under test is determined according to the suspected leakage position.
2. The air leakage detection method according to claim 1, characterized in that: Determining the trajectory of each bubble generated according to the target image includes: Segmenting the target image into a plurality of detection areas; Performing bubble detection on each of the detection areas to obtain position information of the bubbles in the corresponding detection area; The position information of the bubbles in the corresponding detection area is mapped to the target image to obtain the trajectory of each bubble.
3. The air leakage detection method according to claim 1, characterized in that: Determining the trajectory of each bubble generated according to the target image includes: Determining a first image frame in the target image; For each first bubble in the first image frame, determine a first mapping library, the first mapping library including identification information of the first bubble and corresponding attribute information, the identification information of the first bubble, the attribute information, and the first bubble being in one-to-one correspondence; Matching a second bubble of a second image frame with a first bubble in the first mapping library, wherein the second image frame is an image frame of the at least two target image frames except the first image frame; 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.
4. The air leakage detection method according to claim 3, characterized in that: Determining the trajectory of each bubble generated according to the target image also includes: If the second bubble does not match the first bubble, the identification information and corresponding attribute information of the second bubble are added to the first mapping library.
5. The air leakage detection method according to claim 3, characterized in that: After the second bubble is matched to the first bubble, before the attribute information of the second bubble is mapped to the identification information of the matched first bubble, comprising: It is determined that a first intersection-over-union ratio of the matched first bubble and the second bubble is less than or equal to a first set intersection-over-union ratio.
6. The air leakage detection method according to claim 3, characterized in that: The matching of the second bubble of the second image frame with the first bubble in the first mapping library comprises: If the position information of the second bubble and the position information of the first bubble meet a preset condition, and the area ratio 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, and the preset condition is that the position of the second bubble is within a preset range centered on the position of the first bubble.
7. The air leakage detection method according to claim 3, characterized in that: The attribute information includes contour information and position information of the bubble, and the position information is a preset position in the contour; The step of determining the suspected leak position of the device under test according to the trajectory of each bubble includes: Determine a lowest position in the attribute information corresponding to the first identification information in the first mapping library, the first identification information is any identification 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 an area corresponding to the lowest position to an area corresponding to the second position, and / or determine a second ratio of a width and height corresponding to the lowest position to a width and height corresponding to the second position; and / or determine a first area of an intersection of a contour corresponding to the lowest position and a contour corresponding to the second position, a second area of a union of a contour corresponding to the lowest position and a contour corresponding to the second position, and a third ratio of the first area to the second area, wherein the second position is a 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 aspect ratio, and / or the third ratio is less than the second set intersection-and-joint ratio, the lowest position is determined as the suspected leakage position.
8. The air leakage detection method according to claim 7, characterized in that: The step of determining the actual leakage position of the device under test according to the suspected leakage position includes: Matching the first attribute information corresponding to the suspected leak position with the attribute information corresponding to the second identification information, where the second identification information is the identification information in the first mapping library except the first identification information; If the first attribute information does not match the attribute information corresponding to the second identification information, the suspected leakage position is determined as the actual leakage position of the device under test.
9. A gas leakage detection device for equipment, characterized in that: include: An acquisition module, used to acquire at least two frames of target images, wherein the target images include images of the device under test immersed in liquid and generating bubbles; A tracking module, used for determining the trajectory of each bubble generated according to the target image; The determination module is used to determine the suspected leakage position of the device under test according to the trajectory of each bubble, wherein the suspected leakage position is the lowest position in the trajectory of the moving bubble; and determine the actual leakage position of the device under test according to the suspected leakage position.
10. An electronic device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the gas leakage detection method of the device according to any one of claims 1 to 8 when executing the instructions.
11. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which, when executed by a processor, enable the processor to be configured to execute the gas leakage detection method of the device according to any one of claims 1 to 8.
Citation Information
Patent Citations
Multi-workpiece scene airtightness detection method and system based on artificial intelligence
CN112304512A
Method and device for detecting leakage position of endoscope hose
CN115661103A
Inspection system and inspection method
CN117897603A
Detecting bubbles in images of a sample in wells of a well plate
US20230386010A1
Target tracking method and apparatus, electronic device, and storage medium
WO2022142417A1
Cited By
Airtightness detection method, device and system for closed container
CN119147169A
Airtightness detection method, device and system for sealed container
CN119147169B
Coil pipe air tightness detection method and system, storage medium and intelligent terminal
CN119714736A
Gas tightness detection device for gas meter
CN120558482A
