This application claims priority benefit of TW Patent Application Ser. No. 105128723 filed 2016 Sep. 6 which is hereby incorporated herein by reference its entirety.
The present invention is a liquid level detecting system and method thereof, more particularly, a system and method thereof for detecting liquid level through image identification.
In order to detect the liquid level in a container, the liquid level detecting scheme utilized by traditional art includes ultrasonic detecting scheme, radar detecting scheme and image identification detecting scheme.
The ultrasonic detecting scheme and radar detecting scheme are conducted to acquire the inner current liquid level by setting up an ultrasonic device and radar device over the container opening and analyzing the echo signal. However, when the size of container is small enough (e.g. tubular size) to be limited by the physical size of the ultrasonic device and radar device and the resolution, the aforementioned scheme will not be able to detect the liquid level in the container with such size.
Traditional art further employs image identification scheme to detect liquid level, technical disclosed in applications such as TW-200636216, Image water level measurement device and method, I396832, An identification method for liquid level, acquires the tested level and label image and then identifies the image to determine the level value of tested liquid. But for aforementioned art, since it is relatively difficult for image identification of transparent liquid and identification of the scale label on transparent container (e.g. transparent tube) when the filling container is a transparent container and the tested liquid is a transparent liquid (e.g. water, alcohol etc.), the traditional art will thus be unable to detect the liquid level in aforementioned container.
In summary, the technical problem to be solved by the field is how to provide a technical scheme for addressing the above-mentioned problems.
To solve the problem disclosed previously, the purpose of the present invention is to provide a detecting scheme for liquid level by image identification.
To achieve above purpose, the present invention proposes a liquid level detecting system. Aforementioned system comprises a transparent container, a labeling element, a image acquiring device and an electronic device. Aforementioned transparent container is used to contain tested liquid, and the labeling element is neighbored to the transparent container. And the transparent container and the labeling element are located in a shooting range of the image acquiring device. The electronic device is electrically connected with the image acquiring device, wherein the electronic device enables the image acquiring device to acquire an image of the transparent container and the labeling element and analyzes an image portion affected by tested liquid so as to determines a liquid level of tested liquid.
To achieve above purpose, the present invention provides a method of detecting liquid level. Aforementioned method, applied in an electronic device, comprises the following steps: First, acquiring an image which includes a labeling element used to fill a transparent container of tested liquid and neighbored to the transparent container. Then, analyzing an image portion affected by tested liquid in the image so as to determine a liquid level of tested liquid.
In conclusion, the liquid level detecting system and method thereof of the present invention can effectively determine the liquid level in a transparent container through analyzing the image portion of the labeling element affected by the tested liquid, thereby compensating for the lack of the prior art.
For a better understanding of the aforementioned embodiments of the invention as well as additional embodiments thereof, reference should be made to the Description of Embodiments below, in conjunction with the following drawings in which like reference numerals refer to corresponding parts throughout the figures.
The following description is about embodiments of the present invention; however it is not intended to limit the scope of the present invention.
With reference to
Aforementioned electronic device 11 may be a device capable processing images such as computer, smart mobile communication device, embedded system circuit module etc. Aforementioned image acquiring device 12 is a device capable of acquiring images such as video camera, camera, camera compact module etc.
Aforementioned labeling element 14 may be an object capable of being identified by computer image process such as light source device, straight stripe object, oblique stripe object etc. And the labeling element 14 is located adjacent to the transparent container 13, wherein the distance is sufficient to map the image of the labeling element 14 onto the tested liquid 131 in the transparent container 13. In another embodiment, the transparent container 13 is positioned between the image acquiring device 12 and the labeling element 14 such that the image of the transparent container 13 and the image of the labeling element 14 covering the image of the transparent container 13 can be simultaneously acquired when the image acquiring device 12 is shooting toward the transparent container 13. And when the transparent container 13 is filled with the tested liquid 131, the image of labeling element 14 corresponding to the liquid 131 may affected by the liquid to amplify, thus the present invention determines the liquid level through identifying whether the image of the labeling element 14 is amplified by the liquid or not.
In another embodiment, aforementioned electronic device 11 finds a first image portion 21 (shown in
In another embodiment, the electronic device 11 configures vertical pixels of a transparent container 13 image into a plurality of blocks and determines the liquid level of the tested liquid 131 according to a pixel difference between the neighbored blocks.
In another embodiment, the electronic device 11 analyzes pixel values of an image neighbored to the end of the transparent container 13 in the image so as to determine the transparent container 13 is full or full empty.
In another embodiment, the electronic device 11 executes a blur processing to the image, then analyzes the image portion of the labeling element 14 affected by the tested liquid 131 to determine the liquid level of the tested liquid 131.
With reference to
S101: Acquiring an image which includes a label element used to fill a transparent container of tested liquid and neighbored to the transparent container.
S102: Analyzing an image portion of the labeling element affected by the tested liquid in the image to determine the liquid level of the tested liquid.
In another embodiment, aforementioned method further searches a first image portion of the labeling element affected by the tested liquid and searches a second image portion of the labeling element without being affected by the tested liquid, then determines the liquid level of the tested liquid according to a joint portion between the first image portion and the second image portion.
In another embodiment, aforementioned method configures vertical pixels of a transparent container image into a plurality of blocks and determines the liquid level of the tested liquid according to a pixel difference between the neighbored blocks.
In another embodiment, aforementioned method further analyzes pixel values of an image neighbored to the end of the transparent container in the image so as to determine the transparent container is full or full empty.
In another embodiment, aforementioned method further executes a blur processing to the image, then analyzes the image portion of the labeling element affected by the tested liquid to determine the liquid level of tested liquid.
The following are descriptions for the system of liquid level detecting system 1 according to the first embodiment of the present invention, and the method for detecting liquid level according to the second embodiment of the present invention can also achieve the same or similar technical effects. Aforementioned liquid level detecting system 1 can also be applied to detect the liquid level of the liquid in a tube. With reference to
S201: Executing a blur process for the tested part from the top of the tube to the bottom. In this step, with respect to the scale imprinted on the wall of part of the transparent container 13 and in order to prevent the scale image from affecting the image determination procedure, the electronic device 11 executes the blue process after an image 2 is acquired, and obtains the acquired image 2 of the transparent container 13 as shown in
S202: Acquiring a plurality of vertically-distributed pixel blocks from the image. With reference to
S203: Calculating the pixel difference between upper and lower pixel in each pixel block, then accumulating the blocks and calculating the block liquid level of this pixel block when the difference is larger than a predefined value. With continuous reference to
It can be known from the pixel value of the pixel dots that the sub-block BS2 and BS 3 are the first image portion 21 of the labeling element 14 affected by the tested liquid 131, and the sub-block BS1 is the second image portion 23 of the labeling element 14 without being affected by the tested liquid 131, wherein their joint portion 22 is the liquid level.
Next, the electronic device 11 calculates the difference among the sub-blocks and determines whether the difference meets the brightness difference threshold (e.g. larger than 765); when the difference meets the brightness difference threshold, the neighbored position of current difference blocks is viewed as the liquid level. Seen from descriptions of above case, the neighbored blocks having maximum difference (Diff=|S1−S2|=|0−765|=765) are BS1 and BS2. Therefore P3 and P4 is the liquid level of the pixel block BP1. The electronic device 11 can calculate the liquid level through the distribution positions of the pixel dots in the transparent container 13 or recognize what the value represented by aforementioned pixel dots is through inquiring the data list of internal memory, for example, the liquid level represented by P3 and P4 is recognized as 4 centimetre through the data list established inside.
The liquid level of the pixel bocks BP2˜BP3 is calculated similar to those mentioned above, and the number of blocks is accumulated when the liquid level of each pixel block BP can be calculated. In the present embodiment, the pixel blocks of liquid level can be calculated as BP1 and BP3, and the liquid level cannot be acquired due to the similar or same pixel value (e.g. 255) in BP2, thus now the number of blocks at the liquid level height is 2 (BP1 and BP3).
S204: Determining to find out whether the block number at liquid level height is larger than a threshold? If it is, S205 is executed; if not larger than the threshold, S206 is executed. Aforementioned threshold is used to determine whether the inside of the transparent container 13 is entirely full or empty. In the present embodiment, the threshold is defined as 1 by this case.
S205: Calculating out a median from the liquid level height of each pixel block and generating a liquid level height. If the block number at the current liquid level height is 11 and the liquid level heights of each block are 1 centimetre, 2 centimetre, 3 centimetre, 3 centimetre, 3 centimetre, 3 centimetre, 3 centimetre, 4 centimetre, 4 centimetre, 5 centimetre, 5 centimetre, the median is 3 centimetre.
S206: Determining whether the liquid level is entirely full or empty and outputting results. When the block number has not reached the threshold, it refers to that the container is entirely full or empty. With reference to
For example, if there is a maximum difference (Diff=500−0=500) between the aggregation (SUM=0+0=0) of a set of horizontal pixel dots {PD1,PD2} and the aggregation (SUM=255+255=500) of a set of horizontal pixel dots {PD4,PD5}, a horizontal pixel dot PD3 at the edge of the first image portion 21 can be found out. In
The above disclosure is related to the detailed technical contents and inventive features thereof. People skilled in this field may proceed with a variety of modifications and replacements based on the disclosures and suggestions of the invention as described without departing from the characteristics thereof. Nevertheless, although such modifications and replacements are not fully disclosed in the above descriptions, they have substantially been covered in the following claims as appended.
Number | Date | Country | Kind |
---|---|---|---|
105128723 | Sep 2016 | TW | national |