Liquid level data acquisition method and interface and computer readable storage medium

By acquiring detection images from level gauges to detect liquid levels and key points, the problem of low robustness of level gauge readings in complex environments is solved, achieving higher reading accuracy and applicability.

CN114549399BActive Publication Date: 2026-01-13ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111667098.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2026-01-13
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In the existing technology, level gauges have low robustness in reading under complex environments and it is difficult to directly output accurate reading results through images or video streams.

Method used

By acquiring detection images containing the visible area of ​​liquid, liquid surface detection and key point detection are performed, and liquid level data is calculated, reducing detection complexity and improving reading accuracy.

Benefits of technology

This reduces the complexity of level gauge detection and improves the accuracy and applicability of readings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114549399B_ABST
    Figure CN114549399B_ABST
Patent Text Reader

Abstract

The application discloses a liquid level data acquisition method and interface and a computer readable storage medium. The method comprises the following steps: acquiring a detection image containing a liquid visible area; performing liquid surface detection processing on the detection image; when a liquid surface object is detected in the detection image, performing key point detection processing on the detection image to obtain key point information of at least four key points, wherein the key point information contains pixel coordinates of the key points and corresponding key point types of the key points, and the key point types contain a starting point of the liquid visible area, an ending point of the liquid visible area, a left liquid surface point in the liquid visible area and a right liquid surface point in the liquid visible area; and calculating the liquid level data according to the key point information. The embodiment of the application reduces the complexity of detection, improves the applicability to liquid surface type metering devices, and improves the accuracy of readings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a liquid level data acquisition method, interface, and computer-readable storage medium. Background Technology

[0002] With the development of computer technology, intelligent technology is increasingly being applied in people's lives and work. In particular, in scenarios such as large factories where numerous instruments are installed to monitor the factory's operational status, manual reading of each instrument is usually required. For example, specialized measurement personnel need to walk to the location of each instrument and record the data by observing the readings.

[0003] For level gauges, since their readings are presented through the liquid level, the industry currently relies on manual reading or converting the readings into electrical signals. In particular, during operations such as power line inspections, there is a high demand for readings from various types of level gauges, all requiring direct output of the readings. However, obtaining highly robust and accurate readings is extremely difficult in diverse and complex real-world environments. Summary of the Invention

[0004] This application provides a liquid level data acquisition method, interface, and computer-readable storage medium to address the shortcomings of existing technologies in terms of low robustness in acquiring liquid level data under complex environments.

[0005] To achieve the above objectives, embodiments of this application provide a method for acquiring liquid level data, including:

[0006] Acquire a detection image containing the visible area of ​​liquid;

[0007] Liquid surface detection processing is performed on the detection image. When a liquid surface object is detected in the detection image, key point detection processing is performed on the detection image to obtain key point information of at least four key points. The key point information includes the pixel coordinates of the key points and their corresponding key point types. The key point types include: the start point and end point of the visible liquid area, the left side point of the liquid surface in the visible liquid area, and the right side point of the liquid surface. The start point is the point with the smallest coordinate value in the vertical axis direction in the visible liquid area, and the end point is the point with the largest coordinate value in the vertical axis direction in the visible liquid area.

[0008] The liquid level data is calculated based on the key point information.

[0009] This application embodiment also provides a liquid level data acquisition interface for acquiring liquid level data from a liquid level gauge, wherein the interface includes:

[0010] The parameter input area is used to display input controls to receive parameters input by the user for obtaining a detection image containing a visible liquid area;

[0011] The data display area is used to display the liquid level data;

[0012] An image display area is used to display the detection image and receive user feedback commands for the detection image. The image display area further displays at least four key points on the detection image. The types of key points include: the start point and end point of the visible liquid area, the left side point of the liquid surface in the visible liquid area, and the right side point of the liquid surface. The start point is the point with the smallest coordinate value in the vertical axis direction in the visible liquid area, and the end point is the point with the largest coordinate value in the vertical axis direction in the visible liquid area.

[0013] This application also provides an electronic device, including:

[0014] Memory, used to store programs;

[0015] A processor is configured to run the program stored in the memory, wherein the program executes the liquid level data acquisition method provided in the embodiments of this application.

[0016] This application also provides a computer-readable storage medium storing a computer program executable by a processor, wherein the program, when executed by the processor, implements the liquid level data acquisition method provided in this application.

[0017] The liquid level data acquisition method, interface, and computer-readable storage medium provided in this application acquire a detection image containing a visible liquid area, and perform liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this reduces the complexity of detection, improves the applicability to liquid surface-type metering devices, and enhances the accuracy of readings.

[0018] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0019] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0020] Figures 1a to 1c This is a schematic diagram illustrating an application scenario for the liquid level data acquisition scheme provided in the embodiments of this application.

[0021] Figure 2 A flowchart of an embodiment of the liquid level data acquisition method provided in this application;

[0022] Figure 3a A flowchart of another embodiment of the liquid level data acquisition method provided in this application;

[0023] Figure 3b A schematic diagram of an invalid detection image provided in an embodiment of this application;

[0024] Figure 4a A schematic diagram of the structure of an embodiment of the liquid level data acquisition device provided in this application;

[0025] Figure 4b A schematic diagram of the liquid level data acquisition interface provided in this application;

[0026] Figure 5 A schematic diagram of the structure of an embodiment of the electronic device provided in this application. Detailed Implementation

[0027] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0028] Example 1

[0029] The solutions provided in this application can be applied to any system with data processing capabilities, such as server systems including chips with data processing functions and related components. Figures 1a to 1c This is a schematic diagram illustrating an application scenario for the liquid level data acquisition scheme provided in the embodiments of this application. Figures 1a to 1c The scenario shown is merely an example of the applicability of the technical solution of this application.

[0030] In existing instrument reading technologies, for level-type instruments, the reading is presented through the liquid level. For example... Figures 1a to 1cIn the scenario depicted by the liquid level gauge, the gauge dial typically has a window. The shape of this window varies depending on the type of gauge; for example, it can be circular, square, irregularly shaped, etc. The liquid level is displayed in the window of the liquid level gauge, allowing workers or inspectors to observe the liquid level and determine the reading by corresponding to the scale on one or both sides of the liquid level.

