Liquid level determination method, device, apparatus, and storage medium

By acquiring brightness and contrast data of liquid surface images using machine vision technology, adjusting auxiliary lighting equipment, and performing image preprocessing, the problem of accuracy in liquid level detection in confined spaces was solved, and high-precision liquid level calculation was achieved under different environments.

CN118670480BActive Publication Date: 2026-11-20BEIJING EDTEK INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410659064.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2026-11-20
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

When detecting liquid level in a confined space, the fixed parameters of the auxiliary lighting device cannot adapt to environmental changes, affecting the quality of liquid surface image acquisition and leading to inaccurate liquid level height judgment.

Method used

Using machine vision technology, the brightness and contrast data of the liquid surface image are acquired to determine whether the image quality meets the preset requirements. The auxiliary lighting equipment is adjusted, and inverse perspective transformation and image preprocessing are performed to calculate the liquid level height.

Benefits of technology

This improves the accuracy of liquid level determination and ensures the precision of liquid level detection under different environmental conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118670480B_ABST
    Figure CN118670480B_ABST
Patent Text Reader

Abstract

The present disclosure provides a liquid level determination method, device, equipment and storage medium, comprising: acquiring a liquid surface image in a closed space; determining whether the quality of the liquid surface image meets a preset quality requirement; in the case where it is determined that the quality of the liquid surface image meets the quality requirement, calculating the liquid level height in the closed space based on the liquid surface image. Since the liquid level height is calculated based on the liquid surface image meeting the quality requirement in the present disclosure, the accuracy of the liquid level height calculation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of liquid level measurement technology, and in particular to a liquid level determination method, apparatus, equipment and storage medium. Background Technology

[0002] Currently, when detecting liquid levels in confined spaces, the process typically involves first activating auxiliary lighting in the space, then capturing images of the liquid surface using a camera installed within the space, and finally analyzing these images to determine the liquid level. However, the auxiliary lighting in these confined spaces operates based on fixed parameters. Changes in the environment of the confined space, without adjusting these parameters, directly impact the quality of the captured liquid surface images, thus affecting the accuracy of the liquid level determination. Therefore, improving the accuracy of liquid level determination is a crucial technical problem that engineers urgently need to solve. Summary of the Invention

[0003] In view of this, this disclosure proposes a machine vision-based liquid level determination method, apparatus, device, and storage medium, which can improve the accuracy of liquid level height determination.

[0004] According to a first aspect of this disclosure, a machine vision-based liquid level determination method is provided, comprising:

[0005] Acquire images of the liquid level in a confined space;

[0006] Determine whether the quality of the liquid surface image meets the preset quality requirements;

[0007] If the quality of the liquid surface image meets the quality requirements, the liquid level height in the enclosed space is calculated based on the liquid surface image.

[0008] In one possible implementation, determining whether the quality of the liquid surface image meets a preset quality requirement includes:

[0009] Obtain the brightness and contrast data of the liquid surface image;

[0010] Based on the brightness data and the contrast data, determine whether the quality of the liquid surface image meets the preset quality requirements.

[0011] In one possible implementation, acquiring the brightness and contrast data of the liquid surface image includes:

[0012] Convert the liquid surface image to HSV space;

[0013] Based on the HSV space, the brightness and contrast data of the liquid surface image are obtained.

[0014] In one possible implementation, if it is determined that the quality of the liquid surface image does not meet the quality requirements, the method further includes:

[0015] Calculate the quality deviation data between the quality of the liquid surface image and the quality requirement;

[0016] Based on the quality deviation data, the auxiliary lighting equipment in the enclosed space is adjusted;

[0017] The quality deviation data includes at least one of brightness deviation data and contrast deviation data, and the auxiliary lighting device includes at least one of auxiliary light source and laser emitter.

[0018] In one possible implementation, the quality deviation data includes brightness deviation data, and when adjusting the auxiliary lighting equipment in the enclosed space based on the brightness deviation data, it is done based on a preset brightness deviation threshold.

[0019] In one possible implementation, the quality deviation data includes contrast deviation data, and when adjusting the auxiliary lighting equipment in the enclosed space based on the contrast deviation data, it is done based on a preset contrast deviation threshold.

[0020] In one possible implementation, calculating the liquid level height in the confined space based on the liquid level image includes:

[0021] The liquid surface image is converted into a target liquid surface image that matches the actual space using inverse perspective transformation.

[0022] Convert the target liquid surface image to HSV space;

[0023] Extract target image data of a specified channel from the HSV space;

[0024] The image data is subjected to at least one preprocessing operation among grayscale conversion, histogram equalization, denoising, and binarization.

[0025] Based on the preprocessed target image data, the liquid level height in the sealed space is determined.

[0026] According to a second aspect of this disclosure, a liquid level determination device is provided, comprising:

[0027] The image acquisition module is used to acquire images of the liquid surface in a confined space.

[0028] A quality judgment module is used to determine whether the quality of the liquid surface image meets preset quality requirements;

[0029] The height calculation module is used to calculate the liquid level height in the enclosed space based on the liquid surface image, provided that the quality of the liquid surface image meets the quality requirements.

[0030] According to a third aspect of this disclosure, a liquid level determination device is provided, comprising:

[0031] processor;

[0032] Memory used to store processor-executable instructions;

[0033] The processor is configured to perform the method described in the first aspect of this disclosure.

[0034] According to a fourth aspect of this disclosure, a non-volatile computer-readable storage medium is provided that stores computer program instructions thereon, wherein the computer program instructions, when executed by a processor, implement the method described in the first aspect of this disclosure.

[0035] This disclosure provides a liquid level determination method, comprising: acquiring a liquid surface image in a confined space; determining whether the quality of the liquid surface image meets a preset quality requirement; and, if the quality of the liquid surface image meets the quality requirement, calculating the liquid level height in the confined space based on the liquid surface image. Since this disclosure calculates the liquid level height based on a liquid surface image that meets the quality requirement, the accuracy of the liquid level height calculation can be improved.

[0036] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0037] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0038] Figure 1 A flowchart is shown for a machine vision-based liquid level determination method according to an embodiment of the present disclosure.

[0039] Figure 2 A system framework diagram of a machine vision-based liquid level determination method according to an embodiment of the present disclosure is shown.

[0040] Figure 3 A flowchart illustrating a specific embodiment of a machine vision-based liquid level determination according to an embodiment of the present disclosure is shown.

[0041] Figure 4 A schematic block diagram of a machine vision-based liquid level determination device according to an embodiment of the present disclosure is shown.

[0042] Figure 5A schematic block diagram of a machine vision-based liquid level determination device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0043] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0044] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0045] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0046] <Method Implementation>

[0047] Figure 1 A flowchart illustrating a machine vision-based liquid level method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the method includes steps S1100-S1300.

[0048] S1100, acquire an image of the liquid level in a confined space.

[0049] It should be noted here that, in a confined space, there are... Figure 2 The camera device (1), auxiliary light source (2), laser emitter (3), single-board computer system (4), and controller (5) shown herein, when performing liquid level judgment, generate an image acquisition signal through the single-board computer system and send the image acquisition signal to the controller and the camera device. After receiving the image acquisition signal, the controller will turn on the auxiliary light source and laser emitter according to default parameters. After receiving the image acquisition signal, the camera device will acquire images of the liquid surface in the confined space at a preset frequency and send the acquired liquid level images to the single-board computer system. In this way, the single-board computer system can obtain images of the liquid surface in the confined space. Among them, the camera device, auxiliary light source, laser emitter, single-board computer system, and controller all have explosion-proof protection functions. The camera device can be a low-light high-definition camera, the single-board computer can be a Linux operating system, and the controller can be a variable frequency or fixed frequency configurable constant current controller.

[0050] After obtaining the liquid surface image in the confined space, step S1200 can be executed to determine whether the quality of the liquid surface image meets the preset quality requirements.

[0051] In one possible implementation, determining whether the quality of the liquid surface image meets the preset quality requirements may include steps S1210-S1220.

[0052] S1210, acquire the brightness and contrast data of the liquid surface image. Specifically, this may include the following steps:

[0053] First, the acquired liquid surface image is converted to HSV space. It should be noted that the acquired liquid surface image is an RGB image. To quickly and accurately obtain the brightness and contrast data of the liquid surface image, the RGB liquid surface image can be converted to HSV space first, and then the brightness and contrast data of the liquid surface image can be obtained based on the HSV space.

[0054] Second, based on the HSV color space, obtain the brightness and contrast data of the liquid surface image. The specific steps are as follows:

[0055] First, the image data of the V channel is extracted from the HSV space. The image data of the V channel records the brightness value of each pixel block in the liquid surface image.

[0056] Secondly, based on the brightness values ​​of each pixel block in the liquid surface image recorded in the V channel image data, the brightness and contrast data of the liquid surface image are determined. Specifically, the mean square error of the brightness values ​​of each pixel block is calculated, and this calculated mean square error is used as the brightness data of the liquid surface image. Further, the brightness values ​​of each row of pixel blocks are traversed. For the current row, the maximum and minimum brightness values ​​of the pixel block are extracted, and the difference between the maximum and minimum brightness values ​​is calculated. This difference is used as the contrast value corresponding to the current row. After the traversal is complete, the contrast value corresponding to each row of pixel blocks is obtained. The mean of all contrast values ​​is calculated, and the mean of all contrast values ​​is used as the contrast data of the liquid surface image.

[0057] In another possible implementation, the contrast of each column of pixels is calculated separately, then the mean of the contrast of each column of pixels is calculated, and then the calculated mean is used as the contrast data of the liquid surface image.

[0058] S1220, based on brightness and contrast data, determines whether the quality of the liquid surface image meets the preset quality requirements.

[0059] It should be noted that before performing this step, quality requirements need to be set. These quality requirements may include a brightness threshold and a contrast threshold. Preferably, the brightness threshold can be set to 100. The contrast threshold can range from 0.0 to 3.0, and preferably, it can be set to 1.6.

[0060] After setting the quality requirements, the quality of the liquid surface image can be determined based on the brightness and contrast data to see if it meets the preset quality requirements. Specifically, it checks if the brightness data is greater than or equal to the brightness threshold set by the quality requirements. If the brightness data is greater than this threshold, it checks if the contrast data is greater than or equal to the contrast threshold set by the quality requirements. If the contrast data is also greater than or equal to the contrast threshold, it is determined whether the quality of the liquid surface image meets the preset quality requirements. Otherwise, it is determined that the quality of the liquid surface image does not meet the preset quality requirements.

[0061] If the quality of the liquid surface image does not meet the quality requirements, the following steps will be performed:

[0062] First, calculate the quality deviation data between the liquid surface image quality and the quality requirements. This quality deviation data includes at least one of brightness deviation data and contrast deviation data.

[0063] The calculation of brightness deviation data includes: acquiring brightness data from the liquid surface image, calculating the difference between the brightness data and the brightness threshold, and using the difference between the brightness data and the brightness threshold as the brightness deviation data.

[0064] The calculation of contrast deviation data includes: acquiring contrast data in the liquid surface image, calculating the difference between the contrast data and the contrast threshold, and using the difference between the contrast data and the contrast threshold as the contrast deviation data.

[0065] Second, based on the quality deviation data, the auxiliary lighting equipment in the enclosed space is adjusted. This auxiliary lighting equipment includes at least one of an auxiliary light source and a laser emitter.

[0066] When the quality deviation data includes brightness deviation data, the brightness of the auxiliary light source is adjusted based on the brightness deviation data. In one possible implementation, the brightness adjustment of the auxiliary light source based on the brightness deviation data is based on a preset brightness deviation threshold. This brightness deviation threshold includes a first brightness deviation threshold and a second brightness deviation threshold. Specifically, if the brightness deviation data is less than the preset first brightness deviation threshold, it indicates that the brightness of the liquid surface image is insufficient. In this case, the brightness of the auxiliary light source is increased by one step, where one step can be a unit distance of brightness value. If the brightness deviation data is greater than the second brightness deviation threshold, it indicates that the liquid surface image is overexposed. In this case, the brightness of the auxiliary light source is decreased by one step. If the brightness deviation data is greater than or equal to the first brightness deviation threshold and less than or equal to the second brightness deviation threshold, it indicates that the brightness of the liquid surface image is within a reasonable range, and the brightness of the auxiliary light source is not adjusted. The first brightness deviation threshold can range from -10 to 10, preferably set to -2. The second brightness deviation threshold can range from 0 to 20, preferably set to 2.

