CN113947611A - Liquid level detection method and device, storage medium and electronic equipment - Google Patents

Liquid level detection method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113947611A
CN113947611A CN202111225851.2A CN202111225851A CN113947611A CN 113947611 A CN113947611 A CN 113947611A CN 202111225851 A CN202111225851 A CN 202111225851A CN 113947611 A CN113947611 A CN 113947611A
Authority
CN
China
Prior art keywords
image
target area
liquid level
preset
detection
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
CN202111225851.2A
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.)
Guangdong Power Grid Co Ltd
Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Dongguan Power Supply Bureau of Guangdong Power Grid 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 Guangdong Power Grid Co Ltd, Dongguan Power Supply Bureau of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202111225851.2A priority Critical patent/CN113947611A/en
Publication of CN113947611A publication Critical patent/CN113947611A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01FMEASURING VOLUME, VOLUME FLOW, MASS FLOW OR LIQUID LEVEL; METERING BY VOLUME
    • G01F23/00Indicating or measuring liquid level or level of fluent solid material, e.g. indicating in terms of volume or indicating by means of an alarm
    • G01F23/22Indicating or measuring liquid level or level of fluent solid material, e.g. indicating in terms of volume or indicating by means of an alarm by measuring physical variables, other than linear dimensions, pressure or weight, dependent on the level to be measured, e.g. by difference of heat transfer of steam or water
    • G01F23/28Indicating or measuring liquid level or level of fluent solid material, e.g. indicating in terms of volume or indicating by means of an alarm by measuring physical variables, other than linear dimensions, pressure or weight, dependent on the level to be measured, e.g. by difference of heat transfer of steam or water by measuring the variations of parameters of electromagnetic or acoustic waves applied directly to the liquid or fluent solid material
    • G01F23/284Electromagnetic waves
    • G01F23/292Light, e.g. infrared or ultraviolet
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20028Bilateral filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering

Abstract

The invention discloses a liquid level detection method, a liquid level detection device, a storage medium and electronic equipment. The method comprises the following steps: acquiring an infrared image of the liquid container; extracting a target area based on a preset graph and the infrared image to obtain a target area image; performing edge detection on the target area image to obtain an edge detection image corresponding to the target area; carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines; and drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary. According to the technical scheme, the target area extraction is carried out on the infrared image, so that the interference of image contents outside the target area can be reduced, and the subsequent processing is facilitated; the liquid level boundary is drawn through the liquid level pixel points, the method is simple and efficient, and the liquid level detection efficiency is further improved.

Description

