Method, apparatus and storage medium for detecting a level of a bottled liquid

By converting X-ray signals into target images and performing differential calculations, the liquid level segments of bottled liquids can be accurately identified. This solves the problems of bottle head positioning dependence and errors caused by liquid level sloshing in existing technologies, and achieves efficient and accurate liquid level detection.

CN119941609BActive Publication Date: 2026-07-21HONESORT TECHNOLOGY (ZHEJIANG) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONESORT TECHNOLOGY (ZHEJIANG) CO LTD
Filing Date
2024-09-27
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing liquid level detection methods rely on accurately identifying the bottle head position as a benchmark, ignoring the height differences between different bottles. This leads to the need for manual parameter adjustment during the detection process, reducing the flexibility and versatility of automated processing. Furthermore, liquid level sloshing introduces measurement errors, making it difficult to meet the requirements of high-precision detection.

Method used

By acquiring X-ray signals of bottled liquid, converting them into target images, extracting pixels along the longitudinal midline, performing differential calculations to determine the liquid level segment with the greatest pixel value variation, accurately identifying the upper and lower edge points of the liquid level segment, utilizing the penetrability of X-rays to identify the liquid level region, and determining the liquid level position by averaging multiple edge points.

Benefits of technology

It enables efficient and accurate identification of bottled liquid level, reduces error accumulation, improves detection accuracy and the flexibility of automated processing, and adapts to the detection needs of different bottles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941609B_ABST
    Figure CN119941609B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and storage medium for detecting the liquid level of bottled liquid. The method comprises the following steps: collecting a radiation signal of the bottled liquid, and converting the radiation signal into a target image; extracting a pixel point on a longitudinal center line of the bottled liquid based on the target image; performing differential calculation on the pixel point on the longitudinal center line to determine a liquid level segment with the largest pixel value change; determining a first upper edge point and a first lower edge point of the liquid level segment; and determining a liquid level position according to the first upper edge point and the first lower edge point to identify the liquid level height, so as to realize the detection of the liquid level of the bottled liquid. According to the scheme, the liquid level height of the bottled liquid can be efficiently and accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application generally relates to the field of liquid level detection technology. More specifically, this application relates to a method, apparatus, and computer-readable storage medium for detecting the liquid level of bottled liquids. Background Technology

[0002] In the production of bottled water, beverages, pharmaceuticals, and other liquid products, liquid level control is a crucial step in ensuring product quality. Traditional manual inspection methods are not only inefficient but also struggle to guarantee accuracy and consistency. With the development of automation and intelligent technologies, image-based inspection methods are gaining increasing attention. However, existing image inspection technologies are susceptible to various factors such as lighting conditions, bottle shape, and liquid color, which may lead to insufficient accuracy and stability.

[0003] Currently, while methods exist to improve the accuracy of image detection technology—for example, by thresholding the acquired image to obtain a binary image, and then determining a reference position vertically from the top of the bottle and horizontally from both sides of the bottle—a reference point and a liquid level search area are determined based on these reference positions. The target and background within the liquid level search area are then projected vertically downwards to find the lowest liquid level. Furthermore, the difference between the reference point and the lowest liquid level is used to determine if the liquid level meets the requirements. However, this method relies on accurately identifying the bottle head position as the reference position. The accuracy of this step directly determines the accuracy of the subsequent downward movement. If the bottle head positioning is incorrect, the entire process may fall into a trap of error accumulation. By determining the subsequent reference point and liquid level search area based on this fixed bottle head position, the height differences between different bottles are ignored. This necessitates manual adjustment of distance parameters for each type of bottle during the detection process, reducing the flexibility and versatility of automated processing. Furthermore, the aforementioned method relies on the first maximum pixel (lower edge liquid level) on the center line of the region when determining the liquid level search area. However, in actual liquid level detection, the liquid level in the bottle changes dynamically due to movement. Even slight fluctuations in the liquid level can cause significant changes at the edge of the detection area, introducing measurement errors and making it difficult to meet the current requirements for high-precision detection.

[0004] In view of this, there is an urgent need to provide a solution for detecting the liquid level of bottled liquids in order to efficiently and accurately identify the liquid level height of bottled liquids. Summary of the Invention

[0005] In order to at least solve one or more of the technical problems mentioned above, this application proposes a scheme for detecting the liquid level of bottled liquids in several aspects.