[0031] Currently, the industry typically relies on manual reading or using equipment to convert the readings into electrical signals. However, in business operations such as power line inspection, there is a large demand for readings from various types of liquid level meters. Due to their complexity, these readings usually cannot be directly output as images or video streams. Therefore, a solution for acquiring liquid level meter readings that is applicable to multiple scenarios, provides accurate results, and has a short iteration cycle is needed.

[0032] Therefore, embodiments of this application propose a liquid level data acquisition scheme, such as... Figures 1a to 1c As shown, a detection image containing a visible area of ​​liquid can be obtained from a captured video or image. This detection image can be an image containing the entire dial. For example, Figure 1a The dial shown is circular, and has a circular window within the outer frame; Figure 1b The dial shown is rectangular, with an oblong window inside; Figure 1c The dial shown is rectangular, with a rectangular window. These windows are the liquid visible area, where the liquid level can be displayed. The liquid level data of the detected image is determined by the correspondence between the liquid level in the liquid visible area and the scale on one side of the window.

[0033] The liquid level data acquisition scheme proposed in this application extracts detection images containing visible liquid areas from videos or images acquired by liquid level instruments. For example, in this application embodiment, image frames can be extracted from video streams acquired by video acquisition devices such as cameras for a specified instrument based on an image decoding module. Specifically, in this application embodiment, the user can specify the time interval for extracting image frames. For example, the user can specify to extract one image frame every 1 minute, or one image frame every 10 seconds. The specified time interval can be based on the type of liquid level instrument or the data change. For example, a shorter time interval can be used to extract image frames for liquid level instruments with rapid liquid level changes, and a longer time interval can be used for liquid level instruments with slow liquid level changes, thereby ensuring that suitable image frames are extracted for subsequent liquid level data calculations. After extracting image frames at time intervals, the extracted image frames can be preprocessed, for example, by image quality filtering. In this application embodiment, the extracted image frames can be processed using a filtering module, such as a deep learning classification model. For example, the image features extracted from these image frames can be used in the filtering module to determine whether there are blurry or unclear problems in the image frames. In particular, it can determine whether the visible area of ​​the liquid is clear enough, or whether there are problems such as out-of-focus areas in the visible area of ​​the liquid. Image frames with these problems can be discarded without further calculation processing, thereby avoiding subsequent invalid results.

[0034] After filtering out low-quality image frames, the type of meter can be detected, and further filtering can be performed. For example, various deep learning models can be used to detect the type of the dial shown in the image frame, and image frames unsuitable for reading calculations can be further filtered out based on whether the detected dial size meets a size threshold requirement. For example, images with dials that are too small to clearly show the liquid surface can be filtered out. Therefore, this processing ultimately yields the type of meter and the coordinates of the detection box indicating the visible liquid area. For example, in... Figure 1a In the case of the visible liquid area of ​​the circular window shown, the detection frame can be a rectangular frame tangent to the outline of the circular window; in the case of... Figure 1b In the case of the visible liquid area of ​​the oblong window shown, the detection frame can be a rectangular frame surrounding the circular window; in the case of... Figure 1c In the case of the visible liquid area within the rectangular window shown, the detection frame can be a rectangular frame that surrounds the rectangular window. Of course, in this embodiment, other shapes can also be used, as long as the shape can surround the visible liquid area.

[0035] After obtaining the coordinates of the detection box, the liquid surface within the detection box can be detected. For example, the presence of a liquid surface object within the detection box can be checked first. In this process, a deep learning classification model can be used, for example, to determine the presence of a liquid surface object within the detection box based on image features extracted from the image frame.

[0036] When a liquid surface object is detected in the detection frame, that is, when the liquid surface is visible in the image frame, key point detection processing can be performed on the detected image to obtain key point information of at least four key points. In the embodiments of this application, the key points can be the start point, end point, left-side point of the liquid surface, and right-side point of the liquid surface in the visible liquid area. For example, the start point of the visible liquid area is the point with the smallest vertical coordinate in the visible liquid area, that is, the point at the bottom of the vertical axis of the visible liquid area. For example, in Figure 1a In the scenario shown, the starting point could be the point where the lower contour of the circular visible liquid area is tangent to the detection box; Figure 1b In the scenario shown, the starting point could be the point where the lower contour of the visible area of ​​the liquid is tangent to the detection box; Figure 1c In the scenario shown, the starting point can be any point on the lower contour of the visible liquid area. Similarly, the ending point of the visible liquid area is the point with the largest ordinate in the visible liquid area, that is, the point at the top of the vertical axis of the visible liquid area. For example, in Figure 1a In the scenario shown, the endpoint could be the point where the upper contour of the circular visible liquid area is tangent to the detection box; Figure 1b In the scenario shown, the endpoint could be the point where the upper contour of the visible area of ​​the liquid is tangent to the detection box; Figure 1c In the scenario shown, the endpoint can be any point on the upper contour of the visible liquid area. Furthermore, feature extraction can be used to determine the leftmost and rightmost points of the liquid surface within the visible liquid area. For example, in... Figures 1a to 1c In the scenario shown, the left point can be the point where the liquid surface intersects with the left outline of the visible liquid area, and the right point can be the point where the liquid surface intersects with the right outline of the visible liquid area.

[0037] Therefore, the coordinates of the four key points detected above can be further calculated within the visible liquid region. After obtaining the coordinates, the distribution relationship of these four key points within the visible liquid region can be calculated to verify the validity of the detection. For example, the y-axis coordinates of the liquid surface (i.e., the vertical axis coordinates of the liquid surface within the visible liquid region) can be calculated based on the coordinates of the left and right points of the liquid surface among the key points. This coordinate is then compared with the coordinates of the endpoint of the visible liquid region, i.e., the uppermost point of the visible liquid region. If the comparison result indicates that the vertical axis coordinates of the liquid surface are higher than the endpoint coordinates of the visible liquid region, it indicates that the detection of the left or right point of the liquid surface is incorrect, or that the endpoint of the visible liquid region is incorrect. In other words, the output of the key point detection process is unreasonable. Similarly, if the y-axis coordinates of the left and right points of the liquid surface differ too much based on the detected key point coordinates, for example, exceeding a certain threshold, it also indicates that the key point determination is unreasonable. Therefore, the coordinates of these four key points cannot be used for subsequent liquid level data calculations.