Liquid level detection method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of target detection technologies, and in particular, to a liquid level detection method and apparatus, a storage medium, and an electronic device.
Background
The power transformer is an important component in a power system, is responsible for power transmission and electric energy grade conversion, and has important significance in the safe operation of the power transformer due to the detection of the liquid level of an oil conservator of the power transformer.
At present, the liquid level detection of electric quantities such as current quantity, voltage quantity and the like of equipment is very mature, but the same defect is very obvious, different sensors and electric power detection instruments are required to be adopted to detect the electric quantity many times, the method is not simple and efficient enough, and the detection efficiency is lower.
Disclosure of Invention
The embodiment of the invention provides a liquid level detection method and device, a storage medium and electronic equipment, and aims to improve the liquid level detection efficiency.
In a first aspect, an embodiment of the present invention provides a liquid level detection method, including:
acquiring an infrared image of the liquid container;
extracting a target area based on a preset graph and the infrared image to obtain a target area image;
performing edge detection on the target area image to obtain an edge detection image corresponding to the target area;
carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines;
and drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
In a second aspect, an embodiment of the present invention further provides a liquid level detecting device, including:
the image acquisition module is used for acquiring an infrared image of the liquid container;
the target area extraction module is used for extracting a target area based on a preset graph and the infrared image to obtain a target area image;
the edge detection module is used for carrying out edge detection on the target area image to obtain an edge detection image corresponding to the target area;
the liquid level pixel point determining module is used for carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines;
and the liquid level determining module is used for drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of level detection as described in any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the liquid level detection method according to any of the embodiments of the present invention.
According to the invention, the infrared image of the liquid container is obtained, and then the target area image is obtained by extracting the target area according to the preset image and the infrared image, so that the interference of image contents outside the target area can be reduced, and the subsequent processing is facilitated; further, edge detection is carried out on the target area image to obtain an edge detection image corresponding to the target area, gray level screening is carried out on the edge detection image based on the preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines, the infrared image is drawn based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary line, line segments are drawn through multiple points, and the positions of liquid levels are represented by the line segments.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
FIG. 1 is a schematic flow chart illustrating a liquid level detecting method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a liquid level detection method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a target area image determining method according to a second embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating a liquid level detecting method according to a third embodiment of the present invention;
fig. 5 is a flowchart of a method for selecting a liquid pixel point according to a third embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a liquid level detecting device according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.
It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a liquid level detection method according to an embodiment of the present invention, where the present embodiment is applicable to a case where liquid level detection is automatically performed according to a temperature state of a liquid container, and the method may be performed by a liquid level detection apparatus provided in an embodiment of the present invention, where the apparatus may be implemented by software and/or hardware, and the apparatus may be configured on an electronic computing device, for example, a terminal and/or a server. The method specifically comprises the following steps:
and S110, acquiring an infrared image of the liquid container.
The liquid container may be a container for storing liquid, for example, a transformer conservator, a solar water storage tank, or the like. The infrared image may be an image exhibiting a difference in temperature of the liquid container.
It can be understood that, inside the liquid container, there is a difference in temperature between the liquid part and the liquid-free part, and the liquid level boundary is located at the boundary position between the liquid part and the liquid-free part, so that the embodiment of the present invention can realize the liquid level detection by the infrared image of the liquid container.
Specifically, the liquid level detection device may be configured with an infrared image detection module, and an infrared image may be acquired in real time through the infrared image detection module in the liquid level detection device, in some embodiments, the infrared image detection module may be movable, and the movable infrared image detection module may capture infrared images of the liquid container at different angles, and may manually select an appropriate capture angle, so that the obtained infrared image includes the liquid container; in some embodiments, the infrared image detection module may be disposed at a preset position, and the preset position may be a position horizontally aligned with the liquid container, so as to avoid a situation where a liquid level determination is wrong due to inclination of a shooting angle.
And S120, extracting a target area based on a preset graph and the infrared image to obtain a target area image.
The preset pattern may be an image of any shape, and may include, but is not limited to, a circle and a rectangle. The target area may be a partial image of the liquid container, having the shape of a preset figure.
In the embodiment of the invention, the target area is extracted, the range of subsequent image processing is reduced, the speed of image processing is improved, and the interference of other components except the liquid container can be eliminated.
And S130, carrying out edge detection on the target area image to obtain an edge detection image corresponding to the target area.
Wherein the edge detection image may be an image having a plurality of edges. It can be understood that the main material of the liquid container is metal, and the metal has good thermal conductivity, so that the temperature in the target area image is in a gradual change state, and a plurality of temperature difference edge lines can be detected during edge detection. Operators used for edge detection include, but are not limited to, the Rebert operator, the Sobel operator, and the Laplacian operator.
S140, carrying out gray screening on the edge detection images based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines.
The preset detection line can be a line segment perpendicular to the horizontal direction of the edge detection image, is a virtual line segment, is not actually drawn, and is used for selecting pixel points on the position of the preset detection line in the edge detection image and performing gray level screening on the pixel points on the position of the preset detection line in the edge detection image.
The gray screening refers to screening the gray values of the pixels at the positions of the preset detection lines in the edge detection image, and in some embodiments, the pixel with the largest gray value can be selected as the liquid level pixel corresponding to the preset detection line. In some embodiments, a pixel point with a gray value within a preset gray value range may be selected as a liquid level pixel point corresponding to the preset detection line, which is not limited in the embodiments of the present invention.
S150, drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
Wherein the liquid level boundary is a boundary between a liquid portion and a non-liquid portion of the liquid container. Specifically, each liquid level pixel point can be fitted to obtain a fitted straight line, and the fitted straight line is drawn to the position corresponding to the infrared image to obtain the infrared image containing the liquid level boundary.
On the basis of the above embodiment, the drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines includes: dividing liquid level pixel points corresponding to each preset detection line into point set sets with preset number; fitting the pixel points in each point set to obtain a fitting straight line of each point set; respectively determining the distance difference value between each point set fitting straight line and the liquid level pixel point corresponding to each preset detection line, and screening a target fitting straight line based on each determined distance difference value; and drawing the infrared image based on the target fitting straight line.
Specifically, the liquid level pixel points corresponding to each preset detection line may be defined as a complete set including all liquid level pixel points, the point set is a subset set relative to the complete set, and each point set includes a plurality of liquid level pixel points. It should be noted that the point set sets may overlap, that is, each point set may include the same liquid level pixel points, which has the advantage of expanding the number of point set sets. Further, any point set in the point set sets can be selected to perform straight line fitting to obtain a point set fitting straight line of the point set, then distance differences between the point set fitting straight line and liquid level pixel points corresponding to the preset detection lines are calculated and superposed to obtain differences of the point set fitting straight line, then the differences of the point set fitting straight line are compared to screen out the point set fitting straight line with the minimum difference, the point set fitting straight line with the minimum difference is used as a target fitting straight line, and then the target fitting straight line is mapped to an infrared image to complete drawing of a liquid level boundary line. Through the scheme, the influence of deviation points or isolated points can be avoided, and the fitted straight line can more accurately represent the liquid level position.
Optionally, the drawing the infrared image based on the target fitting straight line specifically includes: two pixel points can be selected from the target fitting straight line, coordinates of the two pixel points in the infrared image are obtained, the coordinate of one pixel point is used as a starting point of the drawing straight line, the coordinate of the other pixel point is used as an end point of the drawing straight line, and then the two points are connected to finish the drawing of the liquid level boundary.
The embodiment of the invention provides a liquid level detection method, which is characterized in that an infrared image of a liquid container is obtained, and then a target area image is obtained by extracting a target area according to a preset image and the infrared image, so that the interference of image contents outside the target area can be reduced, and the subsequent processing is facilitated; further, edge detection is carried out on the target area image to obtain an edge detection image corresponding to the target area, gray level screening is carried out on the edge detection image based on the preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines, the infrared image is drawn based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary line, line segments are drawn through multiple points, and the positions of liquid levels are represented by the line segments.
Example two
Fig. 2 is a flow chart diagram of a liquid level detection method according to a second embodiment of the present invention, and based on the second embodiment, a target area image is further refined by performing "target area extraction based on a preset graph and the infrared image" to obtain the target area image. The specific implementation manner of the method can be seen in the detailed description of the technical scheme. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein. As shown in fig. 2, the method of the embodiment of the present invention specifically includes the following steps:
s210, acquiring an infrared image of the liquid container.
And S220, carrying out graying processing on the infrared image to obtain an infrared grayscale image.
The graying processing can convert an infrared image of the liquid container into an image with GRAY scale, the infrared GRAY scale image can be a GRAY scale image corresponding to the infrared image, the infrared GRAY scale image can be an image in GRAY format, and the infrared GRAY scale image has the same image morphological characteristic information as the infrared image.
It will be appreciated that the infrared image of the liquid container is a three-channel color image in which three channels store R, G, B three components of color information, respectively. The color image is obtained by dividing colors of the image based on an optical principle, so that the infrared image containing three channel data does not bring more morphological characteristics capable of reflecting the image than the gray-scale image containing single channel data, the infrared image is subjected to gray-scale processing, the image can be simplified, and the subsequent processing is more convenient.
Methods of gray scale processing include, but are not limited to, a maximum method, an average method, and a weighted average method. The maximum value method is to take the maximum value of R, G, B three components as the gray value of a single component to obtain an infrared gray image; the average value method is to average the brightness of R, G, B three components in the infrared image to obtain an infrared gray image; the weighted average method can adopt different weights to carry out weighted addition according to different gray processing requirements and aiming at different component information, so as to realize gray processing on the infrared image and obtain the infrared gray image.
And S230, extracting a target area of the infrared gray image based on a preset graph to obtain a target area image.
The infrared gray level image is subjected to target area extraction, so that the image processing range can be reduced, the image processing range is reduced, the liquid level detection speed is increased, and the interference of other components except the target area can be eliminated.
On the basis of the above embodiment, the extracting a target region of the infrared grayscale image based on a preset graph to obtain a target region image includes: traversing each pixel point in the infrared gray image, and if the distance from any pixel point in the infrared gray image to a preset graph meets the preset distance requirement, keeping the pixel point; and determining the target area image based on the reserved pixel points.
For example, as shown in fig. 3, fig. 3 is a flowchart of a method for determining a target area image, a preset graph may be a circle, a radius of the circle may be set to 100 pixel points, a center pixel point of an infrared gray image may be determined according to a length and a width of the infrared gray image, a position of the center pixel point of the infrared gray image is used as a center of the circle, then the circle is drawn on the infrared gray image according to the center of the circle and the radius, and a thickness degree and a color of a line segment of the circle may be preset. Further, the distance from each pixel point in the infrared gray image to the circle center is calculated, if the distance from the pixel point to the circle center is smaller than the circle radius, namely the distance from the pixel point to the circle center is smaller than 100 pixel points, the pixel point is reserved, if the distance from the pixel point to the circle center is not smaller than the circle radius, the pixel point is not reserved until traversal is completed, and a circular target area image is obtained.
S240, carrying out edge detection on the target area image to obtain an edge detection image corresponding to the target area.
And S250, carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines.
And S260, drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
The embodiment of the invention provides a liquid level detection method, which is characterized in that an infrared image of a liquid container is obtained, and the infrared image is subjected to graying processing to obtain an infrared grayscale image, so that the image can be simplified, and the subsequent processing is more convenient; furthermore, target area extraction is carried out on the infrared gray level image based on the preset graph to obtain a target area image, interference of image content outside the target area can be reduced, and accuracy of liquid level detection is improved.
EXAMPLE III
Fig. 4 is a schematic flow chart of a liquid level detection method provided in a third embodiment of the present invention, and the third embodiment of the present invention and various alternatives in the foregoing embodiments may be combined. In this embodiment of the present invention, optionally, the performing edge detection on the target area image to obtain an edge detection image corresponding to the target area includes: filtering the target area image to obtain a target area filtering image; and carrying out differential processing on the target area filtering image to obtain an edge detection image corresponding to the target area.
As shown in fig. 4, the method of the embodiment of the present invention specifically includes the following steps:
s310, acquiring an infrared image of the liquid container.
And S320, extracting a target area based on a preset graph and the infrared image to obtain a target area image.
And S330, filtering the target area image to obtain a target area filtering image.
The filtering process can eliminate or smooth the noise in the target area image as much as possible, and reduce the influence on the liquid level detection result, and the filtering process includes, but is not limited to, mean filtering, gaussian filtering, median filtering, and bilateral filtering. The average filtering method comprises the following specific steps: during each convolution, all the pixel points which are slipped by a filtering operator and all the pixel points around the field are added to calculate an average value, and the value is output to the pixel points which are arranged in the operator coverage, so that the filtering is realized; the Gaussian filtering method comprises the following specific steps: smoothing the image by adopting a filtering operator with low periphery and high middle part to ensure that the weight of the pixel point close to the center is high and the weight of the pixel point far away from the center is low, thereby obtaining a filtering image of a target area; the specific steps of median filtering are as follows: and setting the gray value of each pixel point as the median of the gray values of all the pixel points in a certain neighborhood window of the point, and filtering by taking the median as an output value, wherein the median filtering mode is favorable for removing salt and pepper noise and patch noise in the image. The bilateral filtering method comprises the following steps: the filtering is performed by adopting a weighted averaging mode, the weight is not only determined by the distance between pixels, but also determined by various differences between pixels, so the operation speed is low, and the filtering effect is good.
Preferably, in order to ensure a faster processing speed and less edge blur of the processed image, and better maintain image details, the embodiment of the present invention may adopt mean filtering. Illustratively, the size of an operator of the mean filtering during filtering may be set to 5, an operator of 5 × 5 is used to filter the image, meanwhile, after each calculation is completed, the image is sent to a preset pixel point, and finally, a result after the convolution is completed is output to a blank image, so as to obtain a target area filtering image.
And S340, carrying out differential processing on the target area filtering image to obtain an edge detection image corresponding to the target area.
The differential processing is a specific implementation method of edge detection, and the differential processing can detect the gray change rate in the target region filtering image by derivation and then determine an edge line segment according to the gray change rate, so that the edge detection image is an image containing a plurality of edge line segments. The differential processing method can be a Sobel algorithm, and the Sobel algorithm has a good image noise smoothing effect, so that the image processed by the Sobel algorithm is more accurate in the aspect of edge direction information.
On the basis of the foregoing embodiment, the differentiating the target region filtered image includes: and performing first-order differential processing on the target area filtering image in the vertical direction.
In the embodiments of the present invention. Because the liquid level is parallel to the ground, namely the line segment corresponding to the liquid level is in the horizontal direction, the reason for carrying out the first-order differential processing in the vertical direction is to only detect the edge line segment in the horizontal direction, and the advantage of the arrangement is that: the method can reduce differential calculation, improve the speed of differential processing, further improve the efficiency of liquid level detection, avoid the interference of edge line segments in the vertical direction and improve the accuracy of liquid level detection.
S350, comparing the gray values of all pixel points in any preset detection line of the edge detection image, and determining the maximum gray value in all the pixel points as a liquid level pixel point corresponding to the preset detection line.
In the embodiment of the invention, a plurality of detection lines are arranged in the edge detection image, so as to obtain the points with the maximum gray value on the detection lines, and the points may be the points on the liquid level boundary. The detection line is set in such a way that the noise of the image can cause the false detection of the boundary point, and the main reason of the false detection is that the gray scale change caused by the noise of the infrared image is very similar to the gray scale change caused by the liquid level, so that the result is difficult to distinguish, and the false detection point can greatly influence the result. In addition, the detection lines are not suitable to pass through the positions of the shielding objects, temperature differences which are not easy to observe are usually generated at the positions, the temperature differences are caused by the structural influence of the liquid container, the accuracy of the liquid level boundary point is influenced by the problem of uneven temperature distribution, so the detection lines are required to be arranged to avoid the shielding objects as far as possible, and when different shielding objects and structural characteristics are actually faced, the number of the detection lines can be properly reduced and increased in the edge detection image in order to achieve better detection effect.
For example, the preset detection line may be set by the following method: setting the coordinate of the central point of the target area image as (x)0,y0) Then the abscissa of the ith detection line on the left side thereof is
xi=x0-Δxi
The abscissa of the ith detection line on the right side thereof is
xi=x0+Δxi
Wherein, Δ xiDistance set for the ith detection line.
Fig. 5 is a flow chart of liquid pixel point selection, which specifically includes the steps of: traversing each line, defining a variable T and distributing an initial value, for example 0, sequentially comparing the value of the variable T with the gray value of each pixel point in the detection line, exchanging and storing the maximum value of the variable in each comparison, simultaneously recording the index value of the maximum value, continuously searching the next pixel point, and sequentially traversing until the end.
And S360, drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
The embodiment of the invention provides a liquid level detection method, which is characterized in that a target area image is filtered to obtain a target area filtered image, the filtering can eliminate noise in the target area image or smoothen the target area image as far as possible, the influence on a liquid level detection result is reduced, the target area filtered image is subjected to first-order differential processing in the vertical direction, only an edge line segment in the horizontal direction can be detected, differential calculation can be reduced, the speed of differential processing is increased, the efficiency of liquid level detection is increased, the interference of the edge line segment in the vertical direction can be avoided, and the accuracy of liquid level detection is increased.
Example four
Fig. 6 is a schematic structural diagram of a liquid level detection device according to a fourth embodiment of the present invention, where the liquid level detection device provided in this embodiment may be implemented by software and/or hardware, and may be configured in a terminal and/or a server to implement the liquid level detection method according to the fourth embodiment of the present invention. The device may specifically include: an image acquisition module 410, a target region extraction module 420, an edge detection module 430, a liquid level pixel point determination module 440, and a liquid level determination module 450.
The image acquisition module 410 is used for acquiring an infrared image of the liquid container; a target area extraction module 420, configured to perform target area extraction based on a preset graph and the infrared image to obtain a target area image; an edge detection module 430, configured to perform edge detection on the target area image to obtain an edge detection image corresponding to the target area; the liquid level pixel point determining module 440 is configured to perform gray level screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines; the liquid level determining module 450 is configured to draw the infrared image based on liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
The embodiment of the invention provides a liquid level detection device, which can reduce the interference of image contents outside a target area and facilitate subsequent processing by acquiring an infrared image of a liquid container and then extracting the target area according to a preset image and the infrared image to obtain a target area image; further, edge detection is carried out on the target area image to obtain an edge detection image corresponding to the target area, gray level screening is carried out on the edge detection image based on the preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines, the infrared image is drawn based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary line, line segments are drawn through multiple points, and the positions of liquid levels are represented by the line segments.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the target region extracting module 420 includes:
the gray processing unit is used for carrying out gray processing on the infrared image to obtain an infrared gray image;
and the target extraction unit is used for extracting a target area of the infrared gray level image based on a preset graph to obtain a target area image.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the target extraction unit may be further configured to:
traversing each pixel point in the infrared gray image, and if the distance from any pixel point in the infrared gray image to a preset graph meets the preset distance requirement, keeping the pixel point;
and determining the target area image based on the reserved pixel points.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the edge detection module 430 includes:
the image filtering unit is used for filtering the target area image to obtain a target area filtering image;
and the differential processing unit is used for carrying out differential processing on the target area filtering image to obtain an edge detection image corresponding to the target area.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the differential processing unit may be further configured to:
and performing first-order differential processing on the target area filtering image in the vertical direction.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the liquid level pixel point determining module 440 may further be configured to:
in any preset detection line of the edge detection image, comparing the gray values of all pixel points in the preset detection line, and determining the maximum gray value in all the pixel points as a liquid level pixel point corresponding to the preset detection line.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the liquid level determining module 450 may further be configured to:
dividing liquid level pixel points corresponding to each preset detection line into point set sets with preset number;
fitting the pixel points in each point set to obtain a fitting straight line of each point set;
respectively determining the distance difference value between each point set fitting straight line and the liquid level pixel point corresponding to each preset detection line, and screening a target fitting straight line based on each determined distance difference value;
and drawing the infrared image based on the target fitting straight line.
The liquid level detection device provided by the embodiment of the invention can execute the liquid level detection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 7 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 7 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in FIG. 7, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 36 having a set (at least one) of program modules 26 may be stored, for example, in system memory 28, such program modules 26 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 26 generally perform the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown in FIG. 7, the network adapter 20 communicates with the other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 7, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement a liquid level detection method provided by the present embodiment.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for detecting a liquid level, the method including:
acquiring an infrared image of the liquid container;
extracting a target area based on a preset graph and the infrared image to obtain a target area image;
performing edge detection on the target area image to obtain an edge detection image corresponding to the target area;
carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines;
and drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A liquid level detection method, comprising:
acquiring an infrared image of the liquid container;
extracting a target area based on a preset graph and the infrared image to obtain a target area image;
performing edge detection on the target area image to obtain an edge detection image corresponding to the target area;
carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines;
and drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
2. The method according to claim 1, wherein the extracting the target area based on the preset graph and the infrared image to obtain the target area image comprises:
carrying out graying processing on the infrared image to obtain an infrared gray image;
and extracting a target area of the infrared gray level image based on a preset graph to obtain a target area image.
3. The method according to claim 2, wherein the performing target area extraction on the infrared grayscale image based on a preset graph to obtain a target area image comprises:
traversing each pixel point in the infrared gray image, and if the distance from any pixel point in the infrared gray image to a preset graph meets the preset distance requirement, keeping the pixel point;
and determining the target area image based on the reserved pixel points.
4. The method according to claim 1, wherein the performing edge detection on the target area image to obtain an edge detection image corresponding to the target area comprises:
filtering the target area image to obtain a target area filtering image;
and carrying out differential processing on the target area filtering image to obtain an edge detection image corresponding to the target area.
5. The method of claim 4, wherein the differentiating the target region filtered image comprises:
and performing first-order differential processing on the target area filtering image in the vertical direction.
6. The method of claim 1, wherein the performing gray-scale screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to each of the preset detection lines comprises:
in any preset detection line of the edge detection image, comparing the gray values of all pixel points in the preset detection line, and determining the maximum gray value in all the pixel points as a liquid level pixel point corresponding to the preset detection line.
7. The method of claim 1, wherein the drawing the infrared image based on the liquid level pixel points corresponding to each of the preset detection lines comprises:
dividing liquid level pixel points corresponding to each preset detection line into point set sets with preset number;
fitting the pixel points in each point set to obtain a fitting straight line of each point set;
respectively determining the distance difference value between each point set fitting straight line and the liquid level pixel point corresponding to each preset detection line, and screening a target fitting straight line based on each determined distance difference value;
and drawing the infrared image based on the target fitting straight line.
8. A liquid level detection device, comprising:
the image acquisition module is used for acquiring an infrared image of the liquid container;
the target area extraction module is used for extracting a target area based on a preset graph and the infrared image to obtain a target area image;
the edge detection module is used for carrying out edge detection on the target area image to obtain an edge detection image corresponding to the target area;
the liquid level pixel point determining module is used for carrying out gray screening on the edge detection image based on a plurality of preset detection lines to obtain liquid level pixel points corresponding to the preset detection lines;
and the liquid level determining module is used for drawing the infrared image based on the liquid level pixel points corresponding to the preset detection lines to obtain a liquid level boundary.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of liquid level detection as claimed in any one of claims 1-7.
10. A storage medium containing computer executable instructions for performing the method of any one of claims 1 to 7 when executed by a computer processor.
CN202111225851.2A 2021-10-21 2021-10-21 Liquid level detection method and device, storage medium and electronic equipment Pending CN113947611A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111225851.2A CN113947611A (en) 2021-10-21 2021-10-21 Liquid level detection method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111225851.2A CN113947611A (en) 2021-10-21 2021-10-21 Liquid level detection method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113947611A true CN113947611A (en) 2022-01-18