[0006] In a first aspect, this application provides a method for detecting the level of bottled liquid, comprising: acquiring a ray signal of the bottled liquid and converting the ray signal into a target image; extracting pixels on the longitudinal midline of the bottled liquid based on the target image; performing differential calculation on the pixels on the longitudinal midline to determine the liquid level segment with the largest pixel value change; determining a first upper edge point and a first lower edge point of the liquid level segment; and determining the liquid level position based on the first upper edge point and the first lower edge point to identify the liquid level height, thereby realizing the detection of the bottled liquid level.

[0007] In some embodiments, extracting pixels on the longitudinal midline of the bottled liquid based on the target image includes: binarizing the target image to obtain a binarized image; extracting the circumscribed rectangle of the bottled liquid in the binarized image; and extracting pixels on the longitudinal midline of the bottled liquid based on the longitudinal midline of the circumscribed rectangle.

[0008] In other embodiments, performing differential calculations on the pixels along the longitudinal centerline to determine the liquid level segment with the largest pixel value change includes: performing differential calculations on the pixels along the longitudinal centerline to obtain a target segment with a continuously monotonically changing pixel value; and filtering the target segment to determine the liquid level segment with the largest pixel value change.

[0009] In some other embodiments, performing differential calculations on the pixels along the vertical centerline to obtain a target segment with continuously monotonically changing pixel values ​​includes: calculating a first value before the differential calculation and a second value after the differential calculation for the pixels along the vertical centerline; determining a differential value based on the first value and the second value; and obtaining the target segment with continuously monotonically changing pixel values ​​based on the differential value.

[0010] In some other embodiments, before performing differential calculations on the pixels along the longitudinal centerline to determine the liquid level segment with the largest pixel value change, the method further includes performing a median filtering operation on the pixels along the longitudinal centerline.

[0011] In some other embodiments, the first upper edge point and the first lower edge point of the liquid level segment are determined by: obtaining the positions of the minimum and maximum pixel values ​​in the liquid level segment to determine the first upper edge point and the first lower edge point of the liquid level segment accordingly.

[0012] In some other embodiments, determining the liquid level position based on the first upper edge point and the first lower edge point to identify the liquid level height, thereby detecting the bottled liquid level, includes: calculating the midpoint between the first upper edge point and the first lower edge point to determine the liquid level position; and identifying the liquid level height based on the height between the liquid level position and a reference position to detect the bottled liquid level.

[0013] In some other embodiments, the method further includes: determining a liquid region by the intersection of a horizontal line drawn based on the ordinates of the first upper edge point and the first lower edge point with the circumscribed rectangle of the liquid segment; narrowing the liquid region along a transverse midline; extracting multiple new liquid level segments in the longitudinal direction within the narrowed liquid region to determine multiple second upper edge points and multiple second lower edge points; and calculating the longitudinal mean of the multiple second upper edge points and multiple second lower edge points to determine the liquid level position and identify the liquid level height.

[0014] In a second aspect, this application provides an apparatus for detecting the level of a bottled liquid, comprising: a processor; and a memory storing program instructions for detecting the level of a bottled liquid, wherein when the program instructions are executed by the processor, the apparatus implements one or more embodiments of the first aspect described above.

[0015] In a third aspect, this application provides a computer-readable storage medium storing computer-readable instructions for detecting the level of a bottled liquid, which, when executed by one or more processors, implement one or more embodiments of the first aspect described above.

[0016] Using the above-described scheme for detecting the liquid level of bottled liquids, this embodiment of the application utilizes the penetrability of X-rays to accurately identify the liquid level region. The X-ray signal is converted into a target grayscale image, and pixels along the vertical centerline of the bottled liquid are extracted from the target image. Next, differential calculation is performed on the pixels along the vertical centerline, which accurately identifies changes in pixel values. By identifying the segment with the largest pixel value change as the liquid level segment, the first upper edge and first lower edge of the liquid level segment can be precisely located, thereby efficiently and accurately identifying the liquid level height of the bottled liquid and achieving liquid level detection. Furthermore, this embodiment of the application can also extract multiple second upper edge points and second lower edge points, and determine the liquid level position based on the vertical average of the second upper edge points and second lower edge points, thereby more accurately locating the liquid level position and obtaining a more precise liquid level height. Attached Figure Description