[0038] Conversely, if the coordinates of the key points are determined to be reasonable based on the above comparison, the coordinates of the midpoint of the liquid surface can be calculated based on the coordinates of the points on the left and right sides of the liquid surface, and the difference between the y-axis coordinates of the midpoint and the starting point or midpoint of the visible liquid area can be used as the reading value of the liquid surface, i.e., the liquid level data.

[0039] Furthermore, when the liquid surface is not detected in the aforementioned liquid surface object detection process—that is, when the liquid surface is not visible in the image frame, i.e., not visible in the visible liquid area—this could be due to the liquid in the dial being either at full scale or empty scale when the detection image was acquired. In other words, the liquid either fills the instrument or has fallen below the lowest contour plane of the visible liquid area. Therefore, in this case, further liquid object detection can be performed to confirm whether the invisible liquid surface indicates the liquid in the dial is at full scale or empty scale. For example, image features can be extracted from the detection image or the visible liquid area, and the presence of a liquid object in the visible liquid area can be determined based on the extracted features. If no liquid object is detected, it can be determined that the liquid surface is invisible, i.e., the state at the time of image acquisition was an empty scale. Conversely, if a liquid object is detected, it can be determined that the liquid surface is invisible, i.e., the state at the time of image acquisition was a full scale.

[0040] Therefore, this embodiment of the application can eliminate the need to determine the liquid surface object from the detection image. Instead, it can extract key points from the detection image and calculate the liquid level data based on the coordinates of these key points. Since the visible liquid area is typically a transparent window, while the surrounding dial area is metal or other opaque entities, determining the edge of the visible liquid area is not only simpler but also more accurate than calculating the same transparent liquid surface based on image features. Furthermore, it offers greater adaptability to different types of dials and visible liquid areas.

[0041] The liquid level data acquisition scheme provided in this application acquires a detection image containing a visible liquid area and performs liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this reduces the complexity of detection, improves the applicability to liquid surface type metering devices, and enhances the accuracy of readings.

[0042] The above embodiments illustrate the technical principles and exemplary application framework of the embodiments of this application. The specific technical solutions of the embodiments of this application will be further described in detail below through multiple embodiments.

[0043] Example 2

[0044] Figure 2 This is a flowchart of one embodiment of the liquid level data acquisition method provided in this application. The subject executing this method can be various terminals or server devices with data processing capabilities, or it can be a device or chip integrated into these devices. Figure 2 As shown, the liquid level data acquisition method includes the following steps:

[0045] S201, acquire a detection image containing the visible liquid area.

[0046] In step S201, a detection image including the visible liquid area can be acquired as the object for subsequent processing. For example, it can be acquired by extracting image frames from a video or image taken by a liquid-type instrument. Figures 1a to 1c The image shown contains a detection image with a visible liquid area. This detection image can be an image containing the entire dial, and the dial can have an area where the liquid can be seen from the outside, i.e., the visible liquid area. The liquid level data of the detection image is determined by the correspondence between the liquid level in the visible liquid area and the scale on one side of the window.

[0047] S202, perform liquid surface detection processing on the detection image. When a liquid surface object is detected in the detection image, perform key point detection processing on the detection image to obtain key point information of at least four key points.

[0048] In step S202, liquid surfaces in the detection image can be detected. This involves detecting whether a liquid surface object exists in the detection image. In this process, for example, a deep learning classification model can be used to determine whether a liquid surface object exists in the detection image based on image features extracted from the image frame.

[0049] When a liquid surface object is detected in the detection image, that is, when the liquid surface is visible in the detection image, key point detection processing can be further performed on the detection image in step S202 to obtain key point information of at least four key points.

[0050] In this embodiment, the key point information may include the pixel coordinates of the key points and their corresponding key point types, and the key point types include: the start point, the end point, the left side point of the liquid surface, and the right side point of the liquid surface within the visible liquid area. That is, in this embodiment, the key points detected in step S202 may be the start point, the end point, the left side point, and the right side point of the liquid surface within the visible liquid area. In other words, step S202 actually detects four points on the boundary of the visible liquid area of ​​the liquid surface-type device, namely, the highest point and the lowest point, and the two intersection points of the liquid surface on the boundary of the visible liquid area, namely, the left side point and the right side point. Therefore, in this embodiment, key points can be determined by detecting the visible liquid area and the inner frame edge of the dial in the detected image.

[0051] In this embodiment, the starting point of the visible liquid region can be the lowest point on the vertical axis of the visible liquid region. For example, the starting point could be... Figure 1a The point where the lower contour of the circular liquid visible area of ​​the dial shown is tangent to the detection frame surrounding that liquid visible area. Similarly, the endpoint of the liquid visible area could be the point at the top of the vertical axis of that liquid visible area. For example, in Figure 1a In the scenario shown, the endpoint could be the point where the upper contour of the circular visible liquid area is tangent to the detection box. Furthermore, feature extraction can be used to determine the leftmost and rightmost points of the liquid surface within the visible liquid area. For example, in... Figure 1a In the scenario shown, the left point can be the point where the liquid surface intersects with the left outline of the visible liquid area, and the right point can be the point where the liquid surface intersects with the right outline of the visible liquid area.

[0052] S203, calculates liquid level data based on key point information.

[0053] In step S203, liquid level data can be calculated based on the key points detected in step S202. In this embodiment, since the boundary of the visible liquid area has been determined by calculating the key points in step S202, and the intersection of the liquid surface on the left and right boundaries has also been determined, the total height of the visible liquid area can be determined in step S203 based on the vertex and bottom points of the visible liquid area, and the position of the liquid surface can be determined by the boundary points on the left and right sides of the liquid surface. Typically, the total height of the visible liquid area is also the total length of the scale on the liquid surface. Therefore, the liquid level data is determined by calculating the ratio of the distance between the liquid surface and the vertex or bottom point to the total height of the visible liquid area.

[0054] The liquid level data acquisition method provided in this application acquires a detection image containing a visible liquid area and performs liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this method reduces the complexity of detection, improves the applicability to liquid surface-type metering devices, and enhances the accuracy of readings.

[0055] Example 3

[0056] Figure 3a This is a flowchart of another embodiment of the data acquisition method for a level gauge provided in this application. The subject executing this method can be various terminals or server devices with data processing capabilities, or it can be a device or chip integrated into these devices. Figure 3a As shown above, in the above Figure 2 Based on the illustrated embodiment, the data acquisition method for the liquid level gauge provided in this application embodiment may include the following steps:

[0057] S301, acquire a detection image containing the visible area of ​​liquid.

[0058] In step S301, a detection image containing the visible liquid region is acquired. For example, in this step, at least one frame of the original image can be acquired first, and a third deep learning classification model can be used to perform image quality detection processing on the original image. Specifically, a detection image containing the visible liquid region can be extracted from the video or images acquired by the liquid level instrument. For example, in Figure 1aIn the instrument scenario shown, the liquid level instrument can have a circular dial with a circular window that displays the liquid inside. The window can be the visible liquid area of ​​the dial, and a scale can be set on the dial on one side of the window to determine the liquid level data based on the correspondence between the liquid level and the scale.

[0059] Therefore, in this embodiment, image frames can be extracted from the video stream acquired by a video acquisition device, such as a camera, for a specified instrument in step S301 based on, for example, an image decoding module. Specifically, in this embodiment, the user can specify the time interval for extracting image frames in step S301. For example, the user can specify that an image frame is extracted every minute, or that an image frame is extracted every 10 seconds.

[0060] The time interval used in step S301 can be set according to the type of liquid level instrument or the data change. For example, a shorter time interval can be used to extract image frames for liquid level instruments with rapid liquid level changes, while a longer time interval can be used for liquid level instruments with slow liquid level changes. This ensures that suitable image frames are extracted in step S301 for subsequent liquid level data calculation.

[0061] Furthermore, when extracting image frames at time intervals in step S301, the extracted image frames can be preprocessed. For example, image quality filtering can be performed. In this embodiment, the extracted image frames can be processed using a filtering module, such as a deep learning classification model. For example, the image features extracted from these image frames can be judged in the filtering module to determine whether there are blurry or unclear problems in the image frames extracted in step S301. In particular, it can be determined whether the visible liquid area is clear enough, or whether there are problems such as defocusing in the visible liquid area. Image frames with these problems can be discarded without further calculation processing, thereby avoiding subsequent invalid results.

[0062] After filtering out image frames with low image quality, step S301 can further perform meter type detection on the image frames, and then further filter the image frames. For example, various deep learning models can be used to detect the type of the dial shown in the image frames extracted in step S301, and image frames that are not suitable for reading calculation can be further filtered out based on whether the detected dial size meets the size threshold requirement.

[0063] For example, images with dial sizes that are too small to clearly see the liquid surface can be filtered out. Therefore, this processing ultimately yields the meter type and the coordinates of the detection frame marking the visible liquid area. For example, ... Figure 1a As shown, in such Figure 1a In the case of the visible liquid area within the circular window shown, the detection frame can be a rectangular frame tangent to the outline of the circular window. Of course, in the embodiments of this application, other shapes can also be adopted, as long as the shape can surround the visible liquid area.

[0064] In addition, step S301 can further perform shooting posture detection on the extracted image frames. For example, various deep learning models can be used to extract the dial features of the meter in the image frame, and the shooting subject corresponding to the extracted image frame, such as a camera or other device, can be determined based on the dial features to determine whether it has tilted or rotated during shooting, resulting in the meter in the image frame not being in a direct shooting angle. Therefore, in this case, the image frame can be adjusted according to the rotation angle of the meter in the extracted image frame relative to a pre-stored reference meter image. For example, the image frame or the meter area in the image frame can be rotated as a whole so that the meter in the rotated image frame is in a direct shooting position.

[0065] S302 uses a second deep learning classification model to perform liquid surface detection processing on the detection image.

[0066] After obtaining the coordinates of the detection box in step S301, the liquid surface within the detection box determined in step S301 can be detected in step S302. For example, it can be confirmed whether a liquid surface object exists in the detection box determined in step S301. In step S302, a deep learning classification model can be used to determine whether a liquid surface object exists in the detection box based on image features extracted from the image frame.

[0067] Alternatively, the detection image can be grayscaled to obtain a grayscale image, which can then be binarized. Based on the binarization result, the presence of a liquid surface in the detection image can be determined. Typically, for observing liquids, the visible area is made of a transparent material, while air usually lies above the liquid, and the refractive indices of air and liquid differ. However, due to their transparency, it is difficult to distinguish between liquid and air in the visible area by extracting image features in existing technologies. In this embodiment, the detection image can be grayscaled in step S302, for example, converted into objects with different grayscale values. In this case, the material of the visible liquid area and the liquid itself will have different grayscale values ​​due to their different refractive indices. Therefore, by binarizing the grayscale image, the presence of a boundary between the liquid and air, i.e., a liquid surface, can be determined by the changes in the binarized values.

[0068] S303, when a liquid surface object is detected in the detection image, key point detection processing is performed on the detection image to obtain key point information of at least four key points.

[0069] When a liquid surface is detected, meaning it is visible in the detected image, keypoint detection processing can be further performed on the detected image in step S303 to obtain keypoint information for at least four key points. Specifically, a pre-trained keypoint detection model can be used to perform keypoint detection processing on the detected image to obtain keypoint information for at least four key points.

[0070] In this embodiment, the key point information may include the pixel coordinates of the key points and their corresponding key point types, and the key point types include: the start point, the end point, the left side point of the liquid surface, and the right side point of the liquid surface within the visible liquid area. That is, in this embodiment, the key points detected in step S303 may be the start point, the end point, the left side point, and the right side point of the liquid surface within the visible liquid area. In other words, step S303 actually detects four points on the boundary of the visible liquid area of ​​the liquid surface-type device, namely, the highest point and the lowest point, and the two intersection points of the liquid surface on the boundary of the visible liquid area, namely, the left side point and the right side point. Therefore, in this embodiment, key points can be determined by detecting the visible liquid area and the inner frame edge of the dial in the detected image.

[0071] In this embodiment, the starting point of the visible liquid region can be the lowest point on the vertical axis of the visible liquid region. For example, the starting point could be... Figure 1aThe point where the lower contour of the circular liquid visible area of ​​the dial shown is tangent to the detection frame surrounding that liquid visible area. Similarly, the endpoint of the liquid visible area could be the point at the top of the vertical axis of that liquid visible area. For example, in Figure 1a In the scenario shown, the endpoint could be the point where the upper contour of the circular visible liquid area is tangent to the detection box. Furthermore, feature extraction can be used to determine the leftmost and rightmost points of the liquid surface within the visible liquid area. For example, in... Figure 1a In the scenario shown, the left point can be the point where the liquid surface intersects with the left outline of the visible liquid area, and the right point can be the point where the liquid surface intersects with the right outline of the visible liquid area.

[0072] S304. When no liquid surface object is detected in the detection image, the first deep learning classification model is used to perform liquid detection processing on the detection image.

[0073] S305, when no liquid object is detected in the detection image, the liquid level data is determined to be zero.

[0074] S306, When a liquid object is detected in the detection image, the liquid level data is determined to be a preset value.

[0075] Furthermore, if no liquid surface object is detected in step S302, that is, if it is determined that the liquid surface is not visible in the image frame (i.e., the liquid surface is not visible in the visible liquid area), this situation could be that the liquid in the dial was in a full-scale state or an empty-scale state when the detection image was acquired. That is, the liquid either fills the instrument or the liquid has already fallen below the lowest contour plane of the visible liquid area of ​​the instrument.

[0076] Therefore, in step S304, liquid object detection can be further performed to confirm whether the invisible liquid surface indicates that the liquid in the dial is at full scale or empty scale. For example, in step S305, image features can be extracted from the detection image or the visible liquid area, and the presence of a liquid object in the visible liquid area can be determined based on the extracted features. In step S305, if no liquid object is found, it can be determined that the liquid surface is invisible, i.e., the state when the detection image was acquired is that the liquid in the instrument is at empty scale. Therefore, in step S305, the liquid level data can be directly set to zero. Conversely, in step S306, if a liquid object is found in the detection image, it can be determined that the invisible liquid surface determined in step S304, i.e., the state when the detection image was acquired, is that the liquid in the dial is at full scale. Therefore, in step S306, the liquid level data can be directly set to, for example, the maximum value of the scale, thereby indicating that the reading of the liquid level instrument is at its maximum.

[0077] S307, obtain the pixel coordinates of the midpoint of the liquid surface based on the pixel coordinates of the left and right points of the liquid surface.

[0078] S308. Calculate the liquid level data based on the ratio of the projected distances of the midpoint of the liquid surface to the starting point and the ending point in the visible area of ​​the liquid surface along the vertical axis.

[0079] In steps S307 and S308, liquid level data can be calculated based on the key points detected in step S303. Specifically, in this embodiment, since the boundary of the visible liquid area has been determined by the calculated key points in step S303, and the intersection of the liquid surface on the left and right boundaries has also been determined, the total height of the visible liquid area can be determined in step S307 based on the vertex and bottom points of the visible liquid area, and the position of the liquid surface can be determined by the boundary points on the left and right sides of the liquid surface. Typically, the total height of the visible liquid area is also the total length of the scale on the liquid surface. Therefore, the liquid level data is determined by calculating the ratio of the distance between the liquid surface and the vertex or bottom point to the total height of the visible liquid area.

[0080] For example, based on the coordinates of the key points obtained in step S303, the distribution relationship of these four key points in the visible liquid area can be calculated first to verify whether the detection of these four key points is reasonable and effective. For example, the pixel coordinates of the left or right side of the liquid surface can be compared with the pixel coordinates of the endpoint of the visible liquid area. When the coordinate value of the left or right side of the liquid surface in the vertical axis direction is higher than the coordinate value of the endpoint in the vertical axis direction, that is, when the comparison result indicates that the coordinate of the liquid surface in the vertical axis is higher than the coordinate of the endpoint of the visible liquid area, it means that the detection of the left or right side of the liquid surface is incorrect, or the detection of the endpoint of the visible liquid area is incorrect. In other words, the output result of the above key point detection processing is unreasonable, therefore, the detected image is determined to be invalid. Similarly, if the projection distance between the left and right sides of the liquid surface in the vertical axis direction is greater than a preset threshold based on the coordinates of the detected key points, that is, the difference between the y-axis coordinates of the left and right sides of the liquid surface is too large, it can also be said that the determination of the key points is unreasonable, therefore, the coordinates of these four key points cannot be used for subsequent liquid level data calculation. Figure 3b This is a schematic diagram of an invalid detection image provided in an embodiment of this application. Figure 3b As shown in the example, the y-axis coordinate of the point on the left side of the page is significantly higher than the y-axis coordinate of the point on the right side of the page. Therefore, the detected image is determined to be invalid. For the invalid detected image, it and its corresponding keypoint information can be used as training data and input into the aforementioned keypoint detection model to iteratively train the model.

[0081] Conversely, if the coordinates of the key points are determined to be reasonable based on the above comparison, the reading value of the liquid level, i.e., the liquid level data, can be calculated based on the difference between the coordinates of the midpoint of the liquid surface calculated in step S307 and the y-axis coordinates of the start and end points of the visible liquid area.

[0082] The liquid level data acquisition method provided in this application acquires a detection image containing a visible liquid area and performs liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this method reduces the complexity of detection, improves the applicability to liquid surface-type metering devices, and enhances the accuracy of readings.

[0083] Example 4

[0084] Figure 4a This is a schematic diagram of an embodiment of the liquid level data acquisition device provided in this application, which can be used to perform... Figure 2 Or the liquid level data acquisition method shown in Figure 3. Figure 4a As shown, the liquid level data acquisition device may include: an acquisition module 41, a detection module 42, and a calculation module 43.

[0085] The acquisition module 41 can be used to acquire a detection image containing a visible area of ​​liquid.