Family

ID=79331972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111225851.2A Pending CN113947611A (en) 2021-10-21 2021-10-21 Liquid level detection method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113947611A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565848A (en) * 2022-02-25 2022-05-31 佛山读图科技有限公司 Liquid medicine level detection method and system in complex scene
CN115457067A (en) * 2022-11-09 2022-12-09 乐比(广州)健康产业有限公司 Nose-clearing and refreshing medicine liquid level detection method
CN116399418A (en) * 2023-05-29 2023-07-07 陕西省水利电力勘测设计研究院 Water level identification method and system based on fixed camera
CN117268498A (en) * 2023-11-20 2023-12-22 中国航空工业集团公司金城南京机电液压工程研究中心 Oil mass measurement method and system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565848A (en) * 2022-02-25 2022-05-31 佛山读图科技有限公司 Liquid medicine level detection method and system in complex scene
CN114565848B (en) * 2022-02-25 2022-12-02 佛山读图科技有限公司 Liquid medicine level detection method and system in complex scene
CN115457067A (en) * 2022-11-09 2022-12-09 乐比(广州)健康产业有限公司 Nose-clearing and refreshing medicine liquid level detection method
CN115457067B (en) * 2022-11-09 2023-04-07 乐比(广州)健康产业有限公司 Nose-clearing and refreshing medicine liquid level detection method
CN116399418A (en) * 2023-05-29 2023-07-07 陕西省水利电力勘测设计研究院 Water level identification method and system based on fixed camera
CN116399418B (en) * 2023-05-29 2023-10-27 陕西省水利电力勘测设计研究院 Water level identification method and system based on fixed camera
CN117268498A (en) * 2023-11-20 2023-12-22 中国航空工业集团公司金城南京机电液压工程研究中心 Oil mass measurement method and system
CN117268498B (en) * 2023-11-20 2024-01-23 中国航空工业集团公司金城南京机电液压工程研究中心 Oil mass measurement method and system

