CN115683267A - Liquid level measuring method and device and storage medium - Google Patents

Liquid level measuring method and device and storage medium Download PDF

Info

Publication number
CN115683267A
CN115683267A CN202110842888.3A CN202110842888A CN115683267A CN 115683267 A CN115683267 A CN 115683267A CN 202110842888 A CN202110842888 A CN 202110842888A CN 115683267 A CN115683267 A CN 115683267A
Authority
CN
China
Prior art keywords
image
liquid level
acquiring
coordinate position
target image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110842888.3A
Other languages
Chinese (zh)
Inventor
赵鹏伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhimou Intelligent Technology Co ltd
Original Assignee
Shanghai Zhimou Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhimou Intelligent Technology Co ltd filed Critical Shanghai Zhimou Intelligent Technology Co ltd
Priority to CN202110842888.3A priority Critical patent/CN115683267A/en
Publication of CN115683267A publication Critical patent/CN115683267A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)

Abstract

The application provides a liquid level measuring method, a liquid level measuring device and a storage medium. The liquid level measuring method comprises the following steps: acquiring an original image of the liquid level pipe by using a contact type image sensor; preprocessing the original image to obtain a target image, wherein the target image comprises a liquid level image; acquiring the coordinate position of the liquid level image in the target image; and acquiring the liquid level height in the liquid level pipe according to the coordinate position. The liquid level measuring method, the liquid level measuring device and the storage medium do not need manual intervention when liquid level measurement is carried out, so that the measuring efficiency and precision are effectively improved, and the measuring cost is also effectively reduced.

Description

