Fuel dispenser liquid level identification method, device and equipment and storage medium

By automatically identifying the liquid level and scale in the fuel refueling engine liquid level image, combined with image processing and OCR technology, the problems of inaccurate and low efficiency of the fuel refueling engine liquid level recognition are solved, and higher accuracy and more efficient liquid level recognition are achieved.

CN120411482APending Publication Date: 2025-08-01CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510575632.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing fuel refueling engine level recognition methods rely on manual verification, resulting in inaccurate readings, low efficiency, and heavy workload.

Method used

By acquiring liquid level images, the liquid level position and scale value are automatically identified, and image processing technology is used for binarization, cropping and recognition, and combined with OCR technology to identify scale values, correct system offset errors, and improve liquid level recognition accuracy and efficiency.

Benefits of technology

The data accuracy and efficiency of fuel refueling engine level recognition are improved, reducing human errors and simplifying the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411482A_ABST
    Figure CN120411482A_ABST
Patent Text Reader

Abstract

The invention discloses a fuel dispenser liquid level identification method, device and equipment and a storage medium, and is applied to the field of liquid level identification, when a liquid level image of a fuel dispenser is received, the liquid level image is converted into a gray level image, and binarization processing is performed on the gray level image based on a preset threshold value to obtain a binary image; determining a liquid level position row and a scale dense region column in the binary image, determining an intersection region of the liquid level position row and the scale dense region column, and setting a cutting region of the binary image in the intersection region; determining the relative position between the liquid level and the adjacent scale line, and adjusting the cutting area based on the relative position to obtain a corrected cutting area; the scale value in the corrected cutting area is recognized, and the liquid level value of the fuel dispenser is determined based on the scale value and the relative position. By acquiring the liquid level image, automatically identifying the liquid level position in the liquid level image and determining the liquid level value based on the scale value at the liquid level position, compared with manual liquid level identification, the data accuracy is improved, and the efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of liquid level identification, and particularly to a method for identifying the liquid level of a fuel dispenser, a device for identifying the liquid level of a fuel dispenser, an electronic device, and a computer-readable storage medium. Background Art

[0002] The liquid level is one of the most common control parameters in industrial production and life scenarios. Liquid level identification is widely used in various fields such as scientific research, life, and industrial production. The accuracy of the liquid level identification results directly affects the judgment of the product state and the adjustment of the plan. In the field of liquid level monitoring, the liquid level identification of the liquid level equipment of a fuel dispenser generally adopts the method of manual verification. The defects of the manual verification method are: the reading is greatly affected by humans, the reliability is poor, and for each verification of the fuel dispenser, after the fuel injection is completed, the scale of the metal measuring device to be inspected needs to be visually read by personnel, and the obtained data is inaccurate and the efficiency is low. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for identifying the liquid level of a fuel dispenser, a device for identifying the liquid level of a fuel dispenser, an electronic device, and a computer-readable storage medium, which are applied to the field of liquid level identification. The method automatically identifies the liquid surface position in the liquid level image by obtaining the liquid level image, and determines the liquid level value based on the scale value at the liquid surface position. Compared with manual liquid level identification, the accuracy of the data is improved and the efficiency is increased.

[0004] To solve the above technical problems, the present invention provides a method for identifying the liquid level of a fuel dispenser, including: When receiving the liquid level image of the fuel dispenser, convert the liquid level image into a grayscale image, and perform binaryzation processing on the grayscale image based on a preset threshold to obtain a binary image; Determine the liquid surface position row and the scale dense area column in the binary image, determine the intersection area of the liquid surface position row and the scale dense area column, and set the cropping area of the binary image in the intersection area; Determine the relative position between the liquid surface and the adjacent scale lines, and adjust the cropping area based on the relative position to obtain a corrected cropping area; Identify the scale value in the corrected cropping area, and determine the liquid level value of the fuel dispenser based on the scale value and the relative position.

