A liquid flow standard device based on machine vision liquid level detection
By using a machine vision liquid level detection system in the liquid flow standard device, the liquid level height in the measuring cylinder is automatically read, which solves the problem of large errors in manual reading in the prior art, and achieves higher accuracy and reliability, simplifies the Verification process.
Patent Information
- Application Number
- CN202411124006.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-08-16
AI Technical Summary
When the existing liquid flow standard devices read the liquid volume in the measuring cylinder, they are prone to increase uncertainty due to manual reading errors, especially the liquid concave phenomenon is difficult to accurately measure.
Using a liquid level detection system based on machine vision, the liquid level height in the measuring cylinder is automatically read through the visual detection system, and the liquid level height is accurately measured by industrial cameras and vertical drive components, and the actual calculation is calculated through the preset volume flow calculation strategy. The flow rate of liquid through the flow rate.
It reduces errors caused by manual readings, improves measurement accuracy and reliability, simplifies the verification process, improves work efficiency, and reduces the impact of lens distortion on readings.
Smart Images

Figure CN118670487B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of liquid flow measurement, and in particular to a liquid flow standard device based on machine vision liquid level detection. Background Art
[0002] Before leaving the factory, the liquid flow meter needs to be calibrated by a flow standard device to determine whether its metering performance meets the requirements. Establishing a reliable liquid flow standard device is a prerequisite for the accurate operation of the liquid flow meter. Common liquid flow standard devices include mass method, volumetric method, standard table method, piston method, etc. Among them, the working principle of the dynamic volumetric method liquid flow standard device is: the liquid enters the measuring cylinder through the meter being tested. When the liquid level of the measuring cylinder reaches the pre-calibrated starting liquid level, the timing starts, and when the liquid level reaches the pre-calibrated ending liquid level, the timing stops. The volume flow value of the device during this period is calculated and compared with the flow value of the meter being tested. For a volumetric liquid flow standard device, it is relatively difficult to accurately read the volume of the liquid. Especially for the liquid concave surface phenomenon in the measuring cylinder, the manual reading method can easily bring errors to the measurement results and increase the uncertainty. Summary of the invention
[0003] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a liquid flow standard device based on machine vision liquid level detection, which utilizes a visual detection system to automatically read the liquid level in a measuring cylinder and reduce the error of manual reading.
[0004] To achieve the above object, the present invention provides the following technical solutions:
[0005] A liquid flow standard device based on machine vision liquid level detection, comprising:
[0006] Gas tanks, liquid tanks, throttle valves, measuring cylinders and liquid level measuring components,
[0007] The liquid storage tank stores liquid, the throttle valve is connected between the liquid storage tank and the measuring cylinder, the gas storage tank introduces a gas with stable and adjustable pressure into the liquid storage tank to squeeze the liquid into the measuring cylinder, and a flow meter is arranged between the throttle valve and the measuring cylinder.
[0008] The liquid level measurement component is arranged on one side of the measuring cylinder. The liquid level detection component is equipped with a visual detection system to detect the liquid level height in the measuring cylinder and calculate the actual liquid flow rate flowing through the flowmeter according to a preset volume flow calculation strategy.
[0009] Furthermore, the visual inspection system includes a vertical drive component and an industrial camera, the vertical drive component drives the industrial camera to move up and down in a direction parallel to the height of the measuring cylinder, the industrial camera captures an image of the measuring cylinder to be defined as preliminary test image information, and determines whether the liquid level is within a preset effective area according to a liquid level judgment strategy, if the liquid level is within the preset effective area, the preliminary test image information is used as valid test image information and the measuring cylinder reading is read according to a preset liquid level search algorithm, if the liquid level is higher than or intersects with the upper edge of the effective area, an ascending signal is generated to enable the drive component to drive the industrial camera to move upward until the liquid level is within the preset effective area, if the liquid level is lower than or intersects with the lower edge of the effective area, a descending signal is generated to enable the drive component to drive the industrial camera to move downward until the liquid level is within the preset effective area.
[0010] Furthermore, the visual inspection system is configured with a result threshold, and the liquid level judgment strategy includes drawing two image sampling areas at a preset position of the preliminary test image information and drawing two parallel lines as liquid level boundary lines, and taking the area between the two liquid level boundary lines as the effective area. The two image sampling areas are located outside the effective area, and the boundaries of the two image sampling areas coincide with one of the liquid level boundary lines. Feature processing is performed on the two image sampling areas respectively. If the first processing result of one of the image sampling areas is greater than the result threshold, the second processing result of the other image sampling area is less than the result threshold, and the difference between the first processing result and the second processing result is greater than the preset difference, then it is determined that the liquid level is within the preset effective area.
[0011] Furthermore, the method for processing the features of the image sampling area includes extracting the average grayscale value, the result threshold is specifically the grayscale threshold, the image sampling area located above is defined as the first image sampling area, and the image sampling area located below is defined as the second image sampling area, if the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than a preset difference, and the average of the first processing result and the second processing result is less than the grayscale threshold, then the falling signal is generated, if the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than the preset difference, and the average of the first processing result and the second processing result is greater than the grayscale threshold, then the rising signal is generated.
[0012] Furthermore, the liquid level search algorithm includes identifying a plurality of parallel line segments in the effective test image information as a parallel group, and the parallel line group located in the effective area is used as a reading reference line.
[0013] Performing edge detection in the effective test image information to obtain the liquid surface boundary,
[0014] An auxiliary line segment parallel to the reading reference line and tangent to the liquid surface boundary is made in the effective test image information, and the relative position of the auxiliary line segment and the reading reference line is obtained to obtain the measuring cylinder reading.
[0015] Furthermore, the calculation formula of the volume flow calculation strategy is as follows:
[0016] ,
[0017] in, is the cross-sectional area of the measuring cylinder, is the liquid height at two moments, is the time interval, express Liquid flow rate during a time interval.
[0018] Furthermore, the vertical drive assembly includes a driving member, a linear guide and a slider, the linear guide is vertically arranged, the slider is slidably connected to the linear guide, the driving member drives the slider to move vertically, the output direction of the driving member is adjustable to change the moving direction of the slider, the industrial camera and the slider are fixedly connected, a light source is fixedly connected to the industrial camera, and the light emitting direction of the light source is toward the side of the vector cylinder.
[0019] Beneficial effects of the present invention:
[0020] 1. The present invention uses a visual detection system to quickly measure the liquid level in the measuring cylinder, reducing the error caused by manual reading. During the calibration process, the liquid level at any two moments is recorded, and the volume of liquid entering the cavity during the period can be calculated, thereby calculating the liquid volume flow rate through the flow meter being tested. The calibration process is simple and convenient, and the visual detection system can be used to repeatedly read the liquid level in the measuring cylinder, which is convenient for multiple calibrations and has high work efficiency.
[0021] 2. The present invention, through the setting of a visual detection system, draws a liquid level boundary line and two image sampling areas in the preliminary test image information to determine whether the liquid surface is located between the liquid level boundary lines. If not, a driving component is used to drive the camera to move upward or downward until the liquid surface is located between the liquid level boundary lines, and only performs feature processing on the two image sampling areas. The image processing amount is small, which facilitates the visual detection system to respond quickly, improves the computing speed, reduces the influence of lens distortion on the reading, and uses an algorithm to calculate the reading of the low point of the liquid level boundary to reduce the reading error. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a working principle diagram of the liquid flow standard device in the present invention;
[0023] Figure 2 It is a structural schematic diagram of the visual detection system in the present invention;
[0024] Figure 3 is a schematic diagram of an image sampling area and a liquid level boundary line in the preliminary test image information of the present invention;
[0025] Figure 4 This is a flow chart of liquid level tracking and measurement in this embodiment 1.
[0026] Figure numerals: 1. gas storage tank; 11. pressure reducing valve; 12. stop valve; 2. liquid storage tank; 21. constant temperature box; 3. throttle valve; 4. flow meter; 5. measuring cylinder; 6. driving part; 7. linear guide; 71. slider; 8. industrial camera; 9. light source. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] It should be noted that when a component is referred to as being "fixed to" another component, it may be directly on the other component or there may also be a component centered. When a component is considered to be "connected to" another component, it may be directly connected to the other component or there may also be a component centered. When a component is considered to be "set on" another component, it may be directly set on the other component or there may also be a component centered. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0030] Embodiment 1:
[0031] like Figure 1-4As shown, a liquid flow standard device based on machine vision liquid level detection in this embodiment includes a gas storage tank 1, a liquid storage tank 2, a throttle valve 3, a measuring cylinder 5 and a liquid level measurement component. Liquid is stored in the liquid storage tank 2, and the throttle valve 3 is connected between the liquid storage tank 2 and the measuring cylinder 5. The gas storage tank 1 introduces a gas with stable and adjustable pressure into the liquid storage tank 2 to squeeze the liquid into the measuring cylinder 5, and the flowmeter 4 is arranged between the throttle valve 3 and the measuring cylinder 5. The detection principle is specifically that the gas in the gas storage tank 1 is introduced into the liquid storage tank 2, and the squeezed liquid flows through the throttle valve 3 and the flowmeter 4 and then enters the measuring cylinder 5. A pressure reducing valve 11 and a stop valve 12 are also installed on the connecting pipeline between the gas storage tank 1 and the liquid storage tank 2. The liquid storage tank 2 and the flowmeter 4 are respectively placed in a constant temperature box 21 to prevent the temperature from affecting the detection results. The liquid medium stored in the liquid storage tank 2 can be a transparent liquid such as water or alcohol. In order to avoid the change of the liquid level caused by the volatilization of the liquid medium, a volatile agent can be added to the liquid medium.
[0032] The liquid level measurement component is arranged on one side of the measuring cylinder 5 , and the liquid level detection component is equipped with a visual detection system to detect the liquid level in the measuring cylinder 5 , and calculate the actual liquid flow rate flowing through the flow meter 4 according to the preset volume flow meter 4 calculation strategy.
[0033] like Figure 2 As shown, the vertical drive assembly includes a drive member 6, a linear guide rail 7 and a slider 71. The linear guide rail 7 is vertically arranged, and the slider 71 is slidably connected to the linear guide rail 7. The drive member 6 drives the slider 71 to move vertically. The output direction of the drive member 6 can be adjusted to change the moving direction of the slider 71. The industrial camera 8 is fixedly connected to the slider 71. A light source 9 is fixedly connected to the industrial camera 8, and the light emitting direction of the light source 9 is toward the side of the vector cylinder 5.
[0034] Furthermore, accurate measurement of the liquid level requires ensuring that the actual interface between the liquid and the air is in the middle of the effective field of view of the image. The image content is judged by an algorithm to determine whether the current position of the industrial camera 8 needs to be adjusted. The visual inspection system includes a vertical drive component and an industrial camera 8. The vertical drive component drives the industrial camera 8 to move up and down in a direction parallel to the height of the measuring cylinder 5. The industrial camera 8 captures the image of the measuring cylinder 5 to be defined as preliminary test image information. According to the liquid level judgment strategy, it is judged whether the liquid level is within the preset effective area. If the liquid level is within the preset effective area, the preliminary test image information is used as the effective test image information and the measuring cylinder 5 reading is read according to the preset liquid level search algorithm. If the liquid level is higher than or intersects with the upper edge of the effective area, an upward signal is generated to enable the drive component to drive the industrial camera 8 to move upward until the liquid level is within the preset effective area. If the liquid level is lower than or intersects with the lower edge of the effective area, a downward signal is generated to enable the drive component to drive the industrial camera 8 to move downward until the liquid level is within the preset effective area.
[0035] Further, the visual detection system is configured with a result threshold. The liquid level judgment strategy includes drawing two image sampling areas at preset positions in the preliminary test image information and drawing two parallel lines as the liquid level boundary lines, taking the area between the two liquid level boundary lines as the effective area. The two image sampling areas are located outside the effective area, and the boundaries of the two image sampling areas coincide with one of the liquid level boundary lines. Feature processing is respectively performed on the two image sampling areas. If the first processing result of one image sampling area is greater than the result threshold, the second processing result of the other image sampling area is less than the result threshold, and the difference between the first processing result and the second processing result is greater than the preset difference degree, it is determined that the liquid level is within the preset effective area. The image sampling area located above is defined as the first image sampling area A, the image sampling area located below is defined as the second image sampling area B, and the liquid level dividing line located above is defined as L a , and the liquid level dividing line located below is defined as L b . When the liquid level is between the upper and lower liquid level dividing lines, the contents contained in areas A and B are air and liquid respectively, with the largest difference; if the position of the camera is too high or too low, the contents of A and B are both liquid or both air, and the feature difference is the smallest.
[0036] In this embodiment, the method for feature processing of the image sampling area is not limited. As Figure 4 shown, the function f() represents the feature processing result of a certain area, T is the result threshold, and it is assumed that the processing result of the air area is less than T, while the processing result of the liquid area is greater than T. Since A is above B, there is a relationship f(A) ≤ f(B). The content corresponding to A or B is judged according to the results of comparing f(A) and f(B) with T respectively, so as to control whether the camera needs to move and the moving direction. When f(A) < T and f(B) > T are satisfied, it is considered that the liquid level is between the dividing lines L a and L b , and at this time, the distortion degree of the area where the image target is located is the smallest. When f(A) < T and f(B) < T are satisfied, it is considered that the liquid level is below Lb, and the industrial camera needs to move downward. When f(A) > T and f(B) > T are satisfied, it is considered that the liquid level is above La, and the industrial camera needs to move upward.
[0037] Further, the liquid level search algorithm includes identifying several parallel line segments in the effective test image information as a parallel group, the parallel line group located in the effective area as the reading reference line, performing edge detection in the effective test image information to obtain the liquid level boundary, making an auxiliary line segment parallel to the reading reference line and tangent to the liquid level boundary in the effective test image information, and obtaining the relative position between the auxiliary line segment and the reading reference line to obtain the measuring cylinder reading.
[0038] Further, the calculation formula of the volume flow calculation strategy is as follows:
[0039] ,
[0040] in, is the cross-sectional area of the measuring cylinder, is the liquid height at two moments, is the time interval, express Liquid flow rate during a time interval.
[0041] Embodiment 2:
[0042] In this embodiment, the method for processing the image sampling area features is limited, and is specifically set to extract the average gray value of the image sampling area. The result threshold is specifically a gray threshold. If the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than a preset difference, and the average of the first processing result and the second processing result is less than the gray threshold, a falling signal is generated. If the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than a preset difference, and the average of the first processing result and the second processing result is greater than the gray threshold, a rising signal is generated.
[0043] Working principle:
[0044] The gas in the gas tank 1 forms a stable and adjustable pressure after passing through the pressure reducing valve 11 and the stop valve 12. In the liquid tank 2, the gas pressure pushes the liquid (such as water or alcohol) to flow outward, and the flow rate is controlled by adjusting the opening of the throttle valve 3. The calculation formula of the theoretical flow rate is as follows:
[0045] ,
[0046] In the formula, Q represents the flow rate, C is the flow coefficient, and A is the cross-sectional area of the throttle valve. is the pressure difference on both sides of the throttle valve, is the density of the liquid. It can be seen that when the opening of the throttle valve is fixed and the gas pressure upstream of the liquid storage tank is kept constant, the flow rate of the liquid will remain constant. The liquid enters the measuring cylinder after passing through the flow meter. By recording the liquid level in the measuring cylinder at two times, the volume flow rate passing through the flow meter can be calculated:
[0047] ,
[0048] In the formula, is the cross-sectional area of the measuring cylinder, is the liquid height at two moments, is the time interval, express Liquid flow rate during a time interval.
[0049] In the present application, the liquid passes through the meter under test and enters the measuring cylinder 5. When the liquid level in the measuring cylinder 5 reaches a pre-calibrated starting level, the timing starts, and the timing stops when the liquid level reaches a pre-calibrated ending level. The volume flow value of the device during this period is calculated and compared with the flow value of the meter under test.
[0050] The above are only preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A liquid flow standard device based on machine vision liquid level detection, characterized in that: include Gas tanks, liquid tanks, throttle valves, measuring cylinders and liquid level measuring components, The liquid storage tank stores liquid, the throttle valve is connected between the liquid storage tank and the measuring cylinder, the gas storage tank introduces a gas with stable and adjustable pressure into the liquid storage tank to squeeze the liquid into the measuring cylinder, and a flow meter is arranged between the throttle valve and the measuring cylinder. The liquid level measurement component is arranged on one side of the measuring cylinder, and the liquid level measurement component is equipped with a visual detection system to detect the liquid level in the measuring cylinder, and calculate the actual liquid flow rate flowing through the flow meter according to a preset volume flow calculation strategy; The visual inspection system includes a vertical drive component and an industrial camera, wherein the vertical drive component drives the industrial camera to move up and down in a direction parallel to the height of the measuring cylinder, the industrial camera captures an image of the measuring cylinder to be defined as preliminary test image information, and determines whether the liquid level is within a preset effective area according to a liquid level judgment strategy; if the liquid level is within the preset effective area, the preliminary test image information is used as the effective test image information and the measuring cylinder reading is read according to a preset liquid level search algorithm; if the liquid level is higher than or intersects with the upper edge of the effective area, an ascending signal is generated to enable the drive component to drive the industrial camera to move upward until the liquid level is within the preset effective area; if the liquid level is lower than or intersects with the lower edge of the effective area, a descending signal is generated to enable the drive component to drive the industrial camera to move downward until the liquid level is within the preset effective area; The visual inspection system is configured with a result threshold, and the liquid level judgment strategy includes drawing two image sampling areas at the preset position of the preliminary test image information and drawing two parallel lines as liquid level boundary lines, and taking the area between the two liquid level boundary lines as the effective area. The two image sampling areas are located outside the effective area, and the boundaries of the two image sampling areas coincide with one of the liquid level boundary lines. Feature processing is performed on the two image sampling areas respectively. If the first processing result of one of the image sampling areas is greater than the result threshold, the second processing result of the other image sampling area is less than the result threshold, and the difference between the first processing result and the second processing result is greater than the preset difference, then it is determined that the liquid level is within the preset effective area.
2. The liquid flow standard device based on machine vision liquid level detection according to claim 1 is characterized in that: The method for processing the features of the image sampling area includes extracting the average grayscale value, the result threshold is specifically the grayscale threshold, the image sampling area located above is defined as the first image sampling area, and the image sampling area located below is defined as the second image sampling area. If the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than a preset difference, and the average of the first processing result and the second processing result is less than the grayscale threshold, then the falling signal is generated; if the difference between the first processing result of the first image sampling area and the second processing result of the second image sampling area is less than the preset difference, and the average of the first processing result and the second processing result is greater than the grayscale threshold, then the rising signal is generated.
3. The liquid flow standard device based on machine vision liquid level detection according to claim 1 is characterized in that: The liquid level search algorithm includes identifying a plurality of parallel line segments in the effective test image information as a parallel group, and the parallel line group located in the effective area is used as a reading reference line. Performing edge detection in the effective test image information to obtain the liquid surface boundary, An auxiliary line segment parallel to the reading reference line and tangent to the liquid surface boundary is made in the effective test image information, and the relative position of the auxiliary line segment and the reading reference line is obtained to obtain the measuring cylinder reading.
4. The liquid flow standard device based on machine vision liquid level detection according to claim 1 is characterized in that: The calculation formula of the volume flow calculation strategy is as follows: , Among them, A1 is the cross-sectional area of the measuring cylinder, h1 and h2 are the heights of the liquid at two moments, is the time interval, Q v express Liquid flow rate during a time interval.
5. The liquid flow standard device based on machine vision liquid level detection according to claim 1 is characterized in that: The vertical drive assembly includes a driving member, a linear guide rail and a slider, the linear guide rail is vertically arranged, the slider is slidably connected to the linear guide rail, the driving member drives the slider to move vertically, the output direction of the driving member is adjustable to change the moving direction of the slider, the industrial camera is fixedly connected to the slider, a light source is fixedly connected to the industrial camera, and the light emitting direction of the light source is toward one side of the vector cylinder.
Citation Information
Patent Citations
Semi-automatic level gauge calibration device
CN108775948A
Head-up judgment method for the liquid level in measuring vessel based on image processing
CN112504383A
Liquid level meter calibration and detection device
CN113405635A