Liquid level measuring method and device and storage medium
Technical Field
The present disclosure relates to liquid level measurement technologies, and in particular, to a method and an apparatus for measuring a liquid level and a storage medium.
Background
In modern industrial processes, strict detection and control of the fill level is often required. The liquid level is also an important link of industrial monitoring as one of the material levels. A gauge for measuring a liquid level is called a level gauge, which is a measuring gauge often used in industrial production, and measures various liquid changes in an industrial scene and then reads a numerical value. The liquid level meter has wide application scenes, such as industrial, electric, petroleum, chemical, metallurgical, electric, pharmaceutical, water supply and drainage, environmental protection and the like, and different scenes have different requirements on the liquid level meter.
At present, the types of the liquid level meter mainly comprise a magnetic suspension type, an ultrasonic wave, a tuning fork vibration type, a pressure type, a sonar wave, a magnetic turning plate, a radar and the like. The common magnetic turning plate liquid level meter is a mechanical float type liquid level measuring device which is manufactured according to the principle of buoyancy and the magnetic coupling effect. When the liquid level in the container to be measured changes, the magnetic floater in the guide pipe of the magnetic turn-over plate liquid level meter rises and falls along with the liquid level, and the permanent magnetic steel in the magnetic floater is transmitted to the magnetic turn-over plate indicator through magnetic coupling, so that the red column and the white column are driven to turn over. The column turned from white to red as the liquid level rose and from red to white as the liquid level dropped. The juncture of the red and white turnover columns is the actual height of the liquid level, so that the liquid level change in the container can be directly read. However, the magnetic turn-over plate liquid level meter is easily influenced by the density of the measured medium, and the precision is not high. More importantly, the magnetic turning plate liquid level meter needs to be manually used for reading data, firstly, the difference exists in the numerical value read manually, so that the measurement precision is reduced, secondly, the liquid level cannot be detected in real time in a manual mode, the efficiency is low, and the requirements of modern industrial production cannot be met.
When other types of liquid level meters are adopted for liquid level measurement in the prior art, the liquid level meters also need to be counted manually, so that the measurement precision is poor, and the measurement efficiency is low. How to improve the measurement accuracy and measurement efficiency of liquid level in industrial production becomes one of the problems to be solved urgently by those skilled in the art.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the present application aims to provide a liquid level measuring method, device and storage medium, which are used for solving the problems of poor liquid level measuring accuracy and low liquid level measuring efficiency in the prior art.
To achieve the above and other related objects, there is provided in a first aspect of the present application a liquid level measuring method including:
acquiring an original image of the liquid level pipe by using a contact type image sensor;
preprocessing the original image to obtain a target image, wherein the target image comprises a liquid level image;
acquiring the coordinate position of the liquid level image in the target image;
and acquiring the liquid level height in the liquid level pipe according to the coordinate position.
In certain embodiments of the first aspect of the present application, the step of preprocessing the raw image to obtain the target image comprises:
filtering the original image through a spatial filter to obtain a filtered image;
and carrying out image binarization processing on the filtered image to obtain the target image.
In certain embodiments of the first aspect of the present application, after the image binarization processing is performed on the filtered image, the binarized image is morphologically processed, and the morphologically processed image is taken as the target image.
In certain embodiments of the first aspect of the present application, the step of filtering the original image through a spatial filter to obtain a filtered image comprises:
carrying out mean filtering on the original image through a mean filter;
carrying out bilateral filtering on the image subjected to the mean filtering through a bilateral filter;
and taking the bilateral filtered image as the filtered image.
In certain embodiments of the first aspect of the present application, after the step of preprocessing the raw image to obtain the target image, the method further comprises: and judging whether the flatness of the liquid level image accords with a preset threshold value, and when the flatness of the liquid level image is smaller than the preset threshold value, acquiring the coordinate position of the liquid level image in the target image.
In certain embodiments of the first aspect of the present application, the step of obtaining the coordinate position of the level image in the target image comprises:
acquiring edge data of the liquid level image based on an edge detection algorithm;
carrying out Hough transform on the edge data to obtain an edge line segment, and taking the average value of the endpoint coordinates of the edge line segment as the coordinate position of the liquid level image in the target image; or the like, or a combination thereof,
acquiring each pixel data corresponding to the edge data based on a vertical projection mode;
and taking the average value of each pixel data as the coordinate position of the liquid level image in the target image.
In certain embodiments of the first aspect of the present application, the step of obtaining the level of the liquid in the level tube from the coordinate position comprises:
acquiring a physical scale corresponding to a single pixel based on the image width of the target image and the physical scale corresponding to the target image;
and taking the product of the physical scale corresponding to the single pixel and the coordinate position as the liquid level height.
In certain embodiments of the first aspect of the present application, after the step of obtaining the level of the liquid in the level tube from the coordinate position, the method further comprises: and displaying the liquid level height.
In certain embodiments of the first aspect of the present application, the step of displaying the fluid level height comprises: and judging whether the liquid level height is smaller than an alarm threshold value or not, and displaying the liquid level height when the liquid level height is smaller than the alarm threshold value.
In certain embodiments of the first aspect of the present application, the step of acquiring a raw image of the fluid level tube using the contact image sensor comprises: starting the contact type image sensor based on an operation instruction to acquire an original image of the liquid level pipe; or, starting the contact image sensor in real time or in a timing mode to acquire a raw image of the liquid level pipe.
In a second aspect of the present application, there is provided a liquid level measuring device, the device comprising: the device comprises a liquid level pipe, a contact type image sensor, a collecting card and a processor; the contact type image sensor is arranged on one side of the liquid level pipe and used for collecting images of the liquid level pipe under the control of the collecting card; the acquisition card transmits the acquired image to the processor; the processor comprises a memory in which a computer program is stored which, when being executed by the processor, carries out the steps of the method according to any one of the preceding claims for obtaining the liquid level height in the liquid level tube.
In certain embodiments of the second aspect of the present application, the liquid level measurement device further comprises: a light source; the light source is positioned on the other side of the liquid level pipe and is arranged opposite to the contact type image sensor.
In a third aspect of the application, a storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the method as defined in any one of the above.
As described above, the liquid level measuring method, the liquid level measuring device and the storage medium of the present application have the following beneficial effects:
according to the liquid level measuring method, the liquid level measuring device and the storage medium, the original image of the liquid level pipe is obtained by using the contact type image sensor; then, preprocessing the original image to obtain a target image; then acquiring the coordinate position of the liquid level image in the target image; and finally, acquiring the liquid level height in the liquid level pipe according to the coordinate position. In this application, acquire the liquid level height in the liquid level pipe through the image processing mode, need not the manual work and carry out the reading of liquid level, not only improved level measurement's efficiency but also improved the precision of liquid level result.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of the liquid level measuring method of the present application.
Fig. 2 is a schematic flow chart illustrating an implementation manner of acquiring a target image in the liquid level measurement method according to the present application.
Fig. 3 is a schematic flow chart illustrating an implementation manner of obtaining the coordinate position in the liquid level measurement method according to the present application.
Fig. 4 is a schematic flow chart showing another implementation manner of obtaining the coordinate position in the liquid level measurement method of the present application.
FIG. 5 is a schematic flow chart of a second embodiment of the liquid level measuring method of the present application.
FIG. 6 is a schematic structural diagram of a first embodiment of the liquid level measuring device according to the present application.
Detailed Description
The following description of the embodiments of the present application is provided for illustrative purposes, and other advantages and capabilities of the present application will become apparent to those skilled in the art from the present disclosure.
In the following description, reference is made to the accompanying drawings that describe several embodiments of the application. It is to be understood that other embodiments may be utilized and that mechanical, structural, electrical, and operational changes may be made without departing from the spirit and scope of the present disclosure. The following detailed description is not to be taken in a limiting sense, and the scope of embodiments of the present application is defined only by the claims of the issued patent. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. Spatially relative terms, such as "upper," "lower," "left," "right," "lower," "below," "lower," "above," "upper," and the like, may be used herein to facilitate describing one element or feature's relationship to another element or feature as illustrated in the figures.
Although the terms first, second, etc. may be used herein to describe various elements in some instances, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. Also, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or" and/or "as used herein are to be construed as inclusive or meaning any one or any combination. Thus, "a, B or C" or "a, B and/or C" means "any of the following: a; b; c; a and B; a and C; b and C; A. b and C ". An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
Referring to fig. 1, fig. 1 is a schematic flow chart of a liquid level measurement method according to a first embodiment of the present application, and as shown in the figure, the liquid level measurement method includes:
step S10, acquiring an original image of the liquid level pipe by using a contact type image sensor;
step S20, preprocessing the original image to obtain a target image, wherein the target image comprises a liquid level image;
s30, acquiring the coordinate position of the liquid level image in the target image;
and S40, acquiring the liquid level height in the liquid level pipe according to the coordinate position.
Specifically, the step S10: the step of acquiring a raw Image of the liquid level tube using a Contact Image Sensor (CIS) may include: starting the contact type image sensor based on an operation instruction to acquire an original image of the liquid level pipe; or, starting the contact image sensor in real time or in a timing mode to acquire a raw image of the liquid level pipe.
In a specific application, the process of acquiring the original image may be performed based on an operation instruction of a user, for example, the user inputs the operation instruction through a human-computer interaction interface, after receiving the operation instruction of the user, the contact image sensor is started, and then the contact image sensor is used to acquire the original image of the liquid level pipe. Of course, the contact image sensor may also be started in real time or at regular time, for example, the contact image sensor may be set to be started every 10 minutes according to actual requirements to obtain an original image in the liquid level pipe, and the timing time interval may be set according to actual conditions, which is not limited in this application. Any way of acquiring the original image is within the protection scope of the application.
After the original image of the liquid level pipe is obtained in the step S10, the step S20 is executed to preprocess the original image to obtain a target image. Specifically, as shown in fig. 2, the step S20 may include:
step S201, filtering the original image through a spatial filter to obtain a filtered image;
step S202, carrying out image binarization processing on the filtered image to obtain the target image.
Specifically, the original image may be mean-filtered by a mean filter first when step S201 is performed; then bilateral filtering is carried out on the image after the mean filtering through a bilateral filter; and finally, taking the image subjected to bilateral filtering as the filtered image.
In this embodiment, a neighborhood averaging method may be used to perform mean filtering on the original image, that is, the mean value is used to replace each pixel value in the original image, for example, a target pixel point a (x, y) to be processed, a filtering template is selected, the filtering template is composed of a plurality of pixels adjacent to the filtering template, the mean value of all pixels in the template is obtained, and then the mean value is assigned to the current pixel point a (x, y) and is used as a gray level g (x, y) of the processed image at the point, that is, g (x, y) =Σf (x, y)/m; where m is the total number of pixels in the template including the current pixel. For example, the surrounding 8 pixels with the target pixel point a (x, y) as the center may be selected to form a filter template (including the target pixel itself), and the average value of all pixels in the filter template is used to replace the original pixel value. In practical application, different numbers of pixel points can be selected according to actual requirements to form a filtering template, and the filtering template is not limited by the application. Noise in the original image can be filtered out by performing mean filtering on the original image, so that the precision of image data is improved.
After the mean filtering is completed, bilateral filtering (Bilateral filter) is performed on the image, and a gaussian function related to the spatial distance can be used for multiplication with a gaussian function related to the gray scale distance during Bilateral filtering. The spatial distance refers to an euclidean distance between the current point and the central point, and a gaussian function of the spatial domain is as follows:
Figure BDA0003179690100000051
wherein (x) i ,y i ) Is the current point position, (x) c ,y c ) σ is the spatial domain standard deviation for the position of the center point.
The gray distance refers to an absolute value of a difference between the current point gray and the center point gray. The value domain gaussian function is:
Figure BDA0003179690100000061
wherein, gray (x) i ,y i ) Is the gray value of the current point; gram (x) c ,y c ) σ is the gray value of the center point, and σ is the range standard deviation.
And the image after the mean filtering is subjected to bilateral filtering, so that on one hand, noise points in the image are further filtered, and on the other hand, the liquid level image can be enhanced, so that the precision of the image is further improved.
After the filtered image is obtained in step S201, step S202 is performed to perform binarization processing on the filtered image. Specifically, image Binarization (Image Binarization) is a process of setting the gray value of a pixel point on an Image to be 0 or 255, that is, setting the whole Image to have an obvious black-and-white effect. In this embodiment, the background may be treated as white (grayscale value 255), while objects (liquid levels) darker in color (grayscale) relative to the background become black (grayscale value 0) after binarization. Of course, the background may be processed to be black according to other requirements or personal preference, and the object (liquid level) to be measured is set to be white, which is not limited in this application.
After the image is subjected to binarization processing in the step S202, the data volume in the image is greatly reduced, so that the efficiency of subsequent processing is improved; meanwhile, the outline of a target (liquid level image) can be highlighted, so that the precision of subsequent processing is improved.
In other embodiments, after step S202 is performed, that is, after the filtered image is subjected to image binarization processing, morphological processing may be performed on the binarized image, and the morphologically processed image may be used as the target image. Specifically, morphological operations such as erosion, dilation, opening and closing operations and the like can be performed on the binarized image according to the image and the actual application scene. The specific morphological processing procedures and principles are similar to those in the prior art, and are not described in detail herein.
After the acquisition of the target image in step S20 is completed, step S30 is performed: and acquiring the coordinate position of the liquid level image in the target image. Fig. 3 shows a schematic flow chart of an implementation of step S30 in the present application; as shown in fig. 3, the step S30 may include:
s301, acquiring edge data of the liquid level image based on an edge detection algorithm;
step S302, carrying out Hough transform on the edge data to obtain an edge line segment;
step S303, using the average value of the end point coordinates of the edge line segment as the coordinate position of the liquid level image in the target image.
The specific implementation process of step S301 may be: firstly, performing Gaussian smoothing on the target image to reduce the error rate; secondly, calculating gradient amplitude and direction by adopting a table operator, a Prewitt operator, a Roberts operator, a Canny operator and the like to estimate the edge strength and direction at each point; then, according to the gradient direction, carrying out non-maximum suppression on the gradient amplitude; and finally, further refining the results of sobel operators, prewitt operators and the like by using a double-threshold algorithm, thereby detecting and connecting edges. In this implementation, a Canny algorithm is preferred to obtain edge data of the liquid level image. Through step S301, the edge data of the liquid level image can be quickly and accurately acquired.
After the edge data of the liquid level image is obtained in step S301, hough Transform (Hough Transform) is performed on the edge data to obtain an edge line segment of the liquid level image, and the process of Hough Transform is similar to that in the prior art and is not described herein again. After the edge line segment is obtained, coordinates of two end points of the edge line segment are obtained, the coordinates of the two end points are averaged to obtain an average value of the coordinates, and the average value is used as the coordinate position of the liquid level image in the target image. The method and the device can quickly, effectively and accurately acquire the coordinate position of the liquid level image in the target image, thereby improving the efficiency and precision of subsequent processing.
Fig. 4 shows a schematic flowchart of another implementation manner of step S30 in the present application, and as shown in fig. 4, the step S30 may further include:
s301, acquiring edge data of the liquid level image based on an edge detection algorithm;
the implementation manner of obtaining the edge data of the liquid level image in this embodiment can refer to the detailed description in fig. 3, which is not repeated herein.
Step S304, acquiring each pixel data corresponding to the edge data based on a vertical projection mode;
specifically, after the edge data of the liquid level image is obtained, the edge data may be scanned in a vertical projection manner, so as to obtain each pixel data corresponding to the edge data. For a binary image, a horizontal projection or a vertical projection may be acquired by a line scan or a column scan, so as to obtain pixel data in the horizontal direction or pixel data in the vertical direction. The horizontal projection is the number of non-zero pixel values (1 or 255) per row, and similarly, the vertical projection is the number of non-zero pixel values per column of image data. The abscissa of the image may be obtained by projection in the horizontal direction, and the ordinate of the image may be obtained by projection in the vertical direction. In this implementation, the vertical coordinate of each pixel corresponding to the edge data is obtained by a vertical projection method.
And step S305, taking the average value of each pixel data as the coordinate position of the liquid level image in the target image.
In order to accurately acquire the coordinate position of the liquid level image in the target image, the data of each pixel acquired in step S304 may be averaged, and the average value may be used as the coordinate position of the liquid level image in the target image. It should be noted that the foregoing two manners of obtaining the coordinate position are merely examples, and those skilled in the art may also implement the two manners in other manners, which should not limit the scope of the present application.
In this embodiment, after the coordinate position of the liquid level image in the target image is obtained, step S40 is executed, that is, the liquid level height in the liquid level pipe is obtained through the coordinate position. Specifically, the process of obtaining the liquid level height may include: acquiring a physical scale corresponding to a single pixel based on the image width of the target image and the physical scale corresponding to the target image; and taking the product of the physical scale corresponding to the single pixel and the coordinate position as the liquid level height.
In practical application, the image width of the target image can be accurately obtained or calculated, and is proportional to the implementation physical scale corresponding to the target image, and the specific proportion is determined according to a practical application scene and used equipment, which is not described herein again. The number of pixels in the target image can be obtained through the image width of the target image, the physical scale corresponding to a single pixel can be obtained according to the number of pixels in the target image, the physical scale corresponding to the target image and the proportion between the target image and the actual physical scale, the physical scale corresponding to the single pixel is multiplied by the coordinate position obtained in the step S30, and the obtained product is the liquid level height. The liquid level height representation is the actual height of the liquid level in the equipment to be measured.
In the liquid level measuring method of the embodiment, the height of the liquid level can be directly obtained only by obtaining the image data in the liquid level pipe without manual measurement, so that the measuring process is greatly shortened, the measuring efficiency is improved, the measuring cost is reduced, and the measuring precision can be effectively improved.
In the liquid level measuring method of the present application, after the step of obtaining the liquid level height in the liquid level pipe through step S40, the method may further include: and displaying the liquid level height. Specifically, the liquid level height may be transmitted to a human-computer interaction interface or other display devices for displaying, and the display mode may be displaying a liquid level value, may also be displaying a graph, or displaying in other forms, which should not limit the protection scope of the present application.
Fig. 5 is a schematic flow chart of a second embodiment of the liquid level measurement method of the present application, and as shown in the drawing, the liquid level measurement method of the present embodiment includes:
step S10, acquiring an original image of the liquid level pipe by using a contact type image sensor;
similarly to the embodiment, when the original image is obtained in the step S10, the contact image sensor may be activated based on the operation instruction to obtain the original image of the liquid level pipe; or, the contact image sensor is started in real time or at regular time to acquire an original image of the liquid level pipe, which is not limited in this application. For a specific process of acquiring the original image, reference may be made to the detailed description of the foregoing embodiment one and fig. 1, which is not repeated herein.
Step S20, preprocessing the original image to obtain a target image, wherein the target image comprises a liquid level image;
the process and principle of preprocessing the original image can refer to the detailed description of the first embodiment, fig. 1 and fig. 2, and are not described herein again. After step S20 is executed and the target image and the liquid level image are acquired, step S50 is executed: and judging whether the flatness of the liquid level image meets a preset threshold value or not.
In particular, the flatness of the liquid level image may be calculated using an edge detection operator, such as a Sobel operator, prewitt operator, roberts operator, log operator, or Canny operator, among others. Specifically, which operator is used for calculating the flatness can be selected according to actual conditions in application, and the method is not limited in this application. And after the flatness of the liquid level image is calculated, comparing the flatness with a preset threshold value. The preset threshold is set or adjusted differently according to actual applications or specific scenes, which should not limit the scope of the present application.
When the flatness of the liquid level image is smaller than a preset threshold value, executing the step S30: and acquiring the coordinate position of the liquid level image in the target image. And then step S40 is executed, and the liquid level height in the liquid level pipe is obtained according to the coordinate position. For the specific working process of step S30 and step S40, reference may be made to the detailed description in the foregoing first embodiment, and details are not repeated here.
With continued reference to fig. 5, in this embodiment, after the step S40 is executed to obtain the liquid level height, the step S60 is executed: and judging whether the liquid level height is smaller than an alarm threshold value. When the liquid level height is smaller than the alarm threshold value, executing the step S70: and displaying the liquid level height. In practical application, when the liquid level height is smaller than the alarm threshold, the liquid level height may be highlighted, or other alarm displays may be performed, for example, the liquid level height may be displayed in various forms such as a prompt tone and a prompt window, which is not limited in this application. When the liquid level height is not less than the alarm threshold, the display may not be performed, or only the numerical information is displayed but other reminding displays are not performed, and the specific display form may be set differently according to the requirements.
In addition, the alarm threshold may be specifically set according to actual requirements or related experiences, and different application scenarios and different application requirements correspond to different alarm thresholds, which is not limited in the present application. Through the display mode of the embodiment, the alarm precision and efficiency can be effectively improved. Of course, in practical applications, after the liquid level height is obtained in step S40, the liquid level height may be directly displayed as described in the first embodiment, for example, the liquid level height may be transmitted to a human interface or a corresponding display device (e.g., a display screen) for displaying. Of course, the liquid level height can be displayed in other forms according to actual conditions.
The present application also provides a storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the liquid level measuring method as described in the foregoing. For a specific process of the processor when executing the computer program, reference may be made to the detailed description in fig. 1 to fig. 5 and the first and second embodiments, which are not repeated herein.
FIG. 6 is a schematic structural diagram of a first embodiment of the liquid level measuring device according to the present application. As shown, the liquid level measuring device includes: a liquid level pipe 10, a contact image sensor 20, an acquisition card 30 and a processor 40.
Specifically, the contact image sensor 20 is disposed at one side of the liquid level pipe 10, and is configured to collect an image of the liquid level pipe 10 under the control of the collection card 30; the acquisition card 30 transmits the acquired image to the processor 40; the processor 40 may comprise a memory 401, in which memory 401 a computer program is stored, which computer program, when being executed by the processor 40, carries out the steps of the level measurement method as described above, for obtaining the level of the liquid in the level tube.
The memory 401 may be provided in the processor 40, or may be a separately provided component, and communicates with the processor through an interface or a data line. In this embodiment, the contact image sensor is an array formed by sensor ICs manufactured by a CMOS process. In practical application, the model of the contact image sensor can be selected according to practical requirements, and the application does not limit the model.
In practical applications, the liquid level measuring device may further comprise a light source. The light source is located at the other side of the liquid level pipe 10, and is disposed opposite to the contact image sensor 20. The light source is used for providing the light source so that the contact type image sensor can obtain clearer and more accurate images. Specifically, only the liquid level tube 10 is spaced apart from the light source and the contact image sensor 20. The light source is at least the same as the contact image sensor 20 in width and length, that is, the length of the light source may be the same as the length of the contact image sensor 20 or longer than the length of the contact image sensor. Likewise, the width of the light source may be the same as or wider than the width of the contact image sensor 20. The sizes of the light source and the contact image sensor 20 can be confirmed according to actual requirements; in addition, the light source may be selected according to a specific application scenario, which should not limit the scope of the present application.
With continued reference to fig. 6, the capture card 30 is connected to the contact image sensor 20, and the contact image sensor 20 is driven by the capture card 30 to capture the relevant image. The acquisition card 30 is selected to be adapted according to the type of the contact image sensor 20. The acquisition card with contact image sensor accessible data line, bus etc. mode carry out the physical connection, also can carry out wireless connection through other forms, and this application does not do the restriction to this.
After the acquisition card acquires the original image in the liquid level pipe, the original image is transmitted to the processor through various modes such as a wireless network, a USB (universal serial bus), bluetooth and the like. The processor can be a CPU, an MPU or other processors; of course, the processor may also be a component in an electronic device that may also include memory, a memory controller, one or more processing units (CPUs), a peripheral interface, RF circuitry, audio circuitry, speakers, a microphone, an input/output (I/O) subsystem, a touch screen, other output or control devices, and an external port. These components communicate over one or more communication buses or signal lines. The electronic device also includes a power system for powering the various components. The power system may include a power management system, one or more power sources (e.g., battery, alternating Current (AC)), a charging system, a power failure detection circuit, a power converter or inverter, a power status indicator (e.g., a Light Emitting Diode (LED)), and any other components associated with power generation, management, and distribution in a portable device. Including, but not limited to, a laptop computer, a tablet computer, a mobile phone, a smartphone, a media player, a Personal Digital Assistant (PDA), and the like, as well as combinations of two or more thereof.
According to the liquid level measuring method, the liquid level measuring device and the storage medium, the original image in the liquid level pipe is obtained, the original image is processed, and then the liquid level height in the liquid level pipe is directly obtained, so that manual intervention is not needed, the liquid level measuring process is greatly simplified, and the liquid level measuring efficiency is improved; meanwhile, the problem of inaccurate liquid level height caused by human factors is avoided, so that the liquid level measurement precision is improved; furthermore, the cost of liquid level measurement is greatly reduced because manual processing is not needed.
The above embodiments are merely illustrative of the principles and utilities of the present application and are not intended to limit the present application. Any person skilled in the art can modify or change the above-described embodiments without departing from the spirit and scope of the present application. Accordingly, it is intended that all equivalent modifications or changes which may be made by those skilled in the art without departing from the spirit and technical spirit of the present disclosure be covered by the claims of the present application.