[0005] Optionally, determining the liquid surface position row and the scale dense area column in the binary image includes: Perform horizontal projection processing on the binary image to determine the number of black pixel points in each row, determine the pixel point mutation area based on the number of black pixel points in each row, and determine the row in the pixel point mutation area as the liquid surface position row; Perform vertical projection processing on the binary image to determine the number of black pixel points in each column, and determine the column with the largest number of black pixel points as the column of the scale-dense area.

[0006] Optionally, determine the relative position between the liquid level and the adjacent scale lines, and adjust the cropping area based on the relative position to obtain a corrected cropping area, including: Perform bimodal recognition on the cropping area, determine the positions of the adjacent scale lines above and below the liquid level based on the peaks, and determine the position of the liquid level based on the valleys; Determine the relative position between the liquid level and the adjacent scale lines based on the position of the liquid level and the positions of the adjacent scale lines above and below the liquid level; When the relative position is greater than a preset threshold, move the cropping area down by a first preset number of rows to obtain the corrected cropping area; When the relative position is less than the preset threshold, move the cropping area up by a second preset number of rows to obtain the corrected cropping area.

[0007] Optionally, the method further includes: Perform Gaussian blur processing on the grayscale image to obtain a preprocessed image, and convert the preprocessed image into a target binary image; Detect circles in the target binary image based on the Hough circle transform, and determine the centers of the circles; Determine the ordinate at the center position, and determine the variance value of the ordinate; When the variance value is less than the horizontal threshold, determine that the liquid level value of the fuel dispenser is a valid value; When the variance value is greater than or equal to the horizontal threshold, determine that the liquid level value of the fuel dispenser is an invalid value.

[0008] Optionally, perform binarization processing on the grayscale image based on a preset threshold to obtain a binary image, including: Determine the background brightness of the liquid level image, and determine the preset threshold based on the background brightness; Perform binarization processing on the grayscale image based on the preset threshold to obtain the binary image; Perform morphological operations on the binary image to enhance the liquid level feature of the binary image and remove the noise points of the binary image.

[0009] Optionally, determine the liquid level value of the fuel dispenser based on the scale value and the relative position, including: Determine the initial liquid level value of the fuel dispenser based on the scale value and the relative position; Determine the system offset error, and correct the initial liquid level value based on the system offset error to obtain the liquid level value.

[0010] Optionally, identifying the scale value within the corrected cropping area includes: Identifying the character features within the corrected cropping area based on OCR technology, matching the character features with the features in the character library to obtain a matching result; Combining editable text based on the matching result to obtain the scale value within the corrected cropping area.

[0011] To solve the above technical problems, the present invention provides a fuel dispenser liquid level identification device, including: A first module, configured to convert the liquid level image into a grayscale image when receiving the liquid level image of the fuel dispenser, and perform binary processing on the grayscale image based on a preset threshold to obtain a binary image; A second module, configured to determine the liquid surface position row and the scale dense area column in the binary image, determine the intersection area of the liquid surface position row and the scale dense area column, and set the cropping area of the binary image in the intersection area; A third module, configured to determine the relative position between the liquid surface and the adjacent scale lines, and adjust the cropping area based on the relative position to obtain a corrected cropping area; A fourth module, configured to identify the scale value within the corrected cropping area, and determine the liquid level value of the fuel dispenser based on the scale value and the relative position.

[0012] To solve the above technical problems, the present invention provides an electronic device, including: A memory, configured to store a computer program; A processor, configured to implement the above-mentioned fuel dispenser liquid level identification method when executing the computer program.

[0013] To solve the above technical problems, the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the above-mentioned fuel dispenser liquid level identification method is implemented.