[0017] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily understood by reading the following detailed description with reference to the accompanying drawings. In the drawings, several embodiments of this application are illustrated by way of example and not limitation, and the same or corresponding reference numerals denote the same or corresponding parts, wherein:

[0018] Figure 1 This is an exemplary schematic diagram illustrating existing liquid level detection methods;

[0019] Figure 2 This is an exemplary schematic diagram illustrating the acquisition of X-ray signals of bottled liquids according to an embodiment of this application;

[0020] Figure 3 This is an exemplary flowchart illustrating a method for detecting the liquid level of a bottled liquid according to an embodiment of this application;

[0021] Figure 4 This is an exemplary schematic diagram showing a target image of a bottled liquid according to an embodiment of this application;

[0022] Figure 5 This is an exemplary schematic diagram showing a binarized image of a bottled liquid according to an embodiment of this application;

[0023] Figure 6 This is an exemplary schematic diagram illustrating the distribution of pixels along the vertical centerline according to an embodiment of this application;

[0024] Figure 7 This is an exemplary schematic diagram illustrating the identification of liquid level height according to an embodiment of this application;

[0025] Figure 8 This is yet another exemplary schematic diagram illustrating the identification of liquid level height according to an embodiment of this application;

[0026] Figure 9 This is an exemplary schematic diagram illustrating the segmented liquid level position according to an embodiment of this application;

[0027] Figure 10 This is an exemplary structural block diagram illustrating a device for detecting the liquid level of bottled liquid according to an embodiment of this application. Detailed Implementation

[0028] 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, not all, of the embodiments of this application. 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.

[0029] It should be understood that the terms "comprising" and "including" used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0030] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0031] As used in this specification and claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0032] Figure 1 This is an exemplary schematic diagram illustrating existing liquid level detection methods. (Example:) Figure 1 As shown, existing liquid level detection methods use the top of the bottle head as a reference position G. Based on this reference position G, a reference point and a liquid level search area are determined, and the target and background within the liquid level search area are projected vertically, searching from top to bottom to find the lowest liquid level position Q. As an example, suppose the figure shows, from left to right, bottled liquid in a stationary state, bottled liquid in a state of left-right swaying, and bottled liquid in a state of back-and-forth swaying. It can be seen from the figure that the arc of the liquid surface in the stationary state is relatively symmetrical; the liquid surface of the bottled liquid in the state of left-right swaying is lower on the left and higher on the right; the liquid surface area of ​​the bottled liquid in the state of back-and-forth swaying is wider. In this scenario, using existing liquid level detection methods, which only measure the lowest point position (i.e., the lower edge liquid level) Q at the center line, will result in deviation and inaccurate measurement.

[0033] As described in the background section above, existing methods still rely on accurately identifying the bottle head position as a reference position, ignoring the height differences between different bottles. This necessitates manual adjustment of distance parameters for each type of bottle during the detection process, reducing the flexibility and versatility of automated processing. Furthermore, if the bottle head positioning is incorrect, it can lead to the accumulation of errors in liquid level detection, reducing the accuracy of liquid level detection.

[0034] Based on this, this application provides a scheme for detecting the liquid level of bottled liquids. By utilizing the penetrability of rays, the liquid level area is accurately identified, and by performing differential calculations on the pixels on the longitudinal centerline, the liquid level segment with the largest monotonic change in pixel value is determined, thereby accurately determining the upper and lower edge points, thus efficiently and accurately identifying the liquid level height of bottled liquids.

[0035] The specific embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0036] Figure 2 This is an exemplary schematic diagram illustrating the acquisition of X-ray signals from bottled liquids according to an embodiment of this application. Figure 2 As shown in the diagram, point O represents a radiation source (e.g., X-rays, gamma rays, etc.), the middle rectangle 201 represents the bottled liquid to be detected, and the right rectangle 202 represents the radiation detector. In actual liquid level detection scenarios, the distance from the center of the bottled liquid to the radiation source and the radiation detector remains constant, and the distance between the radiation source and the radiation detector is also fixed. In this scenario, when the radiation source at point O emits radiation, it passes through points A and B of the liquid level and projects onto points C and D of the radiation detector. Thus, the radiation signal of the bottled liquid can be acquired. It can be understood that the thicker the liquid, the smaller the grayscale value (i.e., the darker the brightness) after radiation acquisition and imaging; the thinner the liquid, the larger the grayscale value (i.e., the brighter the brightness) after radiation acquisition and imaging. As an example, assuming that the projected brightness of liquid level A in the diagram is the brightest and the projected brightness of liquid level B is the darkest, they correspond to the upper and lower edges of the liquid level, respectively. In some embodiments, at least the midpoint between the upper and lower edges can be used as the liquid level position, which, after projection, corresponds to the midpoint of CD. Let h be the height from the midpoint of CD to the top of the X-ray detector, then h is the relative value of the liquid level. As the liquid level decreases, h increases. In the embodiments of this application, the aforementioned liquid level position can be determined to achieve the detection of the bottled liquid level.