[0067] When the quality deviation data includes contrast deviation data, the brightness of the laser emitter is adjusted based on the contrast deviation data. In one possible implementation, the adjustment of the laser emitter's laser intensity based on the contrast deviation data is based on a preset contrast deviation threshold. This contrast deviation threshold includes a first contrast deviation threshold and a second contrast deviation threshold. Specifically, if the contrast deviation data is less than the preset first contrast deviation threshold, the laser intensity of the laser emitter is increased by one step, where one step can be a unit distance of laser intensity. If the contrast deviation data is greater than the second contrast deviation threshold, the laser intensity of the laser emitter is decreased by one step. If the contrast deviation data is greater than or equal to the first contrast deviation threshold and less than or equal to the second contrast deviation threshold, the laser intensity of the laser emitter is not adjusted. The first contrast deviation threshold can range from 0.0 to 3.0, preferably set to -0.1. The second contrast deviation threshold can also range from 0.0 to 3.0, preferably set to 0.1.

[0068] The method in this embodiment can gradually adjust the auxiliary lighting equipment based on the quality deviation data of the liquid surface image when the liquid surface image does not meet the preset quality requirements, so as to obtain a liquid surface image that meets the quality requirements in the future.

[0069] If the quality of the liquid surface image meets the preset quality requirements, step S1300 can be executed to calculate the liquid level height in the enclosed space based on the liquid surface image.

[0070] In one possible implementation, calculating the liquid level height in a confined space based on a liquid surface image may include steps S1310-S1350.

[0071] S1310, the liquid surface image is converted into a target liquid surface image that matches the actual space using inverse perspective transformation, and then step S1320 is executed. It should be noted here that the pixel distances in the target liquid surface image obtained by inverse perspective transformation are consistent with those in the actual space.

[0072] S1320, convert the target liquid surface image to HSV space, which may include the following steps.

[0073] It should be noted that the converted target liquid surface image is an RGB image. In order to extract image data of a specific channel, the RGB liquid surface image can be converted to HSV space first, and then the image data of the specified channel can be extracted based on the HSV space.

[0074] S1330: Extract target image data from a specified channel in the HSV color space. This specified channel refers to the H channel. The extraction of target image data is based on the laser color of the laser emitter. Specifically, when the laser color is green, image data with pixel values ​​in the range of 20-99 is extracted from the H channel as target image data. When the laser color is blue, image data with pixel values ​​in the range of 78-155 is extracted from the H channel as target image data. When the laser color is red, image data with pixel values ​​in both the ranges of 0-10 and 156-180 are extracted from the H channel as target image data. Extracting target image data based on the laser color of the laser emitter effectively removes color interference caused by objects, improving the accuracy of subsequent liquid level height calculations.

[0075] S1340 performs at least one preprocessing operation on the target image data, including grayscale conversion, histogram equalization, denoising, and binarization.

[0076] In one possible implementation, the target image data can be denoised by closing operations. That is, the target image data is first dilated and then eroded, thereby removing internal hole noise in the target image data.

[0077] In another possible implementation, the target image data can be denoised by opening operations. That is, the target image data is first subjected to erosion transformation and then the eroded image is subjected to dilation to eliminate noise and burrs in the target image data and separate smooth image boundaries.

[0078] In one possible implementation, after extracting the target image data of a specified channel from the HSV space, the target image data can be processed sequentially by grayscale conversion, histogram equalization, denoising, and binarization to improve the accuracy of subsequent liquid level height calculation.