[0014] It can be seen that in the method of the present invention, when a liquid level image of a fuel dispenser is received, the liquid level image is converted into a grayscale image, and the grayscale image is binarized based on a preset threshold to obtain a binary image; the liquid level position row and the scale dense area column are determined in the binary image, the intersection area of the liquid level position row and the scale dense area column is determined, and a cutting area of the binary image is set in the intersection area; the relative position between the liquid level and the adjacent scale lines is determined, and the cutting area is adjusted based on the relative position to obtain a corrected cutting area; the scale value in the corrected cutting area is recognized, and the liquid level value of the fuel dispenser is determined based on the scale value and the relative position. By acquiring the liquid level image and automatically identifying the liquid level position in the liquid level image, and determining the liquid level value based on the scale value at the liquid level position, the present invention improves the accuracy of data and efficiency compared with manual liquid level identification. The corresponding device, electronic device and computer-readable storage medium also have the above beneficial effects. Description of the Drawings

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0016] Figure 1 It is a flowchart of a method for identifying the liquid level of a fuel dispenser provided by an embodiment of the present invention; Figure 2 It is a structural block diagram of a device for identifying the liquid level of a fuel dispenser provided by an embodiment of the present invention. Detailed Embodiments

[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0018] Liquid level is one of the most common control parameters in industrial production and life scenarios. Among them, liquid level identification is widely used in various fields such as scientific research, life, and industrial production. The accuracy of the liquid level identification result directly affects the judgment of the product state and the adjustment of the plan. Therefore, how to improve the accuracy of liquid level identification is an urgent problem to be solved.

[0019] Currently, in the field of liquid level monitoring, the liquid level identification of the liquid level equipment of fuel dispensers generally adopts the method of manual verification. The defects of the manual verification method are as follows: the reading is greatly affected by humans, and the reliability is poor. For each verification of a fuel dispenser, after the fuel injection is completed, the scale of the metal measuring device to be inspected needs to be visually read by personnel, and the obtained data is inaccurate and the efficiency is low. The use of a steam drum leveling device will result in inaccurate reading results, and the manual adjustment of screws by the staff during the measurement process leads to heavy workload.

[0020] Therefore, the present invention obtains a liquid level image, automatically identifies the liquid level position in the liquid level image, and determines the liquid level value based on the scale value at the liquid level position. Compared with manual liquid level identification, the accuracy of the data is improved and the efficiency is increased.

[0021] The following combines Figure 1 , Figure 1 to show the flowchart of a method for identifying the liquid level of a fuel dispenser provided by an embodiment of the present invention. The method may include: S101: When receiving a liquid level image of a fuel dispenser, convert the liquid level image into a grayscale image, and perform binarization processing on the grayscale image based on a preset threshold to obtain a binary image.

[0022] In this embodiment, an image acquisition device may be set to acquire the liquid level image of the fuel dispenser. The type of the image acquisition device and the format of the acquired image are not limited in this embodiment and may be set based on actual applications. Generally, the format of the liquid level image may be the RGB (Red Green Blue) format.

[0023] In order to obtain a liquid level image with higher clarity, the image acquisition device may be set at a position parallel to the liquid surface, so as to increase the key role of the liquid surface form in the recognition imaging. Further, in order to avoid unclear liquid level images caused by insufficient light, the image acquisition device may also be provided with an auxiliary supplementary lighting device.

[0024] The execution subject for performing liquid level identification is not limited in this embodiment and may be a server or a cloud server, etc., which may be specifically set based on actual applications. In this embodiment, the image acquisition device may be communicatively connected to the execution subject in a wired or wireless manner, which may be specifically set based on actual applications.

[0025] In this embodiment, when the execution subject receives a liquid level image of a fuel dispenser, the liquid level image may be preprocessed.

[0026] Specifically, first, the liquid level image may be converted into a grayscale image, which can reduce the image data while not affecting the overall and local brightness and chromaticity level distributions of the image.

[0027] The formula for converting the image into a grayscale image may be: gray = 0.2989×R + 0.5870×G + 0.1140×B; Where gray is the pixel value of the grayscale image, R is the pixel value of the red channel of the liquid level image, G is the pixel value of the green channel of the liquid level image, and B is the pixel value of the blue channel of the liquid level image.

[0028] Furthermore, the grayscale image can be binarized. The binarization of the image separates the target from the image. By removing the gray levels, the amount of information in the image is significantly reduced, making subsequent image analysis and processing more efficient.