[0037] Figure 3 This is an exemplary flowchart illustrating a method 300 for detecting the level of a bottled liquid according to an embodiment of this application. Figure 3 As shown, in step S301, the X-ray signal of the bottled liquid is acquired and converted into a target image. In some embodiments, reference can be made to the above. Figure 2The X-ray signal of the bottled liquid is acquired. Based on the acquired X-ray signal, a target grayscale image reflecting the internal structure of the bottled liquid can be generated by mapping it to grayscale levels (e.g., ...). Figure 4 (As shown). After obtaining the target image, in step S302, pixels on the vertical centerline of the bottled liquid are extracted based on the target image. In some embodiments, the target image can first be binarized to obtain a binarized image, and then the bounding rectangle of the bottled liquid in the binarized image can be extracted to extract pixels on the vertical centerline of the bottled liquid based on the vertical centerline of the bounding rectangle. This will be discussed later in conjunction with... Figures 5-6 Describe in detail the pixels along the vertical center line of the extracted bottled liquid.

[0038] Next, in step S303, differential calculation is performed on the pixels along the vertical centerline to determine the liquid level segment with the largest pixel value change. In some embodiments, before performing differential calculation on the pixels along the vertical centerline to determine the liquid level segment with the largest pixel value change, median filtering can be performed on the pixels along the vertical centerline to remove image noise and improve the accuracy of subsequent calculations. For determining the liquid level segment with the largest pixel value change, in some embodiments, differential calculation can be performed on the pixels along the vertical centerline to obtain target segments with continuously monotonically changing pixel values, and then these target segments can be filtered to determine the liquid level segment with the largest pixel value change.

[0039] As mentioned earlier, the thicker the liquid, the smaller the grayscale value (i.e., the darker) after X-ray imaging; conversely, the thinner the liquid, the larger the grayscale value (i.e., the brighter) after X-ray imaging. Therefore, the grayscale value is higher in the liquid level region closer to the air, and lower in the liquid level region where the liquid is at its thickest point. Based on this, the embodiments of this application use differential calculation to determine the segment with the largest monotonic change in grayscale, which can accurately identify the liquid level region.

[0040] Specifically, in some embodiments, firstly, a first value before difference and a second value after difference are calculated for each pixel on the vertical centerline. Then, a difference value is determined based on the first and second values ​​to obtain a target segment with continuously monotonically changing pixel values. As an example, the first value before difference for each pixel on the aforementioned vertical centerline can be denoted as [p0, p1, p2, ..., pn], and the second value after difference can be denoted as [p1-p0, p2-p1, ..., pn-pn-1]. Next, the target segment with continuously monotonically changing pixel values ​​is extracted based on the magnitude of the difference value. Based on the target segments with continuously monotonically changing pixel values, the liquid level segment with the largest change in pixel value is selected.

[0041] Further, in step S304, the first upper edge point and the first lower edge point of the liquid level segment are determined. In some embodiments, the first upper edge point and the first lower edge point of the liquid level segment can be determined by obtaining the positions corresponding to the minimum and maximum pixel values ​​in the liquid level segment. In some embodiments, the grayscale distribution map of the pixels along the vertical center line (e.g., Figure 6 (As shown) to determine the positions of the minimum and maximum pixel values, and then determine the first upper edge point and the first lower edge point accordingly.

[0042] After obtaining the first upper edge point and the first lower edge point, in step S305, the liquid level position is determined based on the first upper edge point and the first lower edge point to identify the liquid level height, thereby detecting the bottled liquid level. In some embodiments, the liquid level position is determined by calculating the midpoint between the first upper edge point and the first lower edge point, and the liquid level height is identified based on the height between the liquid level position and the reference position, thereby detecting the bottled liquid level. In some implementation scenarios, the aforementioned reference position is the top of the X-ray detector. That is, the liquid level height is the height between the liquid level point and the top of the X-ray detector (e.g., the height between the liquid level point and the top of the X-ray detector). Figure 7 The height H1 is shown.

[0043] As described above, this embodiment of the application utilizes the penetrability of X-rays to accurately identify liquid level regions. By converting the X-ray signal into a target grayscale image, pixels along the vertical centerline of the bottled liquid are extracted from the target image. Next, differential calculations are performed on the pixels along the vertical centerline to accurately identify the liquid level segment with the largest pixel value variation. This allows for precise determination of the first upper and lower edge points of the liquid level segment, enabling efficient and accurate identification of the bottled liquid level height and achieving liquid level detection. In some implementation scenarios, the identified liquid level height is compared with a calibrated height threshold. If the identified liquid level height meets the calibrated height threshold, the liquid level is considered to meet the standard. Conversely, if it does not meet the threshold, the liquid level is considered not to meet the standard.

[0044] In some embodiments, the present application can further determine the liquid region based on the intersection of the horizontal line drawn from the ordinates of the first upper edge point and the first lower edge point with the circumscribed rectangle of the liquid segment, and then limit the liquid region along the horizontal centerline. Multiple new liquid level segments are extracted vertically within the limited liquid region to determine multiple second upper edge points and multiple second lower edge points. The liquid level position is determined by calculating the vertical average of the multiple second upper edge points and second lower edge points to identify the liquid level height. In some embodiments, the liquid region can be limited to three-quarters of the original liquid region along the horizontal centerline. That is, multiple new liquid level segments are extracted on both sides of the vertical centerline within the limited liquid region, and the upper and lower edge points of each new liquid level segment are obtained. The average of the upper and lower edge points of each new liquid level segment corresponds to the liquid level position. In some implementation scenarios, the determination of the upper and lower edge points (i.e., the second upper edge point and the second lower edge point) of the aforementioned new liquid level segments can refer to the above-described determination operation of the first upper edge point and the first lower edge point.

[0045] That is, in addition to determining one upper edge point and one lower edge point as described above, this embodiment of the application can also calculate multiple upper edge points and multiple lower edge points, and determine the liquid level position by the longitudinal average of multiple upper edge points and multiple lower edge points. Similarly, the height between the liquid level point and the top of the X-ray detector is the identified liquid level height. Based on this, determining the liquid level position by using edge points at multiple locations can effectively avoid deviations caused by shaking during the detection process, thereby more accurately locating the liquid level position and obtaining a more precise liquid level height.

[0046] Figure 4 This is an exemplary schematic diagram showing a target image of a bottled liquid according to an embodiment of this application. For example... Figure 4 The image shown is a target grayscale image converted from the X-ray signal acquired from the bottled liquid. In some embodiments, the target grayscale image can be obtained by mapping the X-ray signal onto grayscale levels.

[0047] Figure 5 This is an exemplary schematic diagram showing a binarized image of a bottled liquid according to an embodiment of this application. Figure 5 The image shown is a binarized image of the bottled liquid. In some embodiments, this binarized image is obtained by binarizing the target image. Next, the circumscribed rectangle 501 of the bottled liquid is extracted from the binarized image. Pixels along the vertical centerline L of the circumscribed rectangle are extracted.

[0048] Figure 6 This is an exemplary schematic diagram illustrating the pixel distribution along the vertical centerline according to an embodiment of this application. Figure 6As shown, the horizontal coordinates represent the positions of pixels along the vertical center line, and the vertical coordinates represent grayscale values. The horizontal coordinates, from left to right, correspond to the position from the top of the ray detector to the bottom of the bottle. In the implementation scenario, the distribution of pixels along the vertical center line can be determined by drawing the grayscale values ​​at different positions. As mentioned earlier, by performing differential calculations on the pixels along the vertical center line, the liquid level segment with the largest pixel value variation can be determined. Then, the positions corresponding to the minimum and maximum pixel values ​​in the liquid level segment are obtained to determine the first upper edge and first lower edge of the liquid level segment. For example, points a and b in the figure correspond to the first upper edge and first lower edge of the liquid level segment, respectively, and their corresponding positions in the target image are as follows: Figure 7 As shown in the image.

[0049] Figure 7 This is an exemplary schematic diagram illustrating the identification of liquid level height according to an embodiment of this application. Figure 7 The area circled by the ellipse in the target image shown is the liquid level region, where points a and b correspond to the first upper edge and first lower edge of the liquid level region, respectively. In some embodiments, the liquid level position (e.g., point M1 in the figure) is determined by calculating the midpoint between the first upper edge and the first lower edge. Further, the liquid level height, such as the liquid level height H1 shown in the figure, is identified based on this liquid level position M1 and a reference position (the top of the ray detector).

[0050] In some embodiments, this application can also determine the liquid level position by calculating multiple second upper edge points and multiple second lower edge points, and then identify the liquid level height by the longitudinal average of the multiple upper edge points and multiple lower edge points. The following will combine... Figure 8 The operation for identifying the liquid level height described above is described in detail.

[0051] Figure 8 This is yet another exemplary schematic diagram illustrating the identification of liquid level height according to an embodiment of this application. For example... Figure 8 As shown, horizontal lines l1 and l2 are drawn based on the ordinates of the first upper edge point a and the first lower edge point b. The liquid region is then narrowed along the horizontal midline to extract multiple new vertical liquid level segments within the narrowed liquid region, as shown by the four vertical lines within the liquid region in the figure. Similar to the first upper and lower edge points, the second upper and lower edge points of each new liquid level segment can be obtained, such as the second upper edge points s1, s2, s3, s4 and the second lower edge points s5, s6, s7, s8. Further, by calculating the average of all the second upper and lower edge points, the corresponding liquid level position can be obtained, for example, at the horizontal line segment l shown in the figure. The height between this liquid level position and the reference position (the top of the X-ray detector) is identified as the liquid level height, for example, the liquid level height H2 shown in the figure.

[0052] In some implementation scenarios, the target image can be input into a network model, such as a machine learning or deep learning model, to semantically segment the liquid level location. In some implementation scenarios, the liquid level target can first be identified using a target detection model. Based on the identified liquid level target, semantic segmentation can be performed using a model such as a semantic segmentation model to obtain the liquid level location. The upper and lower edges of the semantically segmented region are the upper and lower edges of the liquid level location.

[0053] Figure 9 This is an exemplary schematic diagram illustrating the segmented liquid level positions according to an embodiment of this application. For example... Figure 9 The image on the left shows a liquid level target recognition map obtained by using, for example, a target detection model, where the area within the rectangle represents the detected target region. Figure 9 The image on the right shows the liquid level position obtained after semantic segmentation. The liquid level height can then be determined by comparing this position with a reference position.

[0054] Figure 10 This is an exemplary structural block diagram illustrating a device 1000 for detecting the level of bottled liquid according to an embodiment of this application. Figure 10 As shown, the device 1000 of this application may include a processor 1001 and a memory 1002, wherein the processor 1001 and the memory 1002 communicate via a bus. The memory 1002 stores program instructions for detecting the level of bottled liquid. When the program instructions are executed by the processor 801, the method steps described above in conjunction with the accompanying drawings are implemented as follows: acquiring a ray signal of the bottled liquid and converting the ray signal into a target image; extracting pixels on the longitudinal centerline of the bottled liquid based on the target image; performing differential calculation on the pixels on the longitudinal centerline to determine the liquid level segment with the largest pixel value change; determining a first upper edge point and a first lower edge point of the liquid level segment; and identifying the liquid level height by determining the liquid level position based on the first upper edge point and the first lower edge point, thereby realizing the detection of the bottled liquid level.

[0055] Based on the foregoing description in conjunction with the accompanying drawings, those skilled in the art will understand that the embodiments of this application can also be implemented by software programs. Therefore, this application also provides a computer-readable storage medium. This computer-readable storage medium stores computer-readable instructions thereon for detecting the level of a bottled liquid. When these computer-readable instructions are executed by one or more processors, they implement the embodiments of this application in conjunction with the accompanying drawings. Figure 1 The method described is for detecting the level of bottled liquids.

[0056] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0057] It should be noted that although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0058] It should be understood that when the terms "first," "second," "third," and "fourth," etc., are used in the claims, specification, and drawings of this application, they are used only to distinguish different objects and not to describe a specific order. The terms "comprising" and "including" as used in the specification and claims of this application indicate the presence of the described features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0059] It should also be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this specification and claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.