Claims (13)

1. A liquid level measuring method, comprising:
acquiring an original image of the liquid level pipe by using a contact type image sensor;
preprocessing the original image to obtain a target image, wherein the target image comprises a liquid level image;
acquiring the coordinate position of the liquid level image in the target image;
and acquiring the liquid level height in the liquid level pipe according to the coordinate position.
2. The method of claim 1, wherein the step of pre-processing the raw image to obtain a target image comprises:
filtering the original image through a spatial filter to obtain a filtered image;
and carrying out image binarization processing on the filtered image to obtain the target image.
3. The liquid level measuring method according to claim 2, wherein after the filtered image is subjected to image binarization processing, the binarized image is subjected to morphological processing, and the morphologically processed image is taken as the target image.
4. The method of claim 2, wherein the step of filtering the raw image through a spatial filter to obtain a filtered image comprises:
carrying out mean filtering on the original image through a mean filter;
carrying out bilateral filtering on the image subjected to the mean filtering through a bilateral filter;
and taking the image subjected to bilateral filtering as the filtered image.
5. The method of claim 1, wherein after the step of pre-processing the raw image to obtain a target image, comprising: and judging whether the flatness of the liquid level image accords with a preset threshold value, and acquiring the coordinate position of the liquid level image in the target image when the flatness of the liquid level image is smaller than the preset threshold value.
6. The method of claim 1, wherein the step of obtaining a coordinate position of the level image in the target image comprises:
acquiring edge data of the liquid level image based on an edge detection algorithm;
carrying out Hough transform on the edge data to obtain an edge line segment, and taking the average value of the endpoint coordinates of the edge line segment as the coordinate position of the liquid level image in the target image; or the like, or, alternatively,
acquiring each pixel data corresponding to the edge data based on a vertical projection mode;
and taking the average value of each pixel data as the coordinate position of the liquid level image in the target image.
7. The method of claim 1, wherein the step of obtaining the level of the liquid in the level tube from the coordinate position comprises:
acquiring a physical scale corresponding to a single pixel based on the image width of the target image and the physical scale corresponding to the target image;
and taking the product of the physical scale corresponding to the single pixel and the coordinate position as the liquid level height.
8. The method of claim 1, wherein after the step of obtaining the level of the fluid in the fluid level tube from the coordinate position, the method further comprises: and displaying the liquid level height.
9. The method of claim 8, wherein the step of displaying the fluid level height comprises: and judging whether the liquid level height is smaller than an alarm threshold value or not, and displaying the liquid level height when the liquid level height is smaller than the alarm threshold value.
10. The method of claim 1, wherein the step of acquiring a raw image of the fluid level tube using the contact image sensor comprises: starting the contact type image sensor based on an operation instruction to acquire an original image of the liquid level pipe; or, starting the contact image sensor in real time or in a timing mode to acquire an original image of the liquid level pipe.
11. A liquid level measuring device, comprising: the device comprises a liquid level pipe, a contact type image sensor, a collecting card and a processor;
the contact type image sensor is arranged on one side of the liquid level pipe and used for collecting images of the liquid level pipe under the control of the collecting card;
the acquisition card transmits the acquired image to the processor;
the processor comprises a memory in which a computer program is stored which, when being executed by the processor, carries out the steps of the method according to any one of claims 1 to 10 for obtaining the level of the liquid in the liquid level tube.
12. The fluid level measurement device of claim 11, further comprising: a light source; the light source is positioned on the other side of the liquid level pipe and is arranged opposite to the contact type image sensor.
13. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of a method according to any one of claims 1 to 10.
CN202110842888.3A 2021-07-26 2021-07-26 Liquid level measuring method and device and storage medium Pending CN115683267A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110842888.3A CN115683267A (en) 2021-07-26 2021-07-26 Liquid level measuring method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110842888.3A CN115683267A (en) 2021-07-26 2021-07-26 Liquid level measuring method and device and storage medium