[0029] This embodiment further defines the specific method for performing the binarization operation. Generally, the background brightness of the liquid level image can be determined, and a preset threshold can be determined based on the background brightness; the grayscale image can be binarized based on the preset threshold to obtain a binary image; morphological operations can be performed on the binary image to enhance the liquid surface features of the binary image and remove the noise points of the binary image.

[0030] In this embodiment, the preset threshold for the image binarization operation can be determined based on the background brightness of the liquid level image. For each liquid level image, the pixel values of the pixel points greater than or equal to the preset threshold can be set to 255, and the pixel values of the pixel points less than the preset threshold can be set to 0 to complete the binarization operation.

[0031] Morphological operation is an image processing technology based on the shape of the image. It uses a structuring element (a small image or image pattern) to detect and extract the shape and structure information in the image. Due to sensor noise, image transmission errors, etc., there will be pixel points in the image that are significantly different from the surrounding pixels, which are called noise. In this embodiment, the liquid surface features (such as edges, contours, etc.) can be enhanced, and operations such as erosion, dilation, and opening operation can be used to remove the noise points, improve the image quality, and make the image clearer and easier to analyze.

[0032] S102: Determine the row of the liquid surface position and the column of the scale dense area in the binary image, determine the intersection area of the row of the liquid surface position and the column of the scale dense area, and set the cropping area of the binary image in the intersection area.

[0033] In this embodiment, the cropping area that needs to be identified for the liquid level can be determined in the image. Specifically, the liquid surface position and the scale position can be determined in the binary image.

[0034] This embodiment does not limit the specific method for determining the liquid level position and the scale position. Generally, horizontal projection processing can be performed on the binary image to determine the number of black pixel points in each row, and based on the number of black pixel points in each row, the pixel point mutation region is determined, and the rows within the pixel point mutation region are determined as the liquid level position rows. Vertical projection processing is performed on the binary image to determine the number of black pixel points in each column, and the column with the largest number of black pixel points is determined as the scale dense region column.

[0035] Horizontal projection and vertical projection are common techniques in image processing for detecting specific features in an image. The basic principle is to sum the pixel values of each row / column in the image to obtain a one-dimensional array representing the sum of the pixels in that row / column. This array can reflect the brightness or pixel number distribution of the image in the horizontal / vertical direction. Pixel distribution is an important manifestation of the statistical features of an image, which reflects the characteristics of the image such as brightness, contrast, and texture. By calculating the pixel distribution, a histogram of the image can be obtained, which is a commonly used method for image description. The histogram can be used not only for image visualization but also for tasks such as image classification and retrieval.

[0036] In this embodiment, vertical projection analysis is performed to calculate the column pixel sum histogram of the binary image. By counting the pixel sum of each column, the points where the number of pixels changes abruptly are found, and the position of the maximum value of the histogram is found. The column corresponding to this position is the column with the most dense scale lines. By determining the column with the most dense scale lines, the area where the scale lines are concentrated, that is, the peak position of the histogram, can be quickly found. The liquid level is usually a horizontal edge, which will cut off the vertical scale lines, resulting in an abrupt decrease in the pixel sum of the corresponding column, forming a valley value in the histogram. In this way, the image features of the liquid level can be better extracted.

[0037] In this embodiment, horizontal projection analysis is performed to calculate the row pixel sum histogram of the binary image. By counting the pixel sum of each row, the points where the number of pixels changes abruptly are found. According to the position of the mutation points, the image can be divided into two parts: above the liquid level and below the liquid level. The purpose of this step is to separately extract the image features of the liquid level. By using the method of calculating the number of black pixels in the horizontal direction to locate the position of the liquid level, by calculating the number of black pixels in each row of the image, the row corresponding to the liquid level can be found, thereby determining the position of the liquid level.

[0038] This embodiment can determine the intersection area of the liquid level position row and the scale dense region column, and set the cropping area of the binary image in the intersection area. This cropping area can be the area for liquid level recognition.