Similar Documents

Publication Publication Date Title
CN113947611A (en) Liquid level detection method and device, storage medium and electronic equipment
CN109360396B (en) Remote meter reading method and system based on image recognition technology and NB-IoT technology
US10373380B2 (en) 3-dimensional scene analysis for augmented reality operations
CN110781885A (en) Text detection method, device, medium and electronic equipment based on image processing
CN110176010B (en) Image detection method, device, equipment and storage medium
EP2660753B1 (en) Image processing method and apparatus
EP4044122A1 (en) Image processing method and apparatus, computer storage medium, and electronic device
CN110910445B (en) Object size detection method, device, detection equipment and storage medium
CN110298817A (en) Object statistical method, device, equipment and storage medium based on image procossing
CN113449639A (en) Non-contact data acquisition method for instrument by gateway of Internet of things
CN114220009A (en) Infrared image-based wire windage yaw identification method and system
CN111553927B (en) Checkerboard corner detection method, detection system, computer device and storage medium
CN106778822B (en) Image straight line detection method based on funnel transformation
CN117611525A (en) Visual detection method and system for abrasion of pantograph slide plate
WO2024016632A1 (en) Bright spot location method, bright spot location apparatus, electronic device and storage medium
CN114170367B (en) Method, apparatus, storage medium, and device for infinite-line-of-sight pyramidal heatmap rendering
EP4350638A1 (en) Detection method and system for base-station feeder line, and related apparatus
CN113505860B (en) Screening method and device for blind area detection training set, server and storage medium
CN115330803A (en) Surface defect data enhancement method and device, electronic equipment and storage medium
CN115601616A (en) Sample data generation method and device, electronic equipment and storage medium
CN105930813B (en) A method of detection composes a piece of writing this under any natural scene
CN113870292A (en) Edge detection method and device for depth image and electronic equipment
CN111047635B (en) Depth image-based plane touch method and device and touch system
CN114025089A (en) Video image acquisition jitter processing method and system
CN116416290A (en) Method and device for calculating speckle structure light depth and electronic equipment

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