CN116182988A - Automatic liquid level detection method, device and equipment for transparent container - Google Patents

Automatic liquid level detection method, device and equipment for transparent container Download PDF

Info

Publication number
CN116182988A
CN116182988A CN202310200813.4A CN202310200813A CN116182988A CN 116182988 A CN116182988 A CN 116182988A CN 202310200813 A CN202310200813 A CN 202310200813A CN 116182988 A CN116182988 A CN 116182988A
Authority
CN
China
Prior art keywords
row
transparent container
liquid level
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.)
Granted
Application number
CN202310200813.4A
Other languages
Chinese (zh)
Other versions
CN116182988B (en
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.)
Guangzhou Institute of Technology
Original Assignee
Guangzhou Institute of Technology
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 Guangzhou Institute of Technology filed Critical Guangzhou Institute of Technology
Priority to CN202310200813.4A priority Critical patent/CN116182988B/en
Publication of CN116182988A publication Critical patent/CN116182988A/en
Application granted granted Critical
Publication of CN116182988B publication Critical patent/CN116182988B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • 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/10004Still image; Photographic 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/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Abstract

The invention belongs to the technical field of machine vision, and discloses a method, a device and equipment for automatically detecting the liquid level of a transparent container.

Description

Automatic liquid level detection method, device and equipment for transparent container
Technical Field
The invention belongs to the technical field of machine vision, and particularly relates to a method, a device and equipment for automatically detecting the liquid level of a transparent container based on machine vision.
Background
In industrial production lines, quality inspection and research laboratories, metering and quantitative sampling are often required. The solid material is typically measured by weighing, and the solution is sampled by volumetric means. The volumetric method is a method of measuring the volume of the content using a transparent gauge (such as a measuring cylinder, a measuring flask, a measuring tube, etc.) marked with a capacity indication. The measuring is realized by comparing the distance between the liquid level of the liquid in the container and the container wall volume scale (or capacity scale, hereinafter collectively referred to as scale). When the bottom of the liquid level is horizontally tangent to the upper edge of the marking, the corresponding magnitude is the volume of the liquid in the container. In order to allow clear observation of the liquid surface, the container is generally made of transparent material.
Machine vision is one of the key technologies of artificial intelligence, being the "eye" of the machine to perceive the external environment, interact with the outside world, and make decisions. In recent years, "machine vision+detection" has been paid attention to and studied by a large number of workers, mainly by using machine vision to perform digital, pointer-type, and level-type automatic readings. The method is a technology for identifying a target and acquiring target characteristic information through image processing based on a mapping relation between reality and an image so as to finish detection. As a measuring activity of the level type, the machine vision detects the liquid volume to obtain the characteristic information of the distance between the liquid level bottom and the container marking, and the key point is to identify the image detection target, namely the liquid level.
For transparent containers, the liquid within the container and the background outside the container are able to be imaged by the machine vision system through the container. When a colorless transparent liquid is filled in the container, the liquid cannot be imaged, but the liquid level can be captured and imaged by the camera due to reflection strong light, so that a highlight pattern is formed, and obvious characteristics are provided for image target identification.
According to the measurement specifications, the liquid level observation should take a head-up posture, i.e., the camera should be almost level with the liquid level. In this case, the liquid surface morphology becomes a key for image formation. According to the infiltration effect of liquid on the container and the surface tension, the liquid level shape generally has three conditions of concave-down, convex-up and no obvious concave-convex. Because the concave-convex curved surface is provided with a reflecting surface with continuous angles, incident light rays can always be reflected out in the horizontal direction, and camera imaging is ensured. The image taken with the camera at the level of the reticle of a 250ml volumetric flask, with the water level just set (tangential to the upper edge of the reticle), is shown in fig. 1. Obviously, the characteristic of the highlighting gray level of the liquid level is quite obvious, and the liquid level is easy to identify. However, for the case of no obvious concave-convex on the liquid surface, no obvious highlighting feature like a plane, when the camera is photographed under the same head-up condition, the reflected light of the liquid surface cannot enter the camera to form an image, at this time, the liquid surface will "disappear" in the image, and the machine vision is difficult to recognize the image through the gray feature. As shown in FIG. 2, another 500ml volumetric flask was imaged with the vision system of FIG. 1 down-set, and little liquid level was observed in the volumetric flask of FIG. 2.
It can be seen that the existing machine vision liquid level detection method based on the target gray level features is only suitable for the situation that liquid level imaging shows significant highlight features, but is not suitable for the situation that no significant highlight features exist, and the limitation of influence of liquid level forms is large.
Disclosure of Invention
The invention aims to provide an automatic liquid level detection method, device and equipment for a transparent container, which can be used for automatically detecting the liquid level without being influenced by the liquid level form and without obvious highlight characteristics, thereby improving the success rate of automatic liquid level detection of the transparent container.
The first aspect of the invention discloses an automatic liquid level detection method of a transparent container, which comprises the following steps:
controlling the photographing module to photograph the transparent container to obtain an image to be measured; wherein, in the shooting direction of the shooting module, a marker is arranged behind the transparent container; the cross section of the transparent container is circular;
determining a target characteristic region from the image to be detected;
if the target characteristic area accords with the preset characteristic, determining the position of the liquid level according to the target characteristic area; the marker is cut into two sections of sub-imaging, and the two sections of sub-imaging are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
The second aspect of the present invention discloses an automatic liquid level detection device for a transparent container, comprising:
the shooting unit is used for controlling the shooting module to shoot the transparent container to obtain an image to be detected; wherein, in the shooting direction of the shooting module, a marker is arranged behind the transparent container; the cross section of the transparent container is circular;
the identification unit is used for determining a target characteristic area from the image to be detected;
the positioning unit is used for determining the position of the liquid level according to the target characteristic region when the target characteristic region accords with a preset characteristic; the marker is cut into two sections of sub-imaging, and the two sections of sub-imaging are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
A third aspect of the invention discloses an electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor invokes the executable program code stored in the memory for performing the method for automatically detecting the liquid level of the transparent container disclosed in the first aspect.
A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the liquid level automatic detection method of the transparent container disclosed in the first aspect.
The automatic liquid level detection method, device and equipment for the transparent container have the advantages that the marker is arranged behind the transparent container in the shooting direction of the shooting module, the cross section of the transparent container is round, the marker can be shot through the transparent container when the shooting module shoots the transparent container, when the transparent container is filled with liquid, the transparent container with the round cross section has the imaging property of the convex lens due to the fact that the liquid medium is filled in the transparent container, the marker is mapped through the liquid filling part of the transparent container, the situation that the marker is cut into two sub-imaging sections in an image and the two sub-imaging sections are distributed on two sides of the central axis of the transparent container in an anti-symmetrical mode can be shown, therefore the characteristic can be set to be preset, when the target characteristic area in a shot image to be detected accords with the preset characteristic, the detected liquid level is judged, and the position of the liquid level can be determined according to the target characteristic area. Therefore, by implementing the invention, the liquid level can be automatically detected without being influenced by the liquid level shape and without obvious highlight characteristics, thereby improving the success rate of automatic detection of the liquid level of the transparent container.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles and effects of the invention.
Unless specifically stated or otherwise defined, the same reference numerals in different drawings denote the same or similar technical features, and different reference numerals may be used for the same or similar technical features.
FIG. 1 is a plan view of a 250ml volumetric flask with its level set, according to an embodiment of the present invention;
FIG. 2 is a plan view of a 500ml volumetric flask according to an embodiment of the present invention after the level of the flask has been set;
FIG. 3 is a flow chart of an automatic liquid level detection method for a transparent container according to an embodiment of the present invention;
FIG. 4 is an image processing area in the case where there is no apparent unevenness of the liquid surface as disclosed in the embodiment of the invention;
FIG. 5 is an image processing area in the case of a liquid level depression as disclosed in an embodiment of the present invention;
FIG. 6 is a schematic view showing the structure of an automatic liquid level detection device for a transparent container according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Reference numerals illustrate:
601. a photographing unit; 602. an identification unit; 603. a positioning unit; 701. a memory; 702. a processor.
Detailed Description
In order that the invention may be readily understood, a more particular description of specific embodiments thereof will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
Unless defined otherwise or otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. In the context of a realistic scenario in connection with the technical solution of the invention, all technical and scientific terms used herein may also have meanings corresponding to the purpose of the technical solution of the invention. The terms "first and second …" are used herein merely for distinguishing between names and not for describing a particular number or order. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
It will be understood that when an element is referred to as being "fixed" to another element, it can be directly fixed to the other element or intervening elements may also be present; when an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present; when an element is referred to as being "mounted to" another element, it can be directly mounted to the other element or intervening elements may also be present. When an element is referred to as being "disposed on" another element, it can be directly on the other element or intervening elements may also be present.
As used herein, unless specifically stated or otherwise defined, "the" means that the feature or technical content mentioned or described before in the corresponding position may be the same or similar to the feature or technical content mentioned. Furthermore, the terms "comprising," "including," and "having," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Clearly, technical contents or features that are contrary to the object of the present invention or that are clearly contradictory should be excluded.
As shown in fig. 3, the embodiment of the invention discloses an automatic liquid level detection method of a transparent container. The execution main body of the method can be electronic equipment such as a computer, a notebook computer, a tablet computer and the like, or a liquid level automatic detection device of a transparent container embedded in the electronic equipment, and the invention is not limited to the above. The method comprises the following steps 110-130:
110. and controlling the photographing module to photograph the transparent container to obtain an image to be measured.
In the embodiment of the invention, a marker is arranged behind a transparent container in the shooting direction of a shooting module, and the cross section of the transparent container is circular. The purpose of liquid level detection is achieved by utilizing the rule of influence of the transparent container on the imaging of the introduced marker. Specifically, the length direction of the marker is parallel to or intersects with the axial direction of the transparent container. Preferably, in this embodiment, the length direction of the marker is parallel to the axial direction of the transparent container. But not limited thereto, in other possible embodiments, the length direction of the marker may also be disposed obliquely with respect to the axial direction of the transparent container, i.e., the extension lines of the two may intersect. The marker can be a strip marker with a regular shape or an irregular shape, preferably a line belt can be used as the marker, and the marker is vertically arranged at the rear of the transparent container, and the installation position is suitable for the line belt shot by a shooting module (such as an industrial camera) to be positioned in the range of the transparent container and to be properly deviated from the central axis of the transparent container by a certain distance.
When the transparent container is not filled with liquid, the line area in the image to be measured, which is shot by the camera through the container bottle, is a continuous bar chart. After the transparent liquid is injected into the transparent container, the line area in the image to be detected, which is shot by the camera, is a bar chart which is cut into an upper section and a lower section, and the two sections are staggered in parallel. The gradient of the staggered part is abrupt, and the gradient characteristic is obvious. In fact, a transparent container of circular cross section has the imaging properties of a convex lens due to the filling of the liquid medium. Thus, according to the convex lens imaging principle, the line strap will form an "inverted" real image at the camera through the liquid filled portion of the transparent container. By inverted, it is meant that the object is in an "antisymmetric" relationship with the image about the optical axis. Because the camera is opposite to the transparent container, the optical axis of the camera is the central axis of the transparent container. In the image to be measured, the upper and lower bar patterns are distributed on two sides of the central axis of the transparent container in an antisymmetric relation. When the line strap is positioned on the left side of the central axis, the imaging is on the right side; when the ribbon is to the right of the central axis, the imaging is to the left. When the line belt deviates from the central axis more, the imaging deviates from the central axis more, and the deviation distance of the line belt and the imaging is the same.
However, the hollow container does not have convex lens imaging properties, and the line strap forms an "erect" real image at the camera through the hollow portion of the transparent container (here the processing of the imaging system inside the camera is omitted), i.e. the object is on the same side of the central axis as the image. Thus, for a transparent container with less than full filling, the line will image just above the liquid surface and will image inversely below the liquid surface, thus forming an interface between the two images. When the line belt deviates from the optical axis, the positive image and the reverse image deviate from the optical axis in opposite directions, are staggered in parallel and are respectively arranged on two sides of the central axis of the transparent container to form a vertical step shape. Based on the above, in the machine vision image processing, when the line belt in the image to be detected is detected to have a step in the radial direction of the transparent container, the liquid level is judged to be possibly encountered.
In addition, to reduce background interference, it is desirable to use a black light absorbing background and a white line strap and install an illumination source above the industrial camera.
120. And determining a target characteristic region from the image to be detected.
Specifically, step 120 may specifically include: and detecting a connected domain with the largest length in each row of the image to be detected as a row connected domain, thereby obtaining a plurality of row connected domains, and then obtaining a target characteristic region (at least comprising a marker region, such as the line zone region) of the image to be detected according to the plurality of row connected domains.
In order to further reduce the amount of computation, the computation speed is increased. When detecting the connected domain with the largest length in each line of the image to be detected, the captured image to be detected may be converted into a gray scale image, and the region of interest is cut out from the gray scale image with a preset frame, for example, a rectangular region is selected as the region of interest (regionof interest, ROI), such as the rectangular region in fig. 4. The ROI should avoid the container walls, since the transparent container walls may interfere with detection. Accordingly, after the ROI is intercepted, only the connected domain with the largest length in each row of the region of interest is detected as the row connected domain, so that the operation amount can be reduced.
Further, after obtaining the target feature region of the image to be measured according to the plurality of line connected regions, the following steps 121 to 123 may be further performed:
121. and acquiring the abscissa information of the position mark points of each row of connected domains in the radial direction of the transparent container.
The start point or the end point of each row connected domain may be designated as a position mark point, or a position of 1/5, 1/4, 1/3, 1/2, 3/4, or 3/5, 4/5 length of each row connected domain may be designated as a position mark point. In the embodiment of the present invention, it is preferable to use the 1/2 length as the position mark point, that is, the midpoint of each row of connected domains as the position mark point for marking the marker, and the abscissa information of the position mark point in the radial direction of the transparent container is denoted as (x) i I) is a row number, i=0, 1,2 …. Finally, the plurality of line connected domains included in the target feature region are simplified to a set of coordinate points.
122. And calculating the gradient value of each row of connected domains in the radial direction of the transparent container, wherein the gradient value is calculated according to the respective abscissa information of each row of connected domains and the adjacent next row of connected domains.
And calculating a gradient value corresponding to each row of connected domains in the radial direction of the transparent container according to the abscissa information, wherein the gradient value is used for representing the gradient between each row of connected domains and the next row of connected domains adjacent to the row of connected domains. For example, the gradient value corresponding to the ith row connected domain is Deltax i =|x i+1 -x i |。
123. If the gradient value of any row of connected domains is larger than a specified threshold value, judging that the target characteristic region accords with the preset characteristic.
By using features of large step gradientsWhen Deltax is detected i When > delta (delta is a specified threshold), then it is determined that the value (x i I) steps exist, namely, the target characteristic area is judged to accord with the preset characteristic. The preset feature is that the marker is cut into two sections of sub-imaging which are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
130. And if the target characteristic region accords with the preset characteristic, determining the position of the liquid level according to the target characteristic region.
Specifically, in the embodiment of the present invention, determining the position of the liquid level according to the target feature area in step 130 may include the following steps 1301 to 1302:
1301. and determining the line connected domain with the gradient value larger than the specified threshold value as a first target line domain.
1302. And determining the position of the liquid level according to the abscissa information corresponding to the first target row domain.
That is, after the target feature region is determined to meet the preset feature, the position of the liquid level can be determined according to the target feature region, and Δx is determined i The i-th row connected domain of > delta is determined as the first target row domain, and then the coordinate points (x i I) determining directly as the position of the liquid surface.
In summary, by implementing the embodiment of the invention, the liquid level can be automatically detected based on the method of external reference imaging characteristics even if the liquid level has no obvious concave-convex characteristic and no obvious highlight characteristic like the liquid level of a plane, so that the aim of enhancing the target characteristics is fulfilled by adding the marker, the success rate of identifying the image processing target is improved, and the success rate of automatically detecting the liquid level of the transparent container is further improved.
Further, in the case of a concave liquid surface, the concave liquid surface in the image appears as a highlight meniscus, considering that the concave liquid surface will reflect strong light into a curved surface, as shown in fig. 5. The larger the liquid surface depression, the larger the meniscus. The meniscus may cause a number of gradients to occur in detecting a step greater than a specified threshold, i.e. more than one step may occur. Based on this, in some preferred embodiments, the step 1302 may specifically include the following steps 13021-13023:
13021. it is determined whether the number of first target row fields is one or greater than one.
If the number of the first target line fields is one, which indicates that the liquid level has no obvious concave-convex and static plane, and the step has only one step, step 13022 is executed; if the number of first target rows is greater than one, indicating that there may be a dishing, step 13023 is performed if there is more than one step.
13022. And if the number of the first target row fields is one, determining the abscissa information corresponding to the first target row fields as liquid level position information.
13023. If the number of the first target row fields is larger than one, determining the first target row field which is the lowest in the axial direction of the transparent container from the plurality of first target row fields as a second target row field, and determining the abscissa information corresponding to the second target row field as liquid level position information.
According to the rule that the real liquid level is required to be taken from the lowest point of the meniscus, when a plurality of steps are detected, the position where the liquid level is actually located at the lowest step in the axial direction of the transparent container can be determined, namely, the lowest position in the axial direction is determined from a plurality of detected first target line fields to be used as a second target line field, and the abscissa information corresponding to the second target line field is determined to be liquid level position information.
In machine vision inspection algorithm implementation, as a preferred embodiment, the following steps may be employed:
(1) Detecting leucorrhea: converting the shot image to be detected into a gray level map, selecting a rectangular region as an ROI, and detecting a communication domain with the biggest length of highlighting (gray level value of 255) from top to bottom line by line as a line communication domain of the line; and the midpoint of each row connected domain is used as a position mark point, and the abscissa information of the position mark point in the radial direction of the transparent container is marked as (x) i I) is a row number, i=0, 1,2 …. Finally, the plurality of line connected domains is reduced to a set of coordinate points.
(2) Detecting steps: calculating the gradient value corresponding to each row connected domain as Deltax i =|x i+1 -x i I, utilize the stepLarge gradient feature, when Δx is detected i When > delta (delta is a specified threshold), then it is determined that the value (x i I) steps exist, and gradient values corresponding to all row connected domains are formed into a gradient array [ delta x ] i ]。
(3) Judging the liquid level: from the gradient array [ Δx ] i ]Finding out the last step or the first step larger than the specified threshold delta in reverse order, and finding out the corresponding coordinate point (x i I) is the position of the real liquid level.
If the liquid surface is depressed, a plurality of gradients greater than a specified threshold may occur in detecting the steps, i.e., more than one step. Typically, there are 2 steps. One is the abrupt change from the last line of the line to the first line of the surface, and one is the abrupt change from the last line of the surface to the line imaging.
According to the preferred embodiment, gradient calculation is performed by directly traversing a plurality of row connected domains, the situation that the liquid level in an image is a meniscus with a certain size, and more than one step meeting gradient conditions is possible is considered, and according to the rule that the real liquid level is required to be taken from the lowest point of the liquid level recess, a method for determining the position of the real liquid level by adopting the last step meeting the conditions in the sequence or the first step meeting the conditions in the reverse sequence in a gradient array is provided, so that decision basis is provided for machine vision. That is, the method is applicable to both a liquid surface form without obvious irregularities and a liquid surface recessed form, and thus the robustness of the liquid surface automatic detection method based on machine vision is improved.
As shown in fig. 6, an embodiment of the present invention discloses an automatic liquid level detection device for a transparent container, which includes a photographing unit 601, an identification unit 602, and a positioning unit 603, wherein,
the shooting unit 601 is used for controlling the shooting module to shoot the transparent container to obtain an image to be detected; wherein, in the shooting direction of the shooting module, a marker is arranged at the rear of the transparent container; the cross section of the transparent container is circular;
an identifying unit 602, configured to determine a target feature area from an image to be detected;
the positioning unit 603 is configured to determine, when the target feature area meets a preset feature, a position of the liquid level according to the target feature area; the marker is cut into two sections of sub-imaging, and the two sections of sub-imaging are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
As an alternative embodiment, the identification unit 602 may include the following sub-units, not shown:
the detection subunit is used for detecting the connected domain with the largest length in each row of the image to be detected to obtain a plurality of row connected domains;
and the identification subunit is used for obtaining the target feature area of the image to be detected according to the plurality of row connected domains.
As an alternative embodiment, the automatic liquid level detection device for a transparent container further includes the following means, not shown:
the marking unit is used for acquiring the abscissa information of the position marking points of each row of connected domains in the radial direction of the transparent container after the identification subunit acquires the target characteristic region of the image to be detected according to the plurality of rows of connected domains;
the calculating unit is used for calculating the gradient value of each row of connected domains in the radial direction of the transparent container, and the gradient value is obtained by calculating according to the respective abscissa information of each row of connected domains and the adjacent next row of connected domains;
and the judging unit is used for judging that the target characteristic region accords with the preset characteristic when the gradient value of any row of connected region is larger than a specified threshold value.
Optionally, the positioning unit 603 includes the following sub-units, not shown:
the determining subunit is used for determining a row connected domain with a gradient value larger than a specified threshold value as a first target row domain when the target feature region accords with the preset feature;
and the positioning subunit is used for determining the position of the liquid level according to the abscissa information corresponding to the first target row domain.
Optionally, the positioning subunit includes the following modules, not shown:
the judging module is used for judging whether the number of the first target row domains is one or more than one;
the positioning module is used for determining the abscissa information corresponding to the first target line domain as liquid level position information when the judging module judges that the number of the first target line domain is one; and determining the first target row domain which is the lowest in the axial direction of the transparent container from the plurality of first target row domains as a second target row domain when the judging module judges that the number of the first target row domains is more than one; and determining the abscissa information corresponding to the second target row domain as liquid level position information.
As shown in fig. 7, an embodiment of the present invention discloses an electronic device including a memory 701 storing executable program code and a processor 702 coupled to the memory 701;
wherein the processor 702 invokes the executable program code stored in the memory 701 to perform the automatic liquid level detection method of the transparent container described in the above embodiments.
The embodiments of the present invention also disclose a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the liquid level automatic detection method of the transparent container described in the above embodiments.
The foregoing embodiments are provided for the purpose of exemplary reproduction and deduction of the technical solution of the present invention, and are used for fully describing the technical solution, the purpose and the effects of the present invention, and are used for enabling the public to understand the disclosure of the present invention more thoroughly and comprehensively, and are not used for limiting the protection scope of the present invention.
The above examples are also not an exhaustive list based on the invention, and there may be a number of other embodiments not listed. Any substitutions and modifications made without departing from the spirit of the invention are within the scope of the invention.

Claims (10)

1. The automatic liquid level detection method for the transparent container is characterized by comprising the following steps:
controlling the photographing module to photograph the transparent container to obtain an image to be measured; wherein, in the shooting direction of the shooting module, a marker is arranged behind the transparent container; the cross section of the transparent container is circular;
determining a target characteristic region from the image to be detected;
if the target characteristic area accords with the preset characteristic, determining the position of the liquid level according to the target characteristic area; the marker is cut into two sections of sub-imaging, and the two sections of sub-imaging are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
2. The method for automatically detecting the liquid level of a transparent container according to claim 1, wherein determining a target feature area from the image to be detected comprises:
detecting a connected domain with the largest length in each row of the image to be detected, and obtaining a plurality of row connected domains;
and obtaining the target characteristic region of the image to be detected according to the plurality of row connected domains.
3. The automatic liquid level detection method of a transparent container according to claim 2, wherein after obtaining the target feature region of the image to be measured from a plurality of line connected regions, the method further comprises:
acquiring abscissa information of position mark points of each row of connected domains in the radial direction of the transparent container;
calculating a gradient value of each row of connected domains in the radial direction of the transparent container, wherein the gradient value is calculated according to respective abscissa information of each row of connected domains and the next adjacent row of connected domains;
and if the gradient value of any row of connected domains is larger than a specified threshold value, judging that the target characteristic region accords with a preset characteristic.
4. The automatic liquid level detection method of a transparent container according to claim 3, wherein determining the position of the liquid level based on the target feature area comprises:
determining a line connected domain with a gradient value larger than a specified threshold value as a first target line domain;
and determining the position of the liquid level according to the abscissa information corresponding to the first target row domain.
5. The method for automatically detecting the liquid level of a transparent container according to claim 4, wherein determining the position of the liquid level based on the abscissa information corresponding to the first target line field comprises:
judging whether the number of the first target row fields is one or more than one;
if the number of the first target row fields is one, determining the abscissa information corresponding to the first target row fields as liquid level position information;
if the number of the first target row fields is greater than one, determining the first target row field which is the lowest in the axial direction of the transparent container from the plurality of first target row fields as a second target row field; and determining the abscissa information corresponding to the second target row domain as liquid level position information.
6. The method for automatically detecting the liquid level of a transparent container according to any one of claims 2 to 5, wherein detecting the connected domain having the largest length in each line of the image to be detected to obtain a plurality of line connected domains, comprises:
converting the image to be detected into a gray level image;
intercepting a region of interest from the gray scale map with a preset frame;
and detecting the connected domain with the largest length in each row of the region of interest to obtain a plurality of row connected domains.
7. Automatic liquid level detection device of transparent container, its characterized in that includes:
the shooting unit is used for controlling the shooting module to shoot the transparent container to obtain an image to be detected; wherein, in the shooting direction of the shooting module, a marker is arranged behind the transparent container; the cross section of the transparent container is circular;
the identification unit is used for determining a target characteristic area from the image to be detected;
the positioning unit is used for determining the position of the liquid level according to the target characteristic region when the target characteristic region accords with a preset characteristic; the marker is cut into two sections of sub-imaging, and the two sections of sub-imaging are distributed on two sides of the central axis of the transparent container in an antisymmetric relation.
8. The automatic liquid level detection device for a transparent container according to claim 7, wherein the identification unit includes:
the detection subunit is used for detecting the connected domain with the largest length in each row of the image to be detected to obtain a plurality of row connected domains;
and the identification subunit is used for obtaining the target characteristic area of the image to be detected according to the plurality of row connected domains.
9. The automatic liquid level detection device for a transparent container according to claim 8, further comprising:
the marking unit is used for acquiring the abscissa information of the position marking points of each row of connected domains in the radial direction of the transparent container after the identification subunit acquires the target characteristic region of the image to be detected according to the plurality of rows of connected domains;
the calculating unit is used for calculating a gradient value of each row of connected domains in the radial direction of the transparent container, and the gradient value is obtained by calculating according to the respective abscissa information of each row of connected domains and the next row of connected domains adjacent to the row of connected domains;
and the judging unit is used for judging that the target characteristic region accords with the preset characteristic when the gradient value of any row of connected domain is larger than a specified threshold value.
10. An electronic device comprising a memory storing executable program code and a processor coupled to the memory; the processor invokes the executable program code stored in the memory for performing the automatic liquid level detection method of the transparent container according to any one of claims 1 to 6.
CN202310200813.4A 2023-03-02 2023-03-02 Automatic liquid level detection method, device and equipment for transparent gauge Active CN116182988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310200813.4A CN116182988B (en) 2023-03-02 2023-03-02 Automatic liquid level detection method, device and equipment for transparent gauge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310200813.4A CN116182988B (en) 2023-03-02 2023-03-02 Automatic liquid level detection method, device and equipment for transparent gauge