[0039] This embodiment does not limit the specific method for setting the cropping area of the binary image. Generally, the intersection area can be used as the center to set a cropping area with a preset range size. This embodiment does not limit the specific size of the cropping area, which can be set based on actual applications.

[0040] S103: Determine the relative position between the liquid level and the adjacent scale line, and adjust the cutting area based on the relative position to obtain a corrected cutting area.

[0041] Furthermore, in this embodiment, the relative position between the liquid level and the adjacent scale line can be determined, and the cutting area can be adjusted based on the relative position to obtain a corrected cutting area.

[0042] The digital identifiers (such as 5, 10, 15) of the liquid level gauge are usually printed near the scale line, but the liquid level may block part of the digital area. Therefore, in this embodiment, the position of the digital area can be dynamically adjusted by determining the relative position between the liquid level and the adjacent scale line, always focusing on the visible numbers near the liquid level.

[0043] This embodiment does not limit the specific method for determining the relative position. Generally, the cutting area / binary image can be subjected to bimodal recognition, the positions of the upper and lower adjacent scale lines of the liquid level can be determined based on the peaks, and the position of the liquid level can be determined based on the valleys; based on the position of the liquid level and the positions of the upper and lower adjacent scale lines of the liquid level, the relative position between the liquid level and the adjacent scale line is determined; when the relative position is greater than the preset threshold, the cutting area is moved down by the first preset number of rows to obtain a corrected cutting area; when the relative position is less than the preset threshold, the cutting area is moved up by the second preset number of rows to obtain a corrected cutting area.

[0044] The calculation formula for the relative position relativeScale of the liquid level can be: ; In the formula, relativeScale represents the relative position of the liquid level between two adjacent integer scale lines, scaleUp represents the position of the integer scale line above the liquid level, that is, peak 1, scaleDown represents the position of the integer scale line below the liquid level, that is, peak 2, and liquid represents the lowest valley value between the two peaks, that is, the actual position of the liquid level.

[0045] This embodiment does not limit the setting of the preset threshold. Generally, it can be set to 0.5, that is, if the liquid level is close to the upper scale line (relativeScale < 0.5), the current liquid level may block the numbers below, and the digital area corresponding to the upper scale line needs to be cropped; if the liquid level is close to the lower scale line (relativeScale > 0.5), the current liquid level may block the numbers above, and the digital area corresponding to the lower scale line needs to be cropped. In this embodiment, when relativeScale = 0.5, the cutting area can be directly recognized for the scale value, or the cutting area can be adjusted according to a preset rule, which is not limited in this embodiment.

[0046] Adjust the cropping area based on the relative position to obtain a corrected cropping area, so that the cropping area can contain the scale values to be recognized, making the recognition result more accurate.

[0047] S104: Recognize the scale values in the corrected cropping area, and determine the liquid level value of the fuel dispenser based on the scale values and the relative position.

[0048] In this embodiment, the scale values in the corrected cropping area can be recognized, and the liquid level value of the fuel dispenser can be determined based on the scale values and the relative position.

[0049] This embodiment does not limit the specific method for recognizing the scale values in the corrected cropping area. Generally, the scale values can be recognized through a template matching algorithm. Common template matching algorithms include template matching based on grayscale values, template matching based on correlation, and template matching based on shape, etc. This embodiment does not limit the selection of the template matching algorithm. In this embodiment, template matching based on shape can be selected.

[0050] Specifically, in this embodiment, the character features in the corrected cropping area can be recognized based on OCR technology, the character features are matched with the features in the character library to obtain a matching result; and the editable text is combined based on the matching result to obtain the scale values in the corrected cropping area.

[0051] OCR (Optical Character Recognition) is a technology that converts the text in an image into computer-readable text. Its core goal is to automatically recognize the characters (such as numbers, letters, symbols) in the image through algorithms and output the corresponding text information. In the liquid level gauge scenario, OCR is used to recognize the integer numbers (such as "5", "10") near the scale lines, convert them into numerical values, and calculate the final liquid level value in combination with the relative position of the liquid surface.

[0052] In this embodiment, by recognizing the scale values in the corrected cropping area, the integer part of the liquid level value can be obtained. Further, in this embodiment, the decimal part of the liquid level value can be determined through the relative position, and the decimal part is added to the integer part to obtain the liquid level value of the liquid level image, completing the liquid level recognition. For example, in a certain example, the scale value and the value of the relative position can be added to obtain the liquid level value.

[0053] Further, since systematic offset errors may be introduced during the scale marking process, in this embodiment, the system offset error can be determined, and the liquid level value can be corrected by the system offset error to make the recognition result more accurate. Specifically, the initial liquid level value of the fuel dispenser is determined based on the scale value and the relative position; the system offset error is determined, and the initial liquid level value is corrected based on the system offset error to obtain the liquid level value. This embodiment does not limit the specific value of the system offset error, which can be set based on actual applications, generally 0.1, that is, the initial liquid level value can be subtracted by 0.1 to obtain the liquid level value.

[0054] Since the liquid surface may be inclined during the liquid level recognition process, affecting the liquid level recognition result, in this embodiment, it is determined whether the liquid surface is inclined to further determine whether the recognized liquid level value is accurate.

[0055] In this embodiment, the grayscale image can first be subjected to Gaussian blur processing to obtain a preprocessed image, and the preprocessed image is converted into a target binary image. Gaussian blur processing can reduce noise and enhance the circle detection effect.

[0056] Circles in the target binary image are detected based on the Hough circle transform, and the centers of each circle are determined. The Hough circle transform is an image processing technique based on the Hough transform for detecting circular contours in an image. The ordinate at the center position is determined, and the variance value of the ordinate is determined. Among them, the horizontal direction is the abscissa direction, and the vertical direction is the ordinate direction. In this embodiment, the ordinates of all the circle centers can be statistically analyzed, the variance value of all the ordinates is calculated, and the variance value is used to determine whether the liquid surface is inclined.

[0057] When the variance value is less than the horizontal threshold, the liquid level value of the fuel dispenser is determined to be a valid value; when the variance value is greater than or equal to the horizontal threshold, the liquid level value of the fuel dispenser is determined to be an invalid value. In this embodiment, when the variance value is less than the horizontal threshold, it can be considered that the liquid surface is not inclined and the recognition result is a valid value; when the variance value is greater than or equal to the horizontal threshold, it can be considered that the liquid surface is inclined and the recognition result is unavailable, and the liquid level value is an invalid value.

[0058] In this embodiment, the liquid surface inclination judgment can be performed after the liquid level image is converted into a grayscale image. When it is determined that the liquid surface is not inclined, that is, the variance value is less than the horizontal threshold, the steps of recognizing the liquid level value based on the grayscale image can be continued to reduce the amount of invalid calculations.

[0059] Based on the above embodiments, the present invention automatically recognizes the liquid surface position in the liquid level image by acquiring the liquid level image, and determines the liquid level value based on the scale value at the liquid surface position. Compared with manual liquid level recognition, the accuracy of the data is improved and the efficiency is increased.

[0060] The following is combined withFigure 2 , Figure 2 is a structural block diagram of a fuel dispenser liquid level recognition device provided by an embodiment of the present invention. The device may include: The first module 100 is configured to, when receiving a liquid level image of a fuel dispenser, convert the liquid level image into a grayscale image, and perform binarization processing on the grayscale image based on a preset threshold to obtain a binary image; The second module 200 is configured to determine a liquid surface position row and a scale dense area column in the binary image, determine an intersection area of the liquid surface position row and the scale dense area column, and set a cropping area of the binary image in the intersection area; The third module 300 is configured to determine a relative position between the liquid surface and an adjacent scale line, and adjust the cropping area based on the relative position to obtain a corrected cropping area; The fourth module 400 is configured to identify a scale value in the corrected cropping area, and determine a liquid level value of the fuel dispenser based on the scale value and the relative position.

[0061] Based on the above embodiments, the present invention improves the accuracy and efficiency of data by obtaining a liquid level image, automatically identifying the liquid surface position in the liquid level image, and determining the liquid level value based on the scale value at the liquid surface position, compared with manually identifying the liquid level.

[0062] Based on the above embodiments, the second module 200 includes: The first unit is configured to perform horizontal projection processing on the binary image to determine the number of black pixel points in each row, determine a pixel point mutation area based on the number of black pixel points in each row, and determine the row in the pixel point mutation area as the liquid surface position row; The second unit is configured to perform vertical projection processing on the binary image to determine the number of black pixel points in each column, and determine the column with the largest number of black pixel points as the scale dense area column.

[0063] Based on the above embodiments, the third module 300 may include: The third unit is configured to perform double-peak recognition on the cropping area, determine the positions of the upper and lower adjacent scale lines of the liquid surface based on the peaks, and determine the liquid surface position based on the valleys; The fourth unit is configured to determine the relative position between the liquid surface and the adjacent scale line based on the liquid surface position and the positions of the upper and lower adjacent scale lines of the liquid surface; The fifth unit is configured to, when the relative position is greater than a preset threshold, move the cropping area down by a first preset number of rows to obtain the corrected cropping area; The sixth unit is configured to, when the relative position is less than a preset threshold, move the cropping area up by a second preset number of rows to obtain the corrected cropping area.

[0064] Based on the above embodiments, the device may further include: A fifth module, configured to perform Gaussian blur processing on the grayscale image to obtain a preprocessed image, and convert the preprocessed image into a target binary image; A sixth module, configured to detect circles in the target binary image based on the Hough circle transform, and determine the centers of the circles; A seventh module, configured to determine the ordinate at the center position and determine the variance value of the ordinate; An eighth module, configured to determine that the liquid level value of the fuel dispenser is a valid value when the variance value is less than the horizontal threshold; A ninth module, configured to determine that the liquid level value of the fuel dispenser is an invalid value when the variance value is greater than or equal to the horizontal threshold.

[0065] Based on the above embodiments, the first module 100 may include: A seventh unit, configured to determine the background brightness of the liquid level image, and determine the preset threshold based on the background brightness; An eighth unit, configured to perform binarization processing on the grayscale image based on the preset threshold to obtain the binary image; A ninth unit, configured to perform morphological operations on the binary image, enhance the liquid surface feature of the binary image, and remove noise points in the binary image.

[0066] Based on the above embodiments, the fourth module 400 may include: A tenth unit, configured to determine the initial liquid level value of the fuel dispenser based on the scale value and the relative position; An eleventh unit, configured to determine the system offset error, and correct the initial liquid level value based on the system offset error to obtain the liquid level value.

[0067] Based on the above embodiments, the fourth module 400 may include: A twelfth unit, configured to identify character features in the corrected cropping area based on OCR technology, match the character features with features in the character library, and obtain a matching result; A thirteenth unit, configured to combine editable texts based on the matching result to obtain the scale value in the corrected cropping area.

[0068] Based on the above embodiments, the present invention further provides an electronic device, which may include a memory and a processor. Among them, a computer program is stored in the memory. When the processor calls the computer program in the memory, the steps provided in the above embodiments can be implemented. Of course, the device may further include various necessary network interfaces, power supplies, and other components, etc.

[0069] The present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a terminal or a processor, the method provided in the embodiments of the present invention can be implemented; the storage medium may include: various media 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 disc, etc., that can store program codes.

[0070] In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

Claims

1. A method for identifying the liquid level of a fuel dispenser, characterized in that, Including: When receiving the liquid level image of the fuel dispenser, convert the liquid level image into a grayscale image, and perform binary processing on the grayscale image based on a preset threshold to obtain a binary image; Determine the liquid level position row and the scale dense area column in the binary image, determine the intersection area of the liquid level position row and the scale dense area column, and set the cropping area of the binary image in the intersection area; Determine the relative position between the liquid level and the adjacent scale lines, and adjust the cropping area based on the relative position to obtain a corrected cropping area; Identify the scale values within the corrected cropping area, and determine the liquid level value of the fuel dispenser based on the scale values and the relative position.

2. The fuel dispenser liquid level identification method according to claim 1, characterized in that, Determining the liquid level position row and the scale dense area column in the binary image includes: Perform horizontal projection processing on the binary image to determine the number of black pixel points in each row, determine the pixel point mutation area based on the number of black pixel points in each row, and determine the row within the pixel point mutation area as the liquid level position row; Perform vertical projection processing on the binary image to determine the number of black pixel points in each column, and determine the column with the largest number of black pixel points as the scale dense area column.

3. The fuel dispenser liquid level identification method according to claim 1, characterized in that Determining the relative position between the liquid level and the adjacent scale lines, and adjusting the cropping area based on the relative position to obtain a corrected cropping area includes: Perform double-peak recognition on the cropping area, determine the positions of the upper and lower adjacent scale lines of the liquid level based on the peaks, and determine the liquid level position based on the valleys; Determine the relative position between the liquid level and the adjacent scale lines based on the liquid level position and the positions of the upper and lower adjacent scale lines of the liquid level; When the relative position is greater than the preset threshold, move the cropping area down by a first preset number of rows to obtain the corrected cropping area; When the relative position is less than the preset threshold, move the cropping area up by a second preset number of rows to obtain the corrected cropping area.

4. The fuel dispenser liquid level recognition method according to claim 1, characterized in that, It also includes: Perform Gaussian blur processing on the grayscale image to obtain a preprocessed image, and convert the preprocessed image into a target binary image; Detect circles in the target binary image based on the Hough circle transform, and determine the centers of each circle; Determine the ordinate at the center position, and determine the variance value of the ordinate; When the variance value is less than the horizontal threshold, determine that the liquid level value of the fuel dispenser is a valid value; When the variance value is greater than or equal to the horizontal threshold, determine that the liquid level value of the fuel dispenser is an invalid value.

5. The fuel dispenser liquid level identification method according to claim 1, characterized in that Performing binary processing on the grayscale image based on a preset threshold to obtain a binary image includes: Determine the background brightness of the liquid level image, and determine the preset threshold based on the background brightness; Perform binary processing on the grayscale image based on the preset threshold to obtain the binary image; Perform morphological operations on the binary image to enhance the liquid level characteristics of the binary image and remove the noise points of the binary image.

6. The fuel dispenser liquid level identification method according to claim 1, characterized in that, Determining the liquid level value of the fuel dispenser based on the scale values and the relative position includes: Determine the initial liquid level value of the fuel dispenser based on the scale values and the relative position; Determine the system offset error, and correct the initial liquid level value based on the system offset error to obtain the liquid level value.

7. The fuel dispenser liquid level identification method according to claim 1, characterized in that, Identify the scale values within the corrected cropping area, including: Identify the character features within the corrected cropping area based on OCR technology, match the character features with the features in the character library to obtain a matching result; Combine editable text based on the matching result to obtain the scale values within the corrected cropping area.

8. A liquid level recognition device for a fuel dispenser, characterized in that, Include: The first module is used to convert the liquid level image of the fuel dispenser into a grayscale image when receiving the liquid level image, and perform binarization processing on the grayscale image based on a preset threshold to obtain a binary image; The second module is used to determine the liquid surface position row and the scale dense area column in the binary image, determine the intersection area of the liquid surface position row and the scale dense area column, and set the cropping area of the binary image in the intersection area; The third module is used to determine the relative position between the liquid surface and the adjacent scale lines, and adjust the cropping area based on the relative position to obtain a corrected cropping area; The fourth module is used to identify the scale values within the corrected cropping area, and determine the liquid level value of the fuel dispenser based on the scale values and the relative position.

9. An electronic device, characterized in that, Include: A memory for storing computer programs; A processor for implementing the fuel dispenser liquid level identification method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by the processor, the fuel dispenser liquid level identification method according to any one of claims 1 to 7 is implemented.