[0086] The acquisition module 41 can acquire a detection image including a visible liquid area for subsequent processing. For example, a detection image including a visible liquid area, as shown in Figure 1, can be acquired by extracting image frames from a video or image taken for a liquid-type instrument. This detection image can be an image containing the entire dial, and the dial can have an area where the liquid can be seen from the outside, i.e., the visible liquid area. The liquid level data of the detection image is determined by the correspondence between the liquid level in the visible liquid area and the scale on one side of the window.

[0087] The acquisition module 41 can first acquire at least one frame of original image and then use a third deep learning classification model to perform image quality detection processing on the original image. Specifically, it can extract and acquire detection images containing the visible liquid area from videos or images acquired by the liquid level instrument. For example, in the instrument scenario shown in Figure 1, the liquid level instrument can have a circular dial with a circular window that displays the internal liquid. This window can be considered the visible liquid area of ​​the dial, and a scale can be set on the dial on one side of the window to determine the liquid level data based on the correspondence between the liquid level and the scale.

[0088] Therefore, in this embodiment, the acquisition module 41 can extract image frames from the video stream acquired by a video acquisition device, such as a camera, for a specified instrument based on, for example, an image decoding module. Specifically, in this embodiment, the user can specify the time interval for the acquisition module 41 to extract image frames. For example, the user can specify that an image frame is extracted every minute, or that an image frame is extracted every 10 seconds.

[0089] The time interval used by the acquisition module 41 can be set according to the type of liquid level instrument being acquired or the data change. For example, a shorter time interval can be used to extract image frames for liquid level instruments with rapid liquid level changes, while a longer time interval can be used for liquid level instruments with slow liquid level changes. This ensures that the acquisition module 41 extracts suitable image frames for subsequent liquid level data calculations.

[0090] Furthermore, when the acquisition module 41 extracts image frames at time intervals, it can preprocess the extracted image frames. For example, image quality filtering can be performed. In this embodiment, the extracted image frames can be processed using, for example, a deep learning classification model. For example, by judging the image features extracted from these image frames, it can be determined whether there are blurry or unclear problems in the image frames extracted by the acquisition module 41. In particular, it can be determined whether the visible liquid area is clear enough, or whether there are problems such as defocusing in the visible liquid area. Image frames with these problems can be discarded without further calculation processing, thereby avoiding subsequent invalid results.

[0091] After filtering out image frames with low image quality, the acquisition module 41 can also perform meter type detection on the image frames, and further filter the image frames. For example, various deep learning models can be used to detect the type of the dial shown in the image frames extracted by the acquisition module 41, and image frames that are not suitable for reading calculation can be further filtered out based on whether the detected dial size meets the size threshold requirement.

[0092] For example, images with dial sizes that are too small to clearly see the liquid surface can be filtered out. Therefore, this processing ultimately yields the meter type and the coordinates of the detection frame identifying the visible liquid area. For instance, as shown in Figure 1, in the case of a circular window with a visible liquid area, the detection frame can be a rectangle tangent to the outline of the circular window. Of course, in this embodiment, other shapes can also be used, as long as the shape can encompass the visible liquid area.

[0093] The detection module 42 can be used to perform liquid surface detection processing on the detection image. When a liquid surface object is detected in the detection image, key point detection processing is performed on the detection image to obtain key point information of at least four key points.

[0094] The detection module 42 can detect liquid surfaces in the detection image. It detects whether a liquid surface object exists in the detection image. In this process, for example, a deep learning classification model can be used to determine whether a liquid surface object exists in the detection image based on image features extracted from the image frame.

[0095] When a liquid surface object is detected in the detection image, that is, when the liquid surface is visible in the detection image, the detection module 42 can further perform key point detection processing on the detection image to obtain key point information of at least four key points.

[0096] In this embodiment, the key point information may include the pixel coordinates of the key points and their corresponding key point types, and the key point types include: the start point, the end point, the left side point, and the right side point of the liquid surface within the visible liquid area. That is, in this embodiment, the key points detected by the detection module 42 may be the start point, the end point, the left side point, and the right side point of the liquid surface within the visible liquid area. In other words, the detection module 42 actually detects four points on the boundary of the visible liquid area of ​​the liquid surface-type device, namely, the highest point and the lowest point, and the two intersection points of the liquid surface on the boundary of the visible liquid area, namely, the left side point and the right side point. Therefore, in this embodiment, key points can be determined by detecting the visible liquid area and the inner frame edge of the dial in the detection image.

[0097] In this embodiment, the starting point of the visible liquid area can be the lowest point on the vertical axis of the visible liquid area. For example, the starting point can be the point where the lower contour of the circular visible liquid area of ​​the dial shown in Figure 1 is tangent to the detection frame surrounding the visible liquid area. Similarly, the ending point of the visible liquid area can be the highest point on the vertical axis of the visible liquid area. For example, in the scenario shown in Figure 1, the ending point can be the point where the upper contour of the circular visible liquid area is tangent to the detection frame. Furthermore, the leftmost and rightmost points of the liquid surface within the visible liquid area can be determined through feature extraction. For example, in the scenario shown in Figure 1, the leftmost point can be the point where the liquid surface intersects with the left contour of the visible liquid area, and the rightmost point can be the point where the liquid surface intersects with the right contour of the visible liquid area.

[0098] Specifically, the detection module 42 can perform grayscale processing on the detection image to obtain a grayscale image, perform binarization processing on the grayscale image, and determine whether a liquid surface object exists in the detection image based on the binarization processing result. Since the visible area of ​​a liquid is usually made of a transparent material for observation, and air is usually above the liquid, and the refractive indices of air and liquid are different, it is difficult to distinguish between liquid and air in the visible area of ​​the liquid in existing technologies due to their transparency. In this embodiment, the detection module 42 can perform grayscale processing on the detection image, for example, converting it into objects with different grayscale values. In this case, the material of the visible area of ​​the liquid and the liquid itself will have different grayscale values ​​due to their different refractive indices. Therefore, by binarizing the grayscale image, the existence of a boundary between the liquid and air, i.e., a liquid surface, can be determined by the changes in the binarized values.

[0099] When the detection module 42 detects the presence of a liquid surface by converting the image to grayscale and using a deep learning model, that is, when the liquid surface is visible in the detection image, it can further perform key point detection processing on the detection image to obtain key point information of at least four key points.

[0100] Furthermore, when the detection module 42 fails to detect a liquid surface object, that is, when it determines that the liquid surface is not visible in the image frame (i.e., the liquid surface is not visible in the visible liquid area), this situation could be due to the liquid in the dial being in a full-scale state or an empty-scale state when the detection image was acquired. In other words, the liquid either fills the instrument or the liquid has already fallen below the lowest contour plane of the visible liquid area of ​​the instrument.

[0101] Therefore, the detection module 42 can further perform liquid object detection to confirm whether the invisible liquid surface indicates that the liquid in the dial is at full scale or empty scale. For example, image features can be extracted from the detection image or the visible liquid area, and the presence of a liquid object in the visible liquid area can be determined based on the extracted features. When no liquid object is detected, it can be determined that the liquid surface is invisible, i.e., the state at the time the detection image was acquired is that the liquid in the instrument is at empty scale. Therefore, the liquid level data can be directly set to zero. Conversely, when a liquid object is detected in the detection image, it can be determined that the liquid surface is invisible, i.e., the state at the time the detection image was acquired is that the liquid in the dial is at full scale. Therefore, the liquid level data can be directly set to, for example, the maximum value of the scale, thus indicating that the reading of the liquid level instrument is at its maximum.

[0102] The calculation module 43 can be used to calculate liquid level data based on key point information.

[0103] The calculation module 43 can calculate the liquid level data based on the key points detected by the detection module 42. In this embodiment, since the detection module 42 has determined the boundary of the visible liquid area through the calculated key points, and also determined the intersection of the liquid surface on the left and right boundaries, the calculation module 43 can determine the total height of the visible liquid area based on the vertex and bottom points, and determine the position of the liquid surface through the boundary points on the left and right sides of the liquid surface. In general, the total height of the visible liquid area is also the total length of the scale on the liquid surface. Therefore, the liquid level data is determined by calculating the ratio of the distance of the liquid surface relative to the vertex or bottom point to the total height of the visible liquid area.

[0104] The liquid level data acquisition device provided in this application acquires a detection image containing a visible liquid area and performs liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this reduces the complexity of detection, improves the applicability to liquid surface type metering devices, and enhances the accuracy of readings.

[0105] Liquid level data can be calculated based on the key points detected by the detection module 42. Specifically, in this embodiment, since the detection module 42 has determined the boundary of the visible liquid area through the calculated key points, and also determined the intersection of the liquid surface on the left and right boundaries, the calculation module 43 can determine the total height of the visible liquid area based on the vertex and bottom points of the visible liquid area, and determine the position of the liquid surface through the boundary points on the left and right sides of the liquid surface. Under normal circumstances, the total height of the visible liquid area is also the total length of the scale of the liquid surface. Therefore, the liquid level data is determined by calculating the ratio of the distance of the liquid surface relative to the vertex or bottom point to the total height of the visible liquid area.

[0106] For example, based on the coordinates of the key points obtained by the detection module 42, the distribution relationship of these four key points in the visible liquid area can be calculated first to verify whether the detection of these four key points is reasonable and effective. For example, the calculation module 43 can calculate the pixel coordinates of the midpoint of the liquid surface based on the coordinates of the left and right points of the liquid surface among the calculated key points. Then, based on the y-axis coordinate of this pixel coordinate (i.e., the coordinate of the liquid surface along the vertical axis in the visible liquid area), this coordinate is compared with the coordinates of the endpoint of the visible liquid area, i.e., the uppermost contour point of the visible liquid area. If the comparison result indicates that the coordinate of the liquid surface along the vertical axis is higher than the coordinate of the endpoint of the visible liquid area, it means that the detection of the left or right point of the liquid surface is incorrect, or the detection of the endpoint of the visible liquid area is incorrect. In other words, the output result of the above key point detection processing is unreasonable. Similarly, if the difference between the y-axis coordinates of the left and right points of the liquid surface is too large, for example, greater than a certain threshold, it also indicates that the determination of the key points is unreasonable. Therefore, the coordinates of these four key points cannot be used for subsequent liquid level data calculation.

[0107] Conversely, if the coordinates of the key points are determined to be reasonable based on the above comparison, the difference between the y-axis coordinates of the midpoint of the liquid surface calculated by the calculation module 43 and the starting point or midpoint of the visible liquid area can be used as the reading value of the liquid surface, i.e., the liquid level data.

[0108] Figure 4b This is a schematic diagram of the liquid level data acquisition interface provided in this application. Figure 4b As shown, this liquid level data acquisition interface can be displayed on the user's terminal. For example, the interface may include a parameter input area, a data display area, and an image display area.

[0109] The parameter input area can be used to display input controls. These controls receive user-input parameters for acquiring detection images containing the visible liquid area. For example, users can set the image acquisition time interval based on the type of level gauge or data changes. The detection frequency of the level gauge is adjusted by controlling the frame extraction interval; for example, a lower frame extraction frequency corresponds to a slower liquid level change, and vice versa, making the entire gauge reading algorithm adaptable to different application scenarios.

[0110] The data display area can be used to display liquid level data.

[0111] The image display area can be used to display the detected image and receive user feedback commands for the detected image.

[0112] In this embodiment, the user can view the acquired liquid level data, i.e., the reading of the required liquid level device, through the data display area. The user can also view the acquired raw image, the determined detection image, etc., in real time through the image display area to understand the progress of the liquid level data acquisition and processing according to this embodiment. Furthermore, the image display area can display at least four key points on the detection image, and can further display lines between the key points to show their layout relationship.

[0113] The types of key points can include: the start point and end point of the visible liquid area, and points on the left and right sides of the liquid surface within the visible liquid area. Specifically, in this embodiment, the image display area, while displaying key points on the detection or monitoring image, can also receive user feedback on the displayed image or key points. For example, if the displayed original or detection image is not clear enough to the user, or if the user determines, based on experience, that there is an error in the original or detection image used, the user can input feedback through the image display area, thereby discarding the image. Furthermore, the user can also confirm the key points displayed on the detection image, for example, by touching and dragging the key points to adjust their positions.

[0114] In addition, the image display area can also display a rectangular detection frame on the detection image to mark the visible area of ​​liquid, and the user can also adjust the detection frame by touching and dragging.

[0115] The liquid level data acquisition device provided in this application acquires a detection image containing a visible liquid area and performs liquid surface detection on the detection image to determine whether a liquid surface is present. When a liquid surface is determined to exist, key points in the image are detected to obtain at least four key point information, including the start point, end point, and left and right side points of the visible liquid area. Liquid level data can then be calculated based on this key point information. Compared with existing technologies that require image feature recognition of the liquid surface, this reduces the complexity of detection, improves the applicability to liquid surface type metering devices, and enhances the accuracy of readings.

[0116] Example 5

[0117] The above describes the internal functions and structure of the data acquisition device for a liquid level gauge, which can be implemented as an electronic device. Figure 5 A schematic diagram illustrating the structure of an embodiment of the electronic device provided in this application. (See attached diagram.) Figure 5 As shown, the electronic device includes a memory 51 and a processor 52.

[0118] Memory 51 is used to store programs. In addition to the programs described above, memory 51 can also be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, contact data, phonebook data, messages, pictures, videos, etc.

[0119] The memory 51 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0120] The processor 52 is not limited to a central processing unit (CPU), but may also be a graphics processing unit (GPU), a field-programmable gate array (FPGA), an embedded neural network processor (NPU), or an artificial intelligence (AI) chip. The processor 52 is coupled to the memory 51 and executes the program stored in the memory 51 to perform the liquid level data acquisition method of Embodiments 2 or 3 described above.

[0121] Furthermore, such as Figure 5 As shown, the electronic device may also include other components such as a communication component 53, a power supply component 54, an audio component 55, and a display 56. Figure 5 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 5 The components shown.

[0122] Communication component 53 is configured to facilitate wired or wireless communication between electronic devices and other devices. The electronic devices can access wireless networks based on communication standards, such as WiFi, 3G, 4G, or 5G, or combinations thereof. In one exemplary embodiment, communication component 53 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 53 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0123] Power supply component 54 provides power to various components of the electronic device. Power supply component 54 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0124] Audio component 55 is configured to output and / or input audio signals. For example, audio component 55 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 51 or transmitted via communication component 53. In some embodiments, audio component 55 also includes a speaker for outputting audio signals.

[0125] Display 56 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation.

[0126] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for obtaining liquid level data, comprising: obtaining a detection image containing a liquid visible region; performing liquid surface detection processing on the detection image, and when a liquid surface object is detected in the detection image, performing key point detection processing on the detection image to obtain key point information of at least four key points, wherein the key point information contains pixel coordinates of the key points and corresponding key point types, and the key point types include a start point of the liquid visible region, an end point of the liquid visible region, a left liquid surface point in the liquid visible region, and a right liquid surface point in the liquid visible region, wherein the start point is a point in the liquid visible region with the smallest coordinate value in a vertical axis direction, and the end point is a point in the liquid visible region with the largest coordinate value in the vertical axis direction; obtaining pixel coordinates of a liquid surface middle point according to pixel coordinates of the left liquid surface point and the right liquid surface point; and calculating the liquid level data according to a proportion of a projection distance of the liquid surface middle point from the start point and the end point in the vertical axis direction of the liquid visible region.

2. The liquid level data acquisition method of claim 1, wherein, The method further comprises: determining that the detection image is invalid when the coordinate value of the left liquid surface point or the right liquid surface point in the vertical axis direction is higher than the coordinate value of the end point in the vertical axis direction, or when a projection distance of the left liquid surface point from the right liquid surface point in the vertical axis direction is greater than a preset threshold value, according to the key point information. 3.The method of claim 2, wherein the key point detection processing on the detection image comprises: performing key point detection processing on the detection image by using a key point detection model. The method further comprises: training the key point detection model by using the detection image determined to be invalid and corresponding key point information thereof as training data.

4. The liquid level data acquisition method of claim 1, wherein, When no liquid surface object is detected in the detection image, the method further comprises: performing liquid detection processing on the detection image by using a first deep learning classification model, and determining that the liquid level data is zero when no liquid object is detected in the detection image, or determining that the liquid level data is a preset value when a liquid object is detected in the detection image.

5. The liquid level data acquisition method of claim 1, wherein, The method of obtaining the detection image containing the liquid visible region comprises: obtaining at least one original image; performing image quality detection processing on the original image by using a third deep learning classification model; when it is detected that the image quality of the original image is higher than a preset threshold value, obtaining a meter type related to the liquid level data and coordinates of a detection box containing the liquid visible region by using a deep learning detection model; and performing cropping processing on the original image according to the coordinates of the detection box to obtain the detection image.

6. The liquid level data acquisition method of claim 1, wherein, The liquid surface detection processing on the detection image comprises: performing liquid surface object detection processing on the detection image by using a second deep learning classification model.

7. A liquid level data acquisition interface for acquiring liquid level data of a liquid level type meter, wherein, The interface comprises: a parameter input area for displaying an input control to receive a parameter input by a user for obtaining the detection image containing the liquid visible region; a data display area for displaying the liquid level data. An image display area is configured to display the detection image and receive feedback instructions from a user on the detection image. The image display area further displays at least four key points on the detection image, including a start point of the liquid visible area, an end point of the liquid visible area, a left side point of the liquid surface in the liquid visible area, and a right side point of the liquid surface in the liquid visible area. The start point is the point with the minimum coordinate value in the longitudinal axis direction in the liquid visible area, and the end point is the point with the maximum coordinate value in the longitudinal axis direction in the liquid visible area. The liquid level data can be determined based on the following method: obtaining the pixel coordinates of the liquid surface midpoint according to the pixel coordinates of the left side point and the right side point of the liquid surface; and calculating the liquid level data according to the proportion of the projection distance of the liquid surface midpoint from the start point and the end point in the longitudinal axis direction of the liquid visible area.

8. The liquid level data acquisition interface of claim 7, wherein, The image display area is further configured to display a detection frame for identifying the liquid visible area.

9. A computer readable storage medium having stored thereon a computer program executable by a processor, wherein, The program is executed by a processor to implement the liquid level data acquisition method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Automatic liquid preparation ampoule bottle liquid level detection method and system and liquid medicine proportion detection method

    CN113516702A

  • Liquid level detection method

    JP2006138814A