Publications (2)

Publication Number Publication Date
CN116182988A true CN116182988A (en) 2023-05-30
CN116182988B CN116182988B (en) 2023-12-01

Family

ID=86446149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310200813.4A Active CN116182988B (en) 2023-03-02 2023-03-02 Automatic liquid level detection method, device and equipment for transparent gauge

Country Status (1)

Country Link
CN (1) CN116182988B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116977409A (en) * 2023-08-11 2023-10-31 盐城汇达玻璃仪器有限公司 Automatic marking method and system for glass product for metering
CN117078103A (en) * 2023-08-29 2023-11-17 南京图灵信息技术有限公司 Commodity quality monitoring data processing method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106052793A (en) * 2016-06-15 2016-10-26 天津大学 Machine vision based liquid level sub-quality product marking method
CN106052792A (en) * 2016-05-18 2016-10-26 湖南大学 Method and device for detecting liquid level of PET bottle based on machine vision
CN106197612A (en) * 2016-07-25 2016-12-07 江苏科技大学 A kind of transparent bottled liquid-level detecting method based on machine vision
TWI608221B (en) * 2016-09-06 2017-12-11 台灣智能機器人科技股份有限公司 Liquid level detecting system and method thereof
CN112085753A (en) * 2020-09-02 2020-12-15 广东海启星海洋科技有限公司 Water level monitoring method, equipment, medium and monitoring system based on image processing
CN113188633A (en) * 2021-04-27 2021-07-30 睿科集团(厦门)股份有限公司 Liquid level detection and measurement method based on machine vision
CN114037672A (en) * 2021-11-02 2022-02-11 联宝(合肥)电子科技有限公司 Image defect detection method and device and computer readable medium
CN114088157A (en) * 2021-11-18 2022-02-25 中冶赛迪技术研究中心有限公司 Molten steel liquid level detection method, system, equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106052792A (en) * 2016-05-18 2016-10-26 湖南大学 Method and device for detecting liquid level of PET bottle based on machine vision
CN106052793A (en) * 2016-06-15 2016-10-26 天津大学 Machine vision based liquid level sub-quality product marking method
CN106197612A (en) * 2016-07-25 2016-12-07 江苏科技大学 A kind of transparent bottled liquid-level detecting method based on machine vision
TWI608221B (en) * 2016-09-06 2017-12-11 台灣智能機器人科技股份有限公司 Liquid level detecting system and method thereof
CN112085753A (en) * 2020-09-02 2020-12-15 广东海启星海洋科技有限公司 Water level monitoring method, equipment, medium and monitoring system based on image processing
CN113188633A (en) * 2021-04-27 2021-07-30 睿科集团(厦门)股份有限公司 Liquid level detection and measurement method based on machine vision
CN114037672A (en) * 2021-11-02 2022-02-11 联宝(合肥)电子科技有限公司 Image defect detection method and device and computer readable medium
CN114088157A (en) * 2021-11-18 2022-02-25 中冶赛迪技术研究中心有限公司 Molten steel liquid level detection method, system, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄玲;张叶林;胡波;马兆敏;: "基于机器视觉的透明瓶装液体液位自动检测", 自动化与仪表, pages 57 - 60 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116977409A (en) * 2023-08-11 2023-10-31 盐城汇达玻璃仪器有限公司 Automatic marking method and system for glass product for metering
CN116977409B (en) * 2023-08-11 2024-01-30 盐城汇达玻璃仪器有限公司 Automatic marking method and system for glass product for metering
CN117078103A (en) * 2023-08-29 2023-11-17 南京图灵信息技术有限公司 Commodity quality monitoring data processing method and device
CN117078103B (en) * 2023-08-29 2024-02-13 南京图灵信息技术有限公司 Commodity quality monitoring data processing method and device

Also Published As

Publication number Publication date
CN116182988B (en) 2023-12-01

Similar Documents

Publication Publication Date Title
CN116182988B (en) Automatic liquid level detection method, device and equipment for transparent gauge
US6098029A (en) Liquid-level position measuring method and system
CN108759973B (en) Water level measuring method
JP5664152B2 (en) Imaging device, in-vehicle imaging system, and object identification device
JP4933689B2 (en) Measurement mark evaluation method, object surveying method, and measurement mark
US20090107234A1 (en) System and method for measuring liquid level by image
JP3793100B2 (en) Information processing method, apparatus, and recording medium
US20080205748A1 (en) Structural light based depth imaging method and system using signal separation coding, and error correction thereof
CN102047290B (en) Image processing device, image processing program, image processing method, and electronic device
US11210773B2 (en) Information processing apparatus, information processing method, and storage medium for defect inspection and detection
JP6556675B2 (en) Object detection method and apparatus
CN114005108A (en) Pointer instrument degree identification method based on coordinate transformation
CN108492327A (en) AOI image matching methods, system, readable storage medium storing program for executing and smart machine
CN108632604B (en) Method and device for detecting optical center of lens
CN109931906A (en) Video camera distance measuring method, device and electronic equipment
CN111442845A (en) Infrared temperature measurement method and device based on distance compensation and computer storage medium
CN112036409A (en) Reading identification method and device of liquid level meter
JP2015059768A (en) Level difference measuring device, level difference measuring method and program
JP2001281046A (en) Measuring method and device for water level
JPH07333039A (en) Method for measuring liquid level position using image processing
JP2007212238A (en) Water level detector and water level detection method using it
KR101174820B1 (en) Apparatus for measuring dynamic displacement of floating structure and vision-based unit thereof
CN109040724A (en) A kind of the hot spot Distortion Detect method, apparatus and readable storage medium storing program for executing of structured light projection device
CN110322680B (en) Single parking space detection method, system, terminal and storage medium based on designated points
CN115330832A (en) Computer vision-based transmission tower full-freedom displacement monitoring system and method

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
GR01 Patent grant
GR01 Patent grant