[0079] After the target image data is preprocessed, step S1350 can be executed to determine the liquid level height in the confined space based on the preprocessed target image data.

[0080] In the embodiment where grayscale conversion, histogram equalization, denoising, and binarization are performed sequentially on the target image data, the preprocessed target image data is a binarized image data. The pixel value of each pixel block in the binarized image is identified by 0 or 1. When the pixel value is 1, the color of the pixel block is black, and when the pixel value is 0, the color of the pixel block is white.

[0081] When determining the liquid level in a confined space based on this binarized image data, the image data of the laser-irradiated area can first be extracted from the target image data as the Region of Interest (ROI). Then, for the extracted ROI image, the number of pixels with a value of 0 in each row is counted, and the row with the most zero pixels (i.e., the row with the most white pixels) is taken as the liquid surface position. Next, the pixel distance between the liquid surface position and the bottom of the ROI image is calculated, and this calculated pixel distance is taken as the actual liquid level height in the confined space.

[0082] It should be noted that when calculating the liquid level, the calculation can be based on a single liquid surface image that meets the quality requirements, or it can be based on multiple liquid surface images that meet the quality requirements.

[0083] When calculating the liquid level height based on multiple liquid surface images that meet the quality requirements, the process includes: after acquiring a liquid surface image that meets the quality requirements, firstly, calculating the preprocessing result corresponding to the liquid surface image as described above, then determining whether the number of liquid surface images that meet the quality requirements has reached a preset quantity threshold. If the quantity threshold is met, the liquid level height is calculated separately for each target image data. The specific calculation process is described above and will not be repeated here. Next, all calculated liquid level height values ​​are sorted from smallest to largest, and the liquid level height in the middle of the sorted list is selected as the final liquid level height calculation result. The preset quantity threshold can be 25. In an embodiment with a quantity threshold of 25, 25 liquid level height values ​​are calculated. After sorting the 25 liquid level height values ​​from smallest to largest, the liquid level height value ranked 13th is extracted as the final liquid level height value.

[0084] In another possible implementation, it can also be done as follows: Figure 3 The process shown calculates the liquid level height, which may include steps S2010-S2090.

[0085] S2010: Acquire images of the liquid surface in a confined space, and perform grayscale conversion and histogram equalization on the acquired liquid surface images in sequence.