[0060] Although the embodiments of this application are described above, the content is merely an example adopted for the purpose of facilitating understanding of this application and is not intended to limit the scope and application scenarios of this application. Any person skilled in the art described in this application may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed in this application, but the scope of patent protection of this application shall still be determined by the scope defined in the appended claims.

[0061] Furthermore, the collection and acquisition of various data in this application comply with relevant laws and regulations and are authorized by the data providers. Any organization or individual that needs to obtain external data shall obtain authorization in accordance with the law and ensure data security, and shall not illegally collect, use, process, or transmit unauthorized or unprotected data, nor shall it illegally buy, sell, provide, or disclose unauthorized or unprotected data.

Claims

1. A method for detecting the liquid level of bottled liquid, comprising: The X-ray signal of the bottled liquid is collected and converted into a target image. The X-ray signal is emitted by the X-ray source and passes through the gray-scale difference generated by the liquid level area with thickness variation in the bottled liquid to identify the target liquid point and project it onto the target point of the X-ray detector to obtain the image. Pixels along the vertical midline of the bottled liquid are extracted from the target image; Differential calculations are performed on the pixels along the longitudinal centerline to determine the liquid level segment with the largest pixel value change; Determine the first upper edge point and the first lower edge point of the liquid level segment; as well as The liquid level height is identified by determining the liquid level position based on the first upper edge point and the first lower edge point, thereby enabling the detection of bottled liquid levels. This also includes: The liquid region is determined by the intersection of the horizontal line drawn based on the ordinates of the first upper edge point and the first lower edge point with the circumscribed rectangle of the liquid segment. The liquid region is confined along the transverse centerline; Multiple new liquid level segments are extracted longitudinally within the confined liquid region to determine multiple second upper edge points and multiple second lower edge points; and The liquid level position is determined by calculating the longitudinal average of the plurality of second upper edge points and the plurality of second lower edge points, in order to identify the liquid level height. The first upper edge point and the first lower edge point of the liquid level segment are determined by the following operations: The positions corresponding to the minimum and maximum pixel values ​​in the liquid level segment are obtained to determine the first upper edge point and the first lower edge point of the liquid level segment.

2. The method according to claim 1, wherein extracting pixels along the longitudinal midline of the bottled liquid based on the target image comprises: The target image is binarized to obtain a binarized image; Extract the bounding rectangle of the bottled liquid from the binarized image; as well as Pixels on the vertical centerline of the bottled liquid are extracted based on the vertical centerline of the circumscribed rectangle.

3. The method according to claim 1, wherein performing differential calculation on the pixels along the longitudinal centerline to determine the liquid level segment with the largest pixel value change comprises: Differential calculations are performed on the pixels along the longitudinal centerline to obtain the target segment whose pixel values ​​change continuously and monotonically. as well as The target segments are filtered to determine the liquid level segment with the largest change in pixel value.

4. The method according to claim 3, wherein performing difference calculation on the pixels along the longitudinal centerline to obtain the target segment with continuously monotonically changing pixel values ​​includes: Calculate the first value before the difference and the second value after the difference for the pixels on the vertical center line respectively; The difference value is determined based on the first value and the second value; as well as The target segment whose pixel value changes continuously and monotonically is obtained based on the difference value.

5. The method according to claim 3 or 4, wherein before performing differential calculation on the pixels along the longitudinal centerline to determine the liquid level segment with the largest pixel value change, it further comprises: Median filtering is performed on the pixels along the vertical centerline.

6. The method according to claim 1, wherein determining the liquid level position based on the first upper edge point and the first lower edge point to identify the liquid level height, thereby detecting the liquid level of the bottled liquid, comprises: Calculate the midpoint between the first upper edge point and the first lower edge point to determine the liquid level position; as well as The liquid level is identified by the height between the liquid level position and the reference position, so as to realize the detection of the liquid level of bottled liquid.

7. A device for detecting the liquid level of bottled liquid, comprising: processor; as well as A memory storing program instructions for detecting the level of a bottled liquid, wherein when the program instructions are executed by the processor, the device performs the method according to any one of claims 1-6.

8. A computer-readable storage medium storing computer-readable instructions for detecting the level of a bottled liquid, wherein the computer-readable instructions, when executed by one or more processors, implement the method as described in any one of claims 1-6.