Liquid void ratio measuring device and method based on image recognition
Through the liquid void ratio measurement method based on image recognition, the vertical speed of the bubble is calculated using binocular cameras and image processing technology, which solves the problem of low void ratio measurement accuracy in the prior art, and achieves efficient and accurate void ratio measurement.
Patent Information
- Application Number
- CN202510084919.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-04-25
AI Technical Summary
The existing gas-liquid two-phase flow void ratio measurement methods have limitations and are susceptible to the detection environment and equipment, resulting in the inability to guarantee the measurement accuracy.
Using a liquid void ratio measurement device and method based on image recognition, bubble moving images are captured by binocular cameras, and bubble feature points are extracted in combination with image processing technology, match bubble feature points, calculate the vertical velocity of the bubbles, and then determine the liquid void ratio.
Improves measurement accuracy and efficiency, is suitable for fast-flowing liquid environments, reduces the use of physical sensors, and reduces measurement costs and complexity.
Smart Images

Figure CN119880792A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fluid mechanics and image recognition, and in particular to a liquid void ratio measuring device and method based on image recognition. Background Art
[0002] The void fraction measurement of gas-liquid two-phase flow has important applications in petrochemical industry, energy and power, nuclear power and fluid mechanics experimental research; void fraction refers to the volume ratio of gas in gas-liquid two-phase fluid. Accurately measuring void fraction is of great significance for optimizing equipment design, improving production efficiency and ensuring safe operation.
[0003] At present, the main methods for detecting the void ratio of gas-liquid two-phase flow are: X-ray method, electrical method, ultrasonic method, pressure drop method, optical method, etc.; the X-ray method is a non-contact measurement that will not affect the flow characteristics and can penetrate solids. It is suitable for various complex pipeline structures, but the cost of its equipment is extremely high and there is a potential radiation hazard to operators and the environment; the electrical method has a simple structure and can measure local void ratio, but it has high requirements on the electrical conductivity of the liquid and gas phases. The measurement accuracy is affected by the electrode arrangement and flow pattern, and it is not applicable to non-conductive fluids; the ultrasonic method is a non-invasive measurement, but its sensor signal processing method is relatively complicated, and it is very sensitive to the surrounding environment and easily interfered by complex multiphase flow; the pressure drop method is only suitable for average void ratio measurement under specific conditions. , and the measurement accuracy cannot be guaranteed; the optical method has the characteristics of non-contact, non-invasive measurement and high precision. It can realize the porosity identification of complex flow through image processing technology. It is a potential method for gas-liquid two-phase flow parameter detection. However, some existing optical methods have limited application scope and have the problem of inaccurate boundary identification. For example, the multi-vision small channel gas-liquid two-phase flow parameter measurement system mentioned in patent CN104457703A can accurately identify bubbles, but its system cost is high and is only applicable to small pipelines. It is difficult to apply to complex fluids in large-scale industrial devices; therefore, a liquid porosity measurement method based on bubble image recognition is proposed, which has considerable reference value for the porosity parameter identification of gas-liquid two-phase flow. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a liquid porosity measurement device and method based on image recognition, which is used to solve the problem that the existing detection methods have high limitations and are easily affected by the detection environment and detection equipment, so that the measurement accuracy cannot be guaranteed.
[0005] To achieve the above objectives and other related objectives, the present invention provides the following technical solutions:
[0006] A liquid void ratio measuring device based on image recognition comprises a bubble generating device, a glass water tank, an LED array light source, a binocular camera and a computer; wherein the bubble generating device is used to generate bubbles in the glass water tank, the LED array light source is arranged on the side of the glass water tank, the binocular camera is arranged opposite to the glass water tank, and the binocular camera is parallel to the rising direction of the bubbles, and the binocular camera is electrically connected to the computer through a wire.
[0007] In one embodiment of the present invention, the bubble generating device includes an air compressor and a bubble generator installed in the glass water tank, and the air compressor is connected to the bubble generator through a gas connecting pipe.
[0008] A liquid porosity measurement method based on image recognition is applied to a processor in a computer, and the method comprises the following steps: obtaining a bubble motion image in a liquid captured by a binocular camera; preprocessing the bubble motion image, obtaining bubble contours in the bubble motion image according to the preprocessing result, and marking each bubble contour; extracting bubble feature points in the preprocessed bubble motion image, and describing the bubble feature points; matching bubble feature points in two adjacent frames of bubble motion images, obtaining a successfully matched bubble feature point pair according to the matching result, and obtaining matching bubbles in two adjacent frames of bubble motion images according to the successfully matched bubble feature point pair; determining the displacement of the matching bubble in the vertical direction of the bubble motion image and obtaining the time interval between adjacent frames, and determining the vertical speed of the matching bubble according to the displacement and the time interval; and obtaining the liquid porosity of the target area according to the vertical speed of the matching bubble.
[0009] In one embodiment of the present invention, before obtaining the bubble motion image in the liquid captured by the binocular camera, the method further includes: after pure water with a depth of h is introduced into the glass water tank, a bubble generating device is turned on to introduce compressed air with a pressure of P at a flow rate of Q into the water, so that bubbles can be generated in the glass water tank; an LED array light source is used to backlight the glass water tank to provide a high-contrast imaging environment for bubble image recognition, and then a binocular camera is used to capture the bubble motion image in the liquid at a rate of 1000 frames per second.
[0010] In one embodiment of the present invention, the bubble motion image is preprocessed, the bubble contour in the bubble motion image is obtained according to the preprocessing result, and each bubble contour is marked, including: graying the bubble motion image and performing Gaussian filtering, and performing edge detection on the bubble motion image after the image graying and Gaussian filtering, extracting the bubble contour in the bubble motion image according to the edge detection result, and marking each bubble contour.
[0011] In one embodiment of the present invention, the extracting of bubble feature points in the preprocessed bubble motion image and describing the bubble feature points include: drawing a circle with a radius of R around the pixels of the preprocessed bubble motion image, confirming whether the difference between the pixel values of N consecutive points on the circle with a radius of R and the pixel value at the center of the circle is greater than a threshold, and determining the bubble feature points in the preprocessed bubble motion image according to the confirmation result, wherein the threshold is set artificially; selecting n pairs of pixel points in the neighborhood of the bubble feature point, comparing the grayscale values of the n pairs of pixel points, generating a binary string with a length of n according to the comparison result, and using the binary string with a length of n as a feature descriptor.
[0012] In one embodiment of the present invention, the bubble feature points in two adjacent frames of bubble motion images are matched, and a successfully matched bubble feature point pair is obtained according to the matching result, and matching bubbles in two adjacent frames of bubble motion images are obtained according to the successfully matched bubble feature point pair, including: matching the bubble feature points in two adjacent frames of bubble motion images using a brute force matching algorithm, and a successfully matched bubble feature point pair is obtained according to the matching result, determining a matching rate according to the successfully matched bubble feature point pair through an ORB algorithm, and obtaining matching bubbles in two adjacent frames of bubble motion images according to the matching rate.
[0013] In one embodiment of the present invention, the method of determining the displacement of a matching bubble in a vertical direction of a bubble motion image and obtaining the time interval between adjacent frames, and determining the vertical speed of the matching bubble based on the displacement and the time interval, includes: determining the pixel displacement of a bubble feature point between two consecutive frames, obtaining the displacement of the matching bubble in the vertical direction of the bubble motion image based on the relationship between the pixel displacement and the physical length, and obtaining the time interval between adjacent frames, and determining the vertical speed of the matching bubble based on the displacement and the time interval.
[0014] In one embodiment of the present invention, the step of obtaining the liquid porosity of the target area according to the vertical velocity of the matching bubble includes: obtaining the liquid porosity of the target area according to the following formula: α = Q / (V y *S); where α is the liquid porosity in the glass water tank at the flow rate Q, Q is the flow rate of air introduced, V y is the velocity of the bubble in the vertical direction, and S is the area of the bubble generator.
[0015] As described above, the present invention provides a liquid porosity measurement device and method based on image recognition, which have the following beneficial effects: 1. Through optical imaging technology, the present invention will not interfere with the flow characteristics of the fluid, nor will it be affected by the fluid conductivity, temperature or pressure, which greatly improves the applicability and measurement reliability of the system; 2. The measurement method is simple to operate and the cost of setting up the measurement environment is low; 3. The present invention utilizes a high-speed camera and LED array backlighting, and realizes the recognition and tracking of bubble contours and movements through precise image recognition technology, which solves the limitation that traditional sensors are difficult to measure accurately; compared with traditional electrical methods, ultrasonic methods or ray methods, the present invention adopts non-contact optical imaging technology, which can obtain higher spatial resolution and time resolution, thereby improving the measurement accuracy of porosity; 4. The present invention uses LED array backlight technology in the bubble generation area to form a clear light and dark contrast between the bubble and the background, thereby improving the clarity of the bubble contour and the boundary recognition accuracy, and solving the problem of inaccurate optical recognition boundaries in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is an overall structural diagram of a liquid void fraction measuring device based on image recognition in a first embodiment of the present invention;
[0017] Figure 2 is a flow chart of a liquid void fraction measurement method based on image recognition in a second embodiment of the present invention;
[0018] Figure 3 It is an overall flow chart of the liquid void ratio measurement method based on image recognition in the present invention;
[0019] Figure 4 is a schematic diagram of bubbles photographed by a binocular camera in the present invention;
[0020] Figure 5 It is a schematic diagram of identifying and numbering bubbles in the present invention;
[0021] Figure 6 It is a schematic diagram of the measurement results of liquid void ratio based on image recognition in the present invention.
[0022] Component number description
[0023] 1. Air compressor; 2. Gas connecting pipe; 3. LED array light source; 4. Glass water tank; 5. Bubble generator; 6. Bubbles; 7. Binocular camera; 8. Computer. DETAILED DESCRIPTION
[0024] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0025] The first embodiment of the present invention relates to a liquid void ratio measuring device based on image recognition, see Figure 1 , including a bubble generating device, a glass water cylinder 4, an LED array light source 3, a binocular camera 7 and a computer 8; wherein the bubble generating device is used to generate bubbles 6 in the glass water cylinder 4, the bubble generating device includes an air compressor 1 and a bubble generator 5 installed in the glass water cylinder 4, the air compressor 1 is connected to the bubble generator 5 through a gas connecting pipe 2; the LED array light source 3 is arranged on the side of the glass water cylinder 4, wherein, in this embodiment, the number of the LED array light sources 3 is two, and a set of LED array light sources 3 is arranged on both sides of the glass water cylinder 4; the binocular camera 7 is arranged opposite to the glass water cylinder 4, and the binocular camera 7 is parallel to the rising direction of the bubbles 6, and the binocular camera 7 is electrically connected to the computer 8 through a wire.
[0026] The second embodiment of the present invention relates to a liquid porosity measurement method based on image recognition, the process is as follows: Figure 2 As shown, the details are as follows:
[0027] Step 101 , after pure water with a depth of h is introduced into the glass water tank 4 , the bubble generating device is turned on, and compressed air with a pressure of P at a flow rate of Q is introduced into the water, so that bubbles 6 can be generated in the glass water tank 4 .
[0028] Step 102, use the LED array light source 3 to backlight the glass water tank 4 to provide a high-contrast imaging environment for bubble image recognition, and then use the binocular camera 7 to capture the bubble movement image in the liquid at a rate of 1000 frames per second.
[0029] Specifically, the LED array light source 3 is used to backlight the glass water tank 4, providing a high-contrast imaging environment for bubble image recognition; and by illuminating the background with strong light, the edge of the bubble 6 will appear clearer, which makes the bubble 6 form a clear contrast against the dark background, thereby facilitating the recognition and tracking of the bubble 6 in image processing; the binocular camera captures the image of the bubble movement in the liquid, please refer to Figure 4 .
[0030] Step 103 , the processor in the computer 8 obtains the bubble motion image in the liquid captured by the binocular camera 7 .
[0031] Step 104 , preprocessing the bubble motion image, obtaining bubble contours in the bubble motion image according to the preprocessing result, and marking each bubble contour.
[0032] Specifically, the bubble motion image is first grayed and Gaussian filtered, and edge detection is performed on the grayed and Gaussian filtered bubble motion image. Then, bubble contours are extracted from the bubble motion image based on the edge detection results, and each bubble contour is marked. For details, please refer to Figure 5 .
[0033] More specifically, the process of graying the bubble motion image is as follows: converting the color bubble motion image into a grayscale image to facilitate subsequent processing; the process of Gaussian filtering the bubble motion image is as follows: applying Gaussian filtering to smooth the bubble motion image to reduce noise interference. smooth =G σ *I original , where I smooth is the image after Gaussian filtering, G σ is the Gaussian kernel, I original is the original image; the process of edge detection on the bubble motion image after image graying and Gaussian filtering is as follows: use the findContours method in OpenCV to extract the bubble contour. This method first binarizes the bubble motion image after image graying and Gaussian filtering, and then searches for non-zero value pixels from top to bottom and from left to right. With this point as the center, rotate counterclockwise to find the next non-zero value pixel, continuously update the pixel value, realize the extraction of bubble contours in the image, and mark each bubble contour.
[0034] Step 105 , extracting bubble feature points from the preprocessed bubble motion image and describing the bubble feature points.
[0035] Specifically, the ORB algorithm combines the OrientedFAST and RotatedBRIEF algorithms to quickly extract and describe bubble feature points. Based on the FAST algorithm, a circle with a radius of R is drawn around the pixels of the preprocessed bubble motion image, and the bubble feature points are determined by checking whether the difference between the pixel values of N consecutive points on the circle and the pixel value at the center of the circle is greater than the threshold T. Based on the BRIEF algorithm, n pairs of pixels (p i ,q i ), compare the grayscale values of these point pairs, generate a binary string of length n, and use the binary string of length n as the feature descriptor.
[0036] Step 106 , matching the bubble feature points in two adjacent frames of bubble motion images, obtaining a successfully matched bubble feature point pair according to the matching result, and obtaining matching bubbles in two adjacent frames of bubble motion images according to the successfully matched bubble feature point pair.
[0037] Specifically, a brute force matching algorithm is first used to match the bubble feature points in two adjacent frames of bubble motion images, and then the successfully matched bubble feature point pairs are obtained based on the matching results. Then, the ORB algorithm is used to determine the matching rate based on the successfully matched bubble feature point pairs, and then the matching bubbles in the two adjacent frames of bubble motion images are obtained based on the matching rate.
[0038] More specifically, a feature matcher is created: the bubble feature points in two adjacent frames of bubble motion images are matched, and the successfully matched bubble feature point pairs are recorded; bubble matching: for each bubble in the current bubble motion image, its matching feature points in the next bubble motion image are obtained through the ORB algorithm, and then the matching rate is calculated, and the bubble with the highest matching rate is selected as the matching bubble according to the calculated result.
[0039] Furthermore, after extracting the bubble feature points, feature point matching is performed on adjacent frames; in bubble recognition, this process is used to track the movement trajectory of the bubble. Through feature point matching of the ORB algorithm, the same bubble feature points between two adjacent frames can be identified; Feature point matcher: Use brute force matching (Brute Force Matcher) to match feature points in adjacent frames; The Brute-Force matcher is very simple. It takes the description of a feature in the first set and matches it with all other features in the second set through some distance calculations, and then returns the closest matching value. These matching point pairs are the positions of the same bubble in consecutive frames.
[0040] Step 107, determining the displacement of the matching bubble in the vertical direction of the bubble motion image and acquiring the time interval between adjacent frames, and determining the vertical speed of the matching bubble according to the displacement and the time interval.
[0041] Specifically, the pixel displacement of the bubble feature point between two consecutive frames is first determined, and then the displacement of the matching bubble in the vertical direction of the bubble motion image is obtained based on the relationship between the pixel displacement and the physical length, and the time interval of each frame image is obtained, and then the vertical speed of the matching bubble is determined based on the displacement and time interval.
[0042] More specifically, the bubble velocity calculation is as follows: the displacement Δy of the bubble in the vertical direction (i.e., the y-axis) of the bubble motion image is calculated, and the time interval between adjacent frames is Δt, from which the vertical velocity of the bubble can be calculated. The velocity calculation formula is: Among them, V y is the average velocity of the bubble in the vertical direction, Δy is the displacement of the bubble in the vertical direction, and Δt is the time interval.
[0043] Specifically, after successfully matching the bubble feature points in adjacent frames, the bubble movement speed is calculated based on these matching points. Speed calculation usually depends on the following factors: Pixel displacement: The pixel displacement of the bubble feature points between two consecutive frames can be obtained by calculating the position change of the matching points in the bubble motion image. The pixel displacement has a certain relationship with the physical length, thus obtaining the physical displacement Δs, which is decomposed into the vertical displacement Δy. Time interval: Knowing the time interval of each frame (for example, 30 frames per second), the pixel displacement can be converted into speed in physical units, thus according to the formula The average velocity of the bubble in the vertical direction can be calculated.
[0044] Step 108, obtaining the liquid porosity of the target area according to the vertical velocity of the matching bubble.
[0045] Specifically, the liquid porosity of the target area is obtained according to the following formula: α = Q / (V y *S); where α is the liquid porosity in the glass water tank 4 at the flow rate Q, Q is the flow rate of air introduced, V y is the velocity of the bubble in the vertical direction, S is the area of the bubble generator 5, please refer to Figure 6 ; Please refer to the above overall process Figure 3 .
[0046] In summary, the present invention obtains bubble motion images through a high-speed camera, and processes them in combination with image recognition technology to accurately calculate the speed of the bubble 6, and then obtain the porosity of the target area, thereby overcoming the limitations of traditional sensor measurements and being suitable for fast-flowing liquid environments. The present invention not only improves the accuracy and efficiency of porosity measurement, and is particularly suitable for fast-flowing liquid environments, but also significantly reduces the use of physical sensors, reduces measurement costs and complexity, and the method can be applied to multiple fields such as chemical industry, energy, and environment, and has broad practical application value.
[0047] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. All equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A liquid porosity measurement device based on image recognition, characterized in that: The invention comprises a bubble generating device, a glass water tank (4), an LED array light source (3), a binocular camera (7) and a computer (8); wherein the bubble generating device is used to generate bubbles (6) in the glass water tank (4), the LED array light source (3) is arranged on the side of the glass water tank (4), the binocular camera (7) is arranged opposite to the glass water tank (4), and the binocular camera (7) is parallel to the rising direction of the bubbles (6), and the binocular camera (7) is electrically connected to the computer (8) via a wire.
2. The method for measuring liquid porosity based on image recognition according to claim 1, characterized in that: The bubble generating device comprises an air compressor (1) and a bubble generator (5) installed in the glass water cylinder (4); the air compressor (1) is connected to the bubble generator (5) via a gas connecting pipe (2).
3. A liquid porosity measurement method based on image recognition, characterized in that: Applied to a processor in a computer (8), the method comprises the following steps: Acquire a moving image of bubbles in the liquid captured by a binocular camera (7); Preprocessing the bubble motion image, obtaining bubble contours in the bubble motion image according to the preprocessing result, and marking each bubble contour; Extracting bubble feature points from the preprocessed bubble motion image and describing the bubble feature points; Matching bubble feature points in two adjacent frames of bubble motion images, obtaining a successfully matched bubble feature point pair according to the matching result, and obtaining matching bubbles in two adjacent frames of bubble motion images according to the successfully matched bubble feature point pair; Determine the displacement of the matching bubble in the vertical direction of the bubble motion image and the time interval between adjacent frames, and determine the vertical speed of the matching bubble according to the displacement and the time interval; The liquid void ratio of the target area is obtained according to the vertical velocity of the matching bubble.
4. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: Before acquiring the bubble motion image in the liquid captured by the binocular camera (7), the method further includes: After pure water with a depth of h is introduced into the glass water tank (4), the bubble generating device is turned on to introduce compressed air with a pressure of P at a flow rate of Q into the water, thereby generating bubbles (6) in the glass water tank (4); An LED array light source (3) is used to backlight a glass water tank (4) to provide a high-contrast imaging environment for bubble image recognition, and then a binocular camera (7) is used to capture a bubble motion image in the liquid at a rate of 1000 frames per second.
5. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: The preprocessing of the bubble motion image, obtaining bubble contours in the bubble motion image according to the preprocessing result, and marking each bubble contour includes: The bubble motion image is subjected to image graying and Gaussian filtering, and edge detection is performed on the bubble motion image after image graying and Gaussian filtering. Bubble contours are extracted from the bubble motion image according to the edge detection result, and each bubble contour is marked.
6. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: The extracting of bubble feature points from the preprocessed bubble motion image and describing the bubble feature points includes: By drawing a circle with a radius of R around the pixels of the preprocessed bubble motion image, confirming whether the difference between the pixel values of N consecutive points on the circle with a radius of R and the pixel value of the center of the circle is greater than a threshold, and determining the bubble feature points in the preprocessed bubble motion image according to the confirmation result, wherein the threshold is set manually; Select n pairs of pixels in the neighborhood of the bubble feature point, compare the grayscale values of the n pairs of pixels, generate a binary string with a length of n according to the comparison result, and use the binary string with a length of n as a feature descriptor.
7. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: The step of matching the bubble feature points in two adjacent frames of bubble motion images, obtaining a successfully matched bubble feature point pair according to the matching result, and obtaining matching bubbles in two adjacent frames of bubble motion images according to the successfully matched bubble feature point pair includes: A brute force matching algorithm is used to match the bubble feature points in two adjacent frames of bubble motion images, and a successfully matched bubble feature point pair is obtained according to the matching results. The matching rate is determined according to the successfully matched bubble feature point pair by the ORB algorithm, and the matching bubbles in the two adjacent frames of bubble motion images are obtained according to the matching rate.
8. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: The step of determining the displacement of the matching bubble in the vertical direction of the bubble motion image and obtaining the time interval between adjacent frames, and determining the vertical speed of the matching bubble according to the displacement and the time interval, comprises: Determine the pixel displacement of the bubble feature point between two consecutive frames, obtain the displacement of the matching bubble in the vertical direction of the bubble motion image based on the relationship between the pixel displacement and the physical length, obtain the time interval between adjacent frames, and determine the vertical speed of the matching bubble based on the displacement and the time interval.
9. The method for measuring liquid porosity based on image recognition according to claim 3, characterized in that: The step of obtaining the liquid porosity of the target area according to the vertical velocity of the matching bubble comprises: The liquid void fraction of the target area is obtained according to the following formula: α=Q / (V y *S); Wherein, α is the void ratio of the liquid in the glass water cylinder (4) at the flow rate Q, Q is the flow rate of the air introduced, and V y is the velocity of the bubble in the vertical direction, and S is the area of the bubble generator (5).
Citation Information
Patent Citations
Multiple-vision-based System and method for measuring parameters of gas-liquid two-phase flow in small channel based on
CN104457703A