[0086] S2020, the image after histogram equalization is sequentially subjected to denoising processing (i.e. Figure 3 (Including closing and opening operations), median filtering, and binarization.

[0087] S2030: Perform a validity check on the binarized image to determine whether the image meets the preset quality requirements. If the quality requirements are not met, proceed to step S2040. If the preset quality requirements are met, proceed to step S2050.

[0088] S2040: Calculate the quality deviation data between the binarized image and the preset quality requirements. Adjust the auxiliary lighting equipment in the enclosed space according to the calculated quality deviation data to adjust the quality of the subsequently acquired liquid surface image, and return to step S2010.

[0089] S2050, convert the binarized image to the HSV color space, extract the target image data of the specified channel, and execute step S2060.

[0090] S2060: Determine if the process flag is greater than the set flag. If the process flag is greater than the set flag, it means that the image data meeting the quality requirements has met the preset quantity requirement, and then proceed to step S2070. If the process flag is less than or equal to the set flag, it means that the image data meeting the quality requirements is insufficient, the process flag is incremented by 1, and the process returns to step S2010.

[0091] S2070 Calculate the liquid level height corresponding to each target image, sort the calculated liquid level heights from smallest to largest, and take the liquid level height value in the middle of the sort as the final liquid level height calculation result (i.e., the median filtering algorithm in the figure).

[0092] S2080, increase the number of checks by one, and clear the existing process flags.

[0093] S2090, Exit liquid level detection, output the liquid level detection result, which is the final liquid level height in step S2070.

[0094] The specific calculation steps in this embodiment are described above and will not be repeated here.

[0095] This disclosure provides a liquid level determination method, comprising: acquiring a liquid surface image in a confined space; determining whether the quality of the liquid surface image meets a preset quality requirement; and, if the quality of the liquid surface image meets the quality requirement, calculating the liquid level height in the confined space based on the liquid surface image. Since this disclosure calculates the liquid level height based on a liquid surface image that meets the quality requirement, the accuracy of the liquid level height calculation can be improved.

[0096] <Device Embodiment>

[0097] Figure 4 A schematic block diagram of a liquid level determination device according to an embodiment of the present disclosure is shown. Figure 4 As shown, the liquid level determination device 100 includes:

[0098] Image acquisition module 110 is used to acquire images of the liquid surface in a confined space;

[0099] The quality judgment module 120 is used to determine whether the quality of the liquid surface image meets the preset quality requirements;

[0100] The height calculation module 130 is used to calculate the liquid level height in the enclosed space based on the liquid surface image, provided that the quality of the liquid surface image meets the quality requirements.

[0101] <Equipment Example>

[0102] Figure 5 A schematic block diagram of a liquid level determination device according to an embodiment of the present disclosure is shown. Figure 5 As shown, the liquid level determination device 200 includes a processor 210 and a memory 220 for storing executable instructions of the processor 210. The processor 210 is configured to implement any of the liquid level determination methods described above when executing the executable instructions.

[0103] It should be noted here that the number of processors 210 can be one or more. Furthermore, the liquid level judging device 200 of this embodiment may also include an input device 230 and an output device 240. The processors 210, memory 220, input device 230, and output device 240 can be connected via a bus or other means, without specific limitations here.

[0104] The memory 220, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and various modules, such as the program or module corresponding to the liquid level determination method in this embodiment of the present disclosure. The processor 210 executes various functional applications and data processing of the liquid level determination device 200 by running the software program or module stored in the memory 220.

[0105] Input device 230 can be used to receive input digital numbers or signals. These signals may include key signals related to user settings and function control of the device / terminal / server. Output device 240 may include a display device such as a screen.

[0106] <Storage Medium Examples>

[0107] According to a fourth aspect of this disclosure, a non-volatile computer-readable storage medium is also provided, on which computer program instructions are stored, which, when executed by processor 210, implement any of the liquid level determination methods described above.

[0108] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for determining liquid level, characterized in that, include: Acquire images of the liquid level in a confined space; Determine whether the quality of the liquid surface image meets the preset quality requirements; If the quality of the liquid surface image meets the quality requirements, the liquid level height in the enclosed space is calculated based on the liquid surface image. The method further includes, in cases where the quality of the liquid surface image does not meet the quality requirements: Calculate the quality deviation data between the quality of the liquid surface image and the quality requirement; The auxiliary lighting equipment in the enclosed space is adjusted based on the quality deviation data; wherein the quality deviation data includes brightness deviation data and contrast deviation data; the auxiliary lighting equipment includes an auxiliary light source and a laser emitter. When adjusting the auxiliary lighting equipment in the enclosed space based on the quality deviation data, the adjustment includes: adjusting the brightness of the auxiliary light source based on the brightness deviation data, and adjusting the laser intensity of the laser emitter based on the contrast deviation data. Specifically, when adjusting the brightness of the auxiliary light source based on the brightness deviation data, it is based on a preset brightness deviation threshold; when adjusting the laser intensity of the laser emitter based on the contrast deviation data, it is based on a preset contrast deviation threshold. Calculating the liquid level height in the enclosed space based on the liquid surface image includes: converting the liquid surface image to a target liquid surface image that matches the actual space using inverse perspective transformation; converting the target liquid surface image to HSV space; extracting target image data of the H channel from the HSV space; and determining the liquid level height in the enclosed space based on the preprocessed target image data. When extracting the target image data, it is based on the laser color of the laser emitter; specifically, when the laser color is green, image data with pixel values ​​in the range of 20-99 is extracted from the H channel as target image data; when the laser color is blue, image data with pixel values ​​in the range of 78-155 is extracted from the H channel as target image data; when the laser color is red, image data with pixel values ​​in the ranges of 0-10 and 156-180 are extracted from the H channel as target image data. After extracting the target image data of a specified channel from the HSV space, the target image data is binarized to obtain a binarized image data; the pixel value of each pixel block in the binarized image is identified by 0 or 1, wherein a pixel value of 1 represents the color of the pixel block as black, and a pixel value of 0 represents the color of the pixel block as white; When determining the liquid level in a confined space based on the binarized image data, the image data of the laser-irradiated area is first extracted from the target image data as the ROI image; then, for the extracted ROI image, the number of pixels with a value of 0 in each row is counted, and the row with the most pixels with a value of 0 is taken as the liquid surface position; next, the pixel distance between the liquid surface position and the bottom position of the ROI image is calculated, and the calculated pixel distance is taken as the actual liquid level in the confined space.

2. The method according to claim 1, characterized in that, When determining whether the quality of the liquid surface image meets the preset quality requirements, the following steps are included: Obtain the brightness and contrast data of the liquid surface image; Based on the brightness data and the contrast data, determine whether the quality of the liquid surface image meets the preset quality requirements.

3. The method according to claim 2, characterized in that, When acquiring the brightness and contrast data of the liquid surface image, the following are included: Convert the liquid surface image to HSV space; Based on the HSV space, the brightness and contrast data of the liquid surface image are obtained.

4. A liquid level determination device, characterized in that, include: The image acquisition module is used to acquire images of the liquid surface in a confined space. A quality judgment module is used to determine whether the quality of the liquid surface image meets preset quality requirements; The height calculation module is used to calculate the liquid level height in the confined space based on the liquid surface image, provided that the quality of the liquid surface image meets the quality requirements. The method further includes, in cases where the quality of the liquid surface image does not meet the quality requirements: Calculate the quality deviation data between the quality of the liquid surface image and the quality requirement; Based on the quality deviation data, the auxiliary lighting equipment in the enclosed space is adjusted; wherein, the quality deviation data includes brightness deviation data and contrast deviation data; the auxiliary lighting equipment includes an auxiliary light source and a laser emitter; When adjusting the auxiliary lighting equipment in the enclosed space based on the quality deviation data, the adjustment includes: adjusting the brightness of the auxiliary light source based on the brightness deviation data, and adjusting the laser intensity of the laser emitter based on the contrast deviation data. Specifically, when adjusting the brightness of the auxiliary light source based on the brightness deviation data, it is based on a preset brightness deviation threshold; when adjusting the laser intensity of the laser emitter based on the contrast deviation data, it is based on a preset contrast deviation threshold. Calculating the liquid level height in a confined space based on the liquid surface image includes: converting the liquid surface image to a target liquid surface image that matches the actual space using inverse perspective transformation; converting the target liquid surface image to HSV space; extracting target image data of the H channel from the HSV space; and determining the liquid level height in the confined space based on the preprocessed target image data. When extracting the target image data, it is based on the laser color of the laser emitter; specifically, when the laser color is green, image data with pixel values ​​in the range of 20-99 is extracted from the H channel as target image data; when the laser color is blue, image data with pixel values ​​in the range of 78-155 is extracted from the H channel as target image data; when the laser color is red, image data with pixel values ​​in the ranges of 0-10 and 156-180 are extracted from the H channel as target image data. After extracting the target image data of a specified channel from the HSV space, the target image data is binarized to obtain a binarized image data; the pixel value of each pixel block in the binarized image is identified by 0 or 1, wherein a pixel value of 1 represents the color of the pixel block as black, and a pixel value of 0 represents the color of the pixel block as white; When determining the liquid level in a confined space based on the binarized image data, the image data of the laser-irradiated area is first extracted from the target image data as the ROI image; then, for the extracted ROI image, the number of pixels with a value of 0 in each row is counted, and the row with the most pixels with a value of 0 is taken as the liquid surface position; next, the pixel distance between the liquid surface position and the bottom position of the ROI image is calculated, and the calculated pixel distance is taken as the actual liquid level in the confined space.

5. A liquid level determination device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the method of any one of claims 1 to 3 when executing the executable instructions.

6. A non-volatile computer-readable storage medium storing computer program instructions thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Water level monitoring method based on image identification

    CN107506798A