Publications (1)

Publication Number Publication Date
CN115683267A true CN115683267A (en) 2023-02-03

Family

ID=85044584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110842888.3A Pending CN115683267A (en) 2021-07-26 2021-07-26 Liquid level measuring method and device and storage medium

Country Status (1)

Country Link
CN (1) CN115683267A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117647295A (en) * 2024-01-30 2024-03-05 合肥金星智控科技股份有限公司 Machine vision-based molten pool liquid level measurement method, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117647295A (en) * 2024-01-30 2024-03-05 合肥金星智控科技股份有限公司 Machine vision-based molten pool liquid level measurement method, electronic equipment and storage medium
CN117647295B (en) * 2024-01-30 2024-05-14 合肥金星智控科技股份有限公司 Machine vision-based molten pool liquid level measurement method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109360396B (en) Remote meter reading method and system based on image recognition technology and NB-IoT technology
CN115908269B (en) Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN107918216B (en) Image Mura defect evaluation method and system and readable storage medium
CN109507192B (en) Magnetic core surface defect detection method based on machine vision
JP5121389B2 (en) Ultrasonic diagnostic apparatus and method for measuring the size of an object
CN109523527B (en) Method and device for detecting dirty area in image and electronic equipment
CN109583299B (en) Electronic device, certificate identification method, and storage medium
CN106920233A (en) Scratch detection method, device and electronic equipment based on image procossing
CN115205223B (en) Visual inspection method and device for transparent object, computer equipment and medium
CN117274722B (en) Intelligent detection method for distribution box based on infrared image
CN109693387A (en) 3D modeling method based on point cloud data
CN107014818B (en) Laser etching defect visual detection system and method
CN111221996B (en) Instrument screen vision detection method and system
CN106845545B (en) Image recognition method and device in automatic digital electric meter calibration device
WO2017050082A1 (en) Method for determining terminal position and terminal equipment
CN114782451B (en) Workpiece defect detection method and device, electronic equipment and readable storage medium
Jaffery et al. Architecture of noninvasive real time visual monitoring system for dial type measuring instrument
CN110706182A (en) Method and device for detecting flatness of shielding case, terminal equipment and storage medium
CN116468726B (en) Online foreign matter line detection method and system
CN115683267A (en) Liquid level measuring method and device and storage medium
CN116797590A (en) Mura defect detection method and system based on machine vision
CN116165216A (en) Liquid crystal display micro scratch flaw 3D detection method, system and computing equipment
CN115829929A (en) Method, device and equipment for detecting defects of product surface image and storage medium
CN117058154A (en) Defect identification method, system and medium for 3DP metal printing powder spreading process
CN116128849A (en) Method, device, equipment and storage medium for detecting underwater cracks of concrete dam

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination