Liquid level detection method, device and system

Through the combination of image acquisition and light source device, the liquid level information is calculated based on the spot position, and the problem of low resolution of existing liquid level detectors is solved, achieving higher accuracy liquid level detection.

CN119124309APending Publication Date: 2024-12-13SHANGHAI SIERAN MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310692400.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing non-contact continuous liquid level detection devices have a low resolution, usually greater than 0.5mm, and the liquid level information cannot be accurately detected.

Method used

The image acquisition device is used to collect the image of the liquid to be detected in the container under uniform light irradiation of the light source device, and the liquid level information is determined based on the spot position in the image, and the liquid level is accurately measured by constructing a two-dimensional matrix, guiding and liquid level distance calculation.

Benefits of technology

It improves the accuracy of liquid level detection, can determine liquid level information more accurately, and overcomes the problem of low resolution of traditional capacitive detectors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119124309A_ABST
    Figure CN119124309A_ABST
Patent Text Reader

Abstract

The invention provides a liquid level detection method, device and system. The method is applied to a processor in the liquid level detection system. The system further comprises a light source device and an image acquisition device; the light source device is arranged on the side surface or bottom surface of the container; the image acquisition device is arranged on the side of the container; receiving an image, sent by the image acquisition device, of the to-be-detected liquid in the container under uniform light irradiation; the uniform light rays are emitted from the light source device to a container containing to-be-detected liquid; determining a pixel position corresponding to a target light spot in the image according to the brightness value corresponding to each pixel in the image; and determining liquid level information corresponding to the to-be-detected liquid in the container based on the pixel position of the target light spot. According to the application, the image acquisition device acquires the image of the to-be-detected liquid in the container under uniform light irradiation of the light source device, and the liquid level information of the to-be-detected liquid is determined based on the light spot position in the image, so that the liquid level detection accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of liquid level detection, and in particular to a liquid level detection method, device and system. Background Art

[0002] At present, most of the liquid level detection adopts contact detection, and non-contact detection is generally a switch quantity. The non-contact continuous liquid level detection devices currently on the market are basically capacitive. The resolution of this device is very low, usually greater than 0.5mm. Summary of the invention

[0003] The purpose of the present application is to provide a liquid level detection method, device and system, which can improve the accuracy of liquid level detection by collecting an image of the liquid to be detected in the container under the uniform light irradiation of a light source device through an image acquisition device, and determining the liquid level information of the liquid to be detected based on the position of the light spot in the image.

[0004] In a first aspect, an embodiment of the present application provides a liquid level detection method, which is applied to a processor in a liquid level detection system; the system also includes: a light source device, an image acquisition device; wherein the light source device is arranged on the side or bottom of a container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected to the processor; the container is a transparent container, and the material is a hydrophilic material; the method includes: receiving an image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; according to the brightness value corresponding to each pixel in the image, determining the pixel position corresponding to the target light spot in the image; when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot; based on the pixel position of the target light spot, determining the liquid level information corresponding to the liquid to be detected in the container.

[0005] In a preferred embodiment of the present application, the step of determining the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot includes: obtaining the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel; the reference light spot is the light spot detected when the liquid level reaches the upper or lower limit; according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel, the liquid level information corresponding to the liquid to be detected in the container is calculated.

[0006] In a preferred embodiment of the present application, the step of determining the pixel position corresponding to the target light spot in the image based on the brightness value corresponding to each pixel in the image includes: constructing a two-dimensional matrix with the brightness value of each pixel in the image as an element; summing the elements corresponding to each row in the two-dimensional matrix to obtain a one-dimensional matrix; and deriving the one-dimensional matrix from bottom to top, and taking the pixel position corresponding to the maximum value of the derivative or the minimum value of the derivative as the pixel position corresponding to the target light spot.

[0007] In a preferred embodiment of the present application, the step of obtaining the liquid surface distance corresponding to the pixel includes: obtaining the first liquid surface position measured by the ruler when the liquid level in the container reaches the lower limit, and the first pixel position corresponding to the light spot detected by the image captured by the image acquisition device; obtaining the second liquid surface position measured by the ruler when the liquid level in the container reaches the upper limit, and the second pixel position corresponding to the light spot detected by the image captured by the image acquisition device; determining the liquid surface distance corresponding to the pixel according to the first liquid surface position, the first pixel position, the second liquid surface position and the second pixel position.

[0008] In a preferred embodiment of the present application, the step of determining the liquid level distance corresponding to the pixel according to the first liquid level position, the first pixel position, the second liquid level position and the second pixel position includes:

[0009] The liquid surface distance corresponding to the pixel is calculated according to the following first specified formula:

[0010] C = (A2-A1) / (B2-B1);

[0011] Among them, C represents the liquid surface distance corresponding to the pixel; B1 represents the first pixel position corresponding to the light spot when the liquid level reaches the lower limit; B2 represents the second pixel position corresponding to the light spot when the liquid level reaches the upper limit; A1 represents the first liquid surface position measured by the ruler when the liquid level reaches the lower limit; A2 represents the second liquid surface position measured by the ruler when the liquid level reaches the upper limit.

[0012] In a preferred embodiment of the present application, the step of calculating the liquid level information corresponding to the liquid to be detected in the container according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel includes:

[0013] Calculate the liquid level information corresponding to the liquid to be detected in the container according to the following second specified formula:

[0014] L = C*(B3-B1); or L = C*(B2-B3);

[0015] Wherein, L represents the liquid level information corresponding to the liquid to be detected; B3 represents the pixel position corresponding to the target light spot.

[0016] In a preferred embodiment of the present application, the light source device includes an LED array and a light homogenizing plate, or includes a point light source and a lens group.

[0017] In a preferred embodiment of the present application, the image acquisition device includes a light sensor array or a camera.

[0018] In a second aspect, an embodiment of the present application further provides a liquid level detection device, which is applied to a processor in a liquid level detection system; the system also includes: a light source device, an image acquisition device; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected to the processor; the container is a transparent container, and the material is a hydrophilic material; the device includes: an image receiving module, which is used to receive an image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; a light spot determination module, which is used to determine the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image; when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot; the liquid level determination module, which is used to determine the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot.

[0019] In a third aspect, an embodiment of the present application further provides a liquid level detection system, the system comprising: a light source device, an image acquisition device and a processor; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected to the processor; the container is a transparent container, and the material is a hydrophilic material; the light source device is used to emit uniform light to the container containing the liquid to be detected; the image acquisition device is used to capture an image of the liquid to be detected under the irradiation of uniform light, and send the image to the processor; the processor is used to execute the method described in the first aspect to determine the liquid level information corresponding to the liquid to be detected in the container.

[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method described in the first aspect above.

[0021] In the liquid level detection method, device and system provided in the embodiment of the present application, the method is applied to the processor in the liquid level detection system; the system also includes: a light source device, an image acquisition device; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is in communication connection with the processor; the container is a transparent container, and the material is a hydrophilic material; when performing liquid level detection, the processor first receives the image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; then, according to the brightness value corresponding to each pixel in the image, the pixel position corresponding to the target light spot in the image is determined; when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot; based on the pixel position of the target light spot, the liquid level information corresponding to the liquid to be detected in the container is determined. In the embodiment of the present application, the image acquisition device is used to acquire the image of the liquid to be detected in the container under the uniform light irradiation of the light source device, and the liquid level information of the liquid to be detected is determined based on the light spot position in the image, so as to improve the accuracy of liquid level detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0023] Figure 1 A structural block diagram of a liquid level detection system provided in an embodiment of the present application;

[0024] Figure 2 A schematic diagram of a liquid level in a container provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of another container liquid level provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of a liquid level detection system provided in an embodiment of the present application;

[0027] Figure 5 A schematic diagram of another liquid level detection system provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of a liquid level detection method provided in an embodiment of the present application;

[0029] Figure 7 A flow chart of a calibration process in a liquid level detection method provided in an embodiment of the present application;

[0030] Figure 8 A structural block diagram of a liquid level detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The technical solution of the present application will be described clearly and completely below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0032] Currently, the non-contact continuous liquid level detection devices available on the market are basically capacitive, and the resolution of such devices is very low, usually greater than 0.5mm. Based on this, the embodiment of the present application provides a liquid level detection method, device and system, which uses an image acquisition device to collect an image of the liquid to be detected in the container under the uniform light irradiation of a light source device, and determines the liquid level information of the liquid to be detected based on the position of the light spot in the image, which can improve the accuracy of liquid level detection. To facilitate understanding of this embodiment, a liquid level detection system disclosed in the embodiment of the present application is first introduced in detail.

[0033] See also Figure 1 The embodiment of the present application shown in the figure provides a liquid level detection system, which includes: a light source device 11, an image acquisition device 12 and a processor 13; wherein the light source device 11 is arranged on the side of the container 14 ( Figure 1 Only the side surface is shown in the figure) or the bottom surface; the image acquisition device 12 is arranged on the side of the container 14; the image acquisition device 12 is communicatively connected with the processor 13; the container 14 is a transparent container, and the material is a hydrophilic material.

[0034] Among them, the light source device 11 is used to emit uniform light to the container 14 containing the liquid to be detected; the image acquisition device 12 is used to capture the image of the liquid to be detected under the irradiation of uniform light, and send the image to the processor 13; the processor 13 is used to determine the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image, and determine the liquid level information corresponding to the liquid to be detected in the container 14 based on the pixel position of the target light spot.

[0035] The light source device may include an LED array and a light homogenizing plate, or may include a point light source and a lens group, as long as it can emit uniform light. The image acquisition device may include a light sensor array or a camera.

[0036] The following is an explanation of the detection principle: the container is a hydrophilic material, such as most transparent plastics, and the liquid (such as water) will form a concave arc angle on the container wall due to surface tension. Figure 2 and Figure 3 shown.

[0037] When parallel uniform light enters the container from one side (such as Figure 4 As shown in the figure, the LED array and the light homogenizer are arranged on one side of the transparent container, and the light sensor array is arranged on the other side of the transparent container). At the interface between the liquid and the container, the light will be refracted because the water surface is a concave surface, and the light density on the other side of the container will drop significantly, thereby forming dark spots and stripes. Therefore, the processor can determine the accurate liquid level information based on the analysis of the dark spot position according to the image collected by the image acquisition device.

[0038] For example, when parallel uniform light enters the container from the bottom of the container (such as Figure 5 As shown, the LED array and the light homogenizing plate are arranged at the bottom of the transparent container, and the light sensor array is arranged on one side of the transparent container). At the bending part of the interface between the liquid and the container, part of the light will be totally reflected because it is shot from water into the air and from the light-dense medium into the light-sparse medium, forming bright spots and stripes on the side. Therefore, the processor can determine the accurate liquid level information based on the analysis of the bright spot position according to the image captured by the image acquisition device.

[0039] The liquid level detection system provided by the embodiment of the present application includes: a light source device, an image acquisition device and a processor; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected to the processor; the container is a transparent container, and the material is a hydrophilic material; when performing liquid level detection, the processor first receives an image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; then, according to the brightness value corresponding to each pixel in the image, the pixel position corresponding to the target light spot in the image is determined, and based on the pixel position of the target light spot, the liquid level information corresponding to the liquid to be detected in the container is determined, which can improve the accuracy of liquid level detection.

[0040] Based on the above system embodiment, the embodiment of the present application also provides a liquid level detection method, which is applied to a processor in the liquid level detection system; the above system also includes: a light source device, an image acquisition device; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected with the processor; the container is a transparent container, and the material is a hydrophilic material; see Figure 6 As shown, the liquid level detection method comprises the following steps:

[0041] Step S602, receiving an image of the liquid to be detected in the container under the irradiation of uniform light sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected.

[0042] According to the different positional relationships between the light source device and the container, there may be two situations here. One is that the light source device emits parallel light vertically upward to the container; the image acquisition device acquires the image of the liquid to be detected in the container under this light; the other is that the light source device emits parallel light to the container at the side of the container; the image acquisition device acquires the image of the liquid to be detected in the container under this light.

[0043] Step S604: determining the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image.

[0044] This step includes two cases: if the light source device is set on the side of the container, the detected target light spot is a dark spot; if the light source device is set on the bottom of the container, the detected target light spot is a bright spot. The pixel position can be represented by the number of pixels from bottom to top in the image.

[0045] Step S606: determining the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot.

[0046] After determining the pixel position of the target light spot, the relative liquid level of the liquid to be detected, i.e., the liquid level information, can be determined based on the position of the reference light spot. Specifically, the pixel position corresponding to the reference light spot and the liquid surface distance corresponding to the pixel are obtained; the reference light spot is the light spot detected when the liquid level reaches the upper or lower limit; based on the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel, the liquid level information corresponding to the liquid to be detected in the container is calculated.

[0047] The liquid surface distance corresponding to the above pixel represents the distance size corresponding to one pixel. The pixel position corresponding to the reference light spot and the pixel position corresponding to the target light spot are determined in the same way. The following takes the target light spot as an example to explain in detail the process of determining the pixel position corresponding to the target light spot:

[0048] It can be seen from the above principle that when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot.

[0049] The process of determining the pixel position corresponding to the target light spot is as follows: construct a two-dimensional matrix with the brightness value of each pixel in the image as an element (i.e., obtain the brightness values ​​of N columns in the vertical direction to form a two-dimensional matrix); sum the elements corresponding to each row in the two-dimensional matrix to obtain a one-dimensional matrix (i.e., add the numbers of the columns in the same plane to obtain a one-dimensional matrix); derive the one-dimensional matrix from bottom to top, and take the pixel position corresponding to the maximum derivative (corresponding to the bright spot) or the minimum derivative (corresponding to the dark spot) as the pixel position corresponding to the light spot. For example, the light source device emits parallel light from the side of the container. If there are a total of 100 pixels from bottom to top in the liquid image, by taking the derivative based on the brightness value, it is determined that the derivative is the smallest at the 20th pixel position from bottom to top, then the 20th pixel position is taken as the pixel position corresponding to the dark spot.

[0050] In a preferred embodiment of the present application, the process of obtaining the liquid surface distance corresponding to the pixel is also the process of calibrating the relationship between the image acquisition device (such as the light sensor array) and the liquid level, and the specific steps include:

[0051] (1) When the liquid level in the container reaches the lower limit, a first liquid surface position measured by a ruler and a first pixel position corresponding to a light spot detected by an image acquired by an image acquisition device are obtained; see Figure 7 As shown, the first liquid level position is A1 and the first pixel position is B1.

[0052] (2) When the liquid level in the container reaches the upper limit, the second liquid surface position measured by the ruler and the second pixel position corresponding to the light spot detected by the image captured by the image acquisition device are obtained; the second liquid surface position is A2, and the second pixel position is B2.

[0053] (3) Determine the liquid surface distance corresponding to the pixel according to the first liquid surface position, the first pixel position, the second liquid surface position and the second pixel position.

[0054] In specific implementation, the liquid surface distance corresponding to the pixel is calculated according to the following first specified formula:

[0055] C = (A2-A1) / (B2-B1);

[0056] Among them, C represents the liquid surface distance corresponding to the pixel; B1 represents the first pixel position corresponding to the light spot when the liquid level reaches the lower limit; B2 represents the second pixel position corresponding to the light spot when the liquid level reaches the upper limit; A1 represents the first liquid surface position measured by the ruler when the liquid level reaches the lower limit; A2 represents the second liquid surface position measured by the ruler when the liquid level reaches the upper limit.

[0057] In a preferred embodiment of the present application, the step of calculating the liquid level information corresponding to the liquid to be detected in the container according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel includes:

[0058] Calculate the liquid level information corresponding to the liquid to be detected in the container according to the following second specified formula:

[0059] L = C*(B3-B1); or L = C*(B2-B3);

[0060] Wherein, L represents the liquid level information corresponding to the liquid to be detected; B3 represents the pixel position corresponding to the target light spot.

[0061] In the liquid level detection method provided in the embodiment of the present application, the method is applied to a processor in a liquid level detection system; the system also includes: a light source device, an image acquisition device; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected to the processor; the container is a transparent container, and the material is a hydrophilic material; when performing liquid level detection, the processor first receives an image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; then, the pixel position of the bright spot or dark spot is determined by the brightness value of the pixel in the image, and further based on the pixel position of the reference light spot and the liquid surface distance corresponding to the pixel, the pixel position of the bright spot or dark spot is converted into relative liquid level information corresponding to the liquid to be detected in the container, which can improve the accuracy of liquid level detection.

[0062] Based on the above method embodiment, the embodiment of the present application also provides a liquid level detection device, which is applied to a processor in a liquid level detection system; the system also includes: a light source device and an image acquisition device; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected with the processor; the container is a transparent container, and the material is a hydrophilic material; see Figure 8 As shown, the device includes: an image receiving module 82, which is used to receive an image of the liquid to be detected in the container under uniform light irradiation sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; a light spot determination module 84, which is used to determine the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image; when the light source device is set on the side of the container, the target light spot is a dark spot, and when the light source device is set on the bottom of the container, the target light spot is a bright spot; a liquid level determination module 86, which is used to determine the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot.

[0063] In a preferred embodiment of the present application, the above-mentioned liquid level determination module 86 is used to obtain the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel; the reference light spot is the light spot detected when the liquid level reaches the upper limit or lower limit; according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel, the liquid level information corresponding to the liquid to be detected in the container is calculated.

[0064] In a preferred embodiment of the present application, the light spot determination module 84 is used to construct a two-dimensional matrix with the brightness value of each pixel in the image as an element; sum the elements corresponding to each row in the two-dimensional matrix to obtain a one-dimensional matrix; and derive the one-dimensional matrix from bottom to top, and use the pixel position corresponding to the maximum value or the minimum value of the derivative as the pixel position corresponding to the target light spot.

[0065] In a preferred embodiment of the present application, the above-mentioned liquid level determination module 86 is used to execute the step of obtaining the liquid surface distance corresponding to the pixel: obtaining the first liquid surface position measured by the ruler when the liquid level in the container reaches the lower limit, and the first pixel position corresponding to the light spot detected by the image captured by the image acquisition device; obtaining the second liquid surface position measured by the ruler when the liquid level in the container reaches the upper limit, and the second pixel position corresponding to the light spot detected by the image captured by the image acquisition device; determining the liquid surface distance corresponding to the pixel according to the first liquid surface position, the first pixel position, the second liquid surface position and the second pixel position.

[0066] In a preferred embodiment of the present application, the liquid level determination module 86 is used to

[0067] The liquid surface distance corresponding to the pixel is calculated according to the following first specified formula:

[0068] C = (A2-A1) / (B2-B1);

[0069] Among them, C represents the liquid surface distance corresponding to the pixel; B1 represents the first pixel position corresponding to the light spot when the liquid level reaches the lower limit; B2 represents the second pixel position corresponding to the light spot when the liquid level reaches the upper limit; A1 represents the first liquid surface position measured by the ruler when the liquid level reaches the lower limit; A2 represents the second liquid surface position measured by the ruler when the liquid level reaches the upper limit.

[0070] In a preferred embodiment of the present application, the liquid level determination module 86 is used to calculate the liquid level information corresponding to the liquid to be detected in the container according to the following second specified formula:

[0071] L = C*(B3-B1); or L = C*(B2-B3);

[0072] Wherein, L represents the liquid level information corresponding to the liquid to be detected; B3 represents the pixel position corresponding to the target light spot.

[0073] In a preferred embodiment of the present application, the light source device includes an LED array and a light homogenizing plate, or includes a point light source and a lens group.

[0074] In a preferred embodiment of the present application, the image acquisition device includes a light sensor array or a camera.

[0075] The device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the device, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0076] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.

[0077] The computer program products of the methods, devices, and electronic devices provided in the embodiments of the present application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0078] Unless otherwise specifically stated, the relative steps, numerical expressions and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0079] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0080] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0081] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A liquid level detection method, characterized in that: The method is applied to a processor in a liquid level detection system; the system further comprises: a light source device and an image acquisition device; wherein the light source device is arranged on the side or bottom of a container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected with the processor; the container is a transparent container and is made of a hydrophilic material; the method comprises: receiving an image of the liquid to be detected in the container under the irradiation of uniform light sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; Determine the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image; when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot; Based on the pixel position of the target light spot, the liquid level information corresponding to the liquid to be detected in the container is determined.

2. The method according to claim 1, characterized in that The step of determining the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot comprises: Obtaining a pixel position corresponding to a reference light spot and a liquid surface distance corresponding to the pixel; the reference light spot is a light spot detected when the liquid level reaches an upper limit or a lower limit; The liquid level information corresponding to the liquid to be detected in the container is calculated according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel.

3. The method according to claim 2, characterized in that The step of determining the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image comprises: Constructing a two-dimensional matrix with the brightness value of each pixel in the image as an element; Summing the elements corresponding to each row in the two-dimensional matrix to obtain a one-dimensional matrix; The one-dimensional matrix is ​​sequentially derived from bottom to top, and the pixel position corresponding to the maximum value or the minimum value of the derivative is used as the pixel position corresponding to the target light spot.

4. The method according to claim 2, characterized in that: The step of obtaining the liquid surface distance corresponding to the pixel comprises: Acquire a first liquid surface position measured by a ruler and a first pixel position corresponding to a light spot detected by an image acquired by an image acquisition device when the liquid level in the container reaches a lower limit; Acquire a second liquid surface position measured by a ruler when the liquid level in the container reaches an upper limit, and a second pixel position corresponding to a light spot detected by an image acquired by an image acquisition device; The liquid surface distance corresponding to the pixel is determined according to the first liquid surface position, the first pixel position, the second liquid surface position and the second pixel position.

5. The method according to claim 4, characterized in that The step of determining the liquid surface distance corresponding to the pixel according to the first liquid surface position, the first pixel position, the second liquid surface position and the second pixel position comprises: The liquid surface distance corresponding to the pixel is calculated according to the following first specified formula: C = (A2-A1) / (B2-B1); Among them, C represents the liquid surface distance corresponding to the pixel; B1 represents the first pixel position corresponding to the light spot when the liquid level reaches the lower limit; B2 represents the second pixel position corresponding to the light spot when the liquid level reaches the upper limit; A1 represents the first liquid surface position measured by the ruler when the liquid level reaches the lower limit; A2 represents the second liquid surface position measured by the ruler when the liquid level reaches the upper limit.

6. The method according to claim 5, characterized in that The step of calculating the liquid level information corresponding to the liquid to be detected in the container according to the pixel position corresponding to the target light spot, the pixel position corresponding to the reference light spot, and the liquid surface distance corresponding to the pixel comprises: The liquid level information corresponding to the liquid to be detected in the container is calculated according to the following second specified formula: L = C*(B3-B1); or L = C*(B2-B3); Wherein, L represents the liquid level information corresponding to the liquid to be detected; B3 represents the pixel position corresponding to the target light spot.

7. The liquid level detection method according to claim 1, characterized in that: The light source device includes an LED array and a light homogenizing plate, or includes a point light source and a lens group.

8. The liquid level detection method according to claim 1, characterized in that: The image acquisition device includes a light sensor array or a camera.

9. A liquid level detection device, characterized in that: The device is applied to a processor in a liquid level detection system; the system further comprises: a light source device and an image acquisition device; wherein the light source device is arranged on the side or bottom of a container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected with the processor; the container is a transparent container and is made of a hydrophilic material; the device comprises: An image receiving module, used for receiving an image of the liquid to be detected in the container under the irradiation of uniform light, which is sent by the image acquisition device; the uniform light is emitted by the light source device to the container containing the liquid to be detected; A light spot determination module, used to determine the pixel position corresponding to the target light spot in the image according to the brightness value corresponding to each pixel in the image; when the light source device is arranged on the side of the container, the target light spot is a dark spot, and when the light source device is arranged on the bottom of the container, the target light spot is a bright spot; The liquid level determination module is used to determine the liquid level information corresponding to the liquid to be detected in the container based on the pixel position of the target light spot.

10. A liquid level detection system, characterized in that: The system comprises: a light source device, an image acquisition device and a processor; wherein the light source device is arranged on the side or bottom of the container; the image acquisition device is arranged on the side of the container; the image acquisition device is communicatively connected with the processor; the container is a transparent container, and the material is a hydrophilic material; The light source device is used to emit uniform light to the container containing the liquid to be detected; The image acquisition device is used to acquire an image of the liquid to be detected under the irradiation of the uniform light, and send the image to the processor; The processor is used to execute the method according to any one of claims 1 to 7 to determine the liquid level information corresponding to the liquid to be detected in the container.