A flow detection method for chemical sight glass based on machine vision technology

By installing fill lights and visual sensors on the sight glass at the chemical industry site, combined with image processing algorithms, the problem of the inability of existing technology to measure partially full pipes and impurities is solved, and efficient detection and response of partially full pipe fluids and impurities are achieved. It is fast and suitable for automated chemical production.

CN117191141BActive Publication Date: 2024-10-29南通市海视光电有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311468863.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2024-10-29
Estimated Expiration
2043-11-07

AI Technical Summary

Technical Problem

Existing flow detection technology at chemical industry sites cannot effectively measure non-full pipe or intermittent fluid flow, and cannot distinguish the impurity content in the fluid.

Method used

Using a chemical sight glass flow detection method based on machine vision technology, the video image in the pipeline is obtained by installing a fill light and a visual sensor on the back of the sight glass, and through detection area calibration, box filtering, image pixel binary segmentation and Zero-value pixel percentage calculation enables measurement of fluid flow and impurity content in non-full pipes.

Benefits of technology

It realizes the flow measurement when the pipe is not full or even when the fluid passes intermittently. The response is sensitive and the response speed can reach 100ms. It can effectively measure the impurity content in the fluid and meet the needs of chemical production automation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117191141B_ABST
    Figure CN117191141B_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of chemical detection, and discloses a flow detection method for a chemical sight glass based on machine vision technology. A fill light is installed on the back of a pipeline sight glass, and a visual sensor is installed on the front of the sight glass to obtain a video image in the pipeline sight glass. Then, single-frame image data is processed, including detection area calibration, fast box filtering, image pixel binarization segmentation, zero-value pixel quantity statistics, and calculation of the percentage of zero-value pixels. Finally, the percentage of zero-value pixels of multiple frames of images within a certain period of time is accumulated as a response value of the metering flow. Through the above method, the fluid flow in the pipeline sight glass when the pipe is not full or only intermittent fluid passes can be effectively measured, and the impurity content in the fluid can also be measured. The response is sensitive and the response speed can reach 100ms, which fully meets the requirements of chemical production automation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of chemical detection, and in particular relates to a chemical sight glass flow detection method based on machine vision technology. Background Art

[0002] At present, flow meters are mainly used to measure liquid flow in pipelines at chemical sites. Flow meters are mainly divided into differential pressure flow meters, rotor flow meters, positive displacement flow meters, electromagnetic flow meters, and ultrasonic flow meters, which are used to measure fluid flow in pipelines or open channels. Differential pressure flow meters are used to measure fluid flow that fills pipelines. A throttling device is installed in the pipeline to generate a static pressure difference between upstream and downstream when the fluid passes through the throttling device. The relationship between differential pressure and flow is derived based on the continuity principle and Bernoulli's equation to obtain the flow rate. The rotor flowmeter changes the flow area of ​​the fluid to keep the differential pressure constant above and below the rotor, and measures the fluid flow rate based on the throttling principle. The positive displacement flowmeter uses a mechanical measuring element to form a fixed small volume to repeatedly measure the volume of the fluid passing through the flowmeter. The electromagnetic flowmeter uses the principle of electromagnetic induction to measure the flow of conductive fluids. The ultrasonic flowmeter measures the flow rate by detecting the effect of the fluid flow on the ultrasonic beam.

[0003] Disadvantages of existing technology:

[0004] 1. Not applicable to the situation of partial pipe flow and intermittent flow: the existing technology is mainly for full pipe flow measurement. The measurement result is more reliable when the pipe is full of liquid, and it is not applicable to the flow measurement of partial pipe. When the fluid does not fill the pipe, the flow signal will be disordered for the volume flow meter, electromagnetic flow meter, ultrasonic flow meter and other technologies, and the differential pressure flow meter and rotor flow meter will not respond even when there is sporadic fluid passing through (the fluid does not contact the throttling device or rotor).

[0005] 2. It is impossible to measure the impurity content in the fluid because the above flow meter only responds to the flow of fluid and cannot effectively distinguish different substances in the fluid. Summary of the invention

[0006] In order to solve the above problems, the present invention provides a chemical sight glass flow detection method based on machine vision technology, which can effectively measure the fluid flow in the pipeline sight glass when the pipe is not full or even when only intermittent fluid passes through, and can also measure the impurity content in the fluid. It has a sensitive response and the response speed can reach 100ms.

[0007] The technical solution provided by the present invention is as follows:

[0008] A flow detection method for chemical industry sight glass based on machine vision technology includes fluid image acquisition and fluid image detection algorithm. The specific detection steps are as follows:

[0009] 1. Fluid image acquisition:

[0010] 1A. First, install a fill light on the back of the mirror. There is an air phase and a fluid between the fill light and the mirror. The light emitted by the fill light passes through the air phase, the fluid, and the mirror in sequence.

[0011] 1B. Install the visual sensor in front of the mirror. Since the light intensity passing through the empty phase is large and the light intensity passing through the fluid is small, the visual sensor collects images of light and dark, thereby obtaining a mirror image video stream;

[0012] 2. Fluid Image Detection Algorithm

[0013] 2A. Detection area calibration: first select the image data range to be measured, and then select the detection area on the mirror image;

[0014] 2B. Perform box filtering on the two-dimensional image data in the detection area: expand the original image A, fill the pixel values ​​of the expanded image E area with the pixel values ​​of the edge of the original image A, create an array buff, traverse the image E and store the data into the array buff;

[0015] 2C. Perform binary segmentation on the image pixels, create a binary image array T, and calculate its value;

[0016] 2D, calculate the percentage of zero-value pixels and measure the response value V of the single-frame image flow k ;

[0017] 2E. The response values ​​of multiple frames of images are accumulated to obtain the flow response value.

[0018] Preferably, in step 2A, the detection area on the image is selected as a rectangular area with a height of rows and a width of cols.

[0019] Preferably, in step 2B:

[0020] 2.1. The original image A is [cols, rows], the filter template size is [b_w, b_h], b_w and b_h are odd numbers;

[0021] 2.2. Expand the original image A to image E[e_cols,e_rows], where:

[0022] The pixel values ​​of the expanded image E area are filled with the pixel values ​​of the edge of the original image A;

[0023] 2.3. Create an array buff of length e_cols, create an image array S[cols,rows], and traverse the image E;

[0024] 2.4. Starting from the first column, traverse each column of the image E until the last column (a total of e_cols columns), calculate the sum of the grayscale values ​​of the pixels in each column within the height range [0, b_h-1], and store them in the array buff in sequence;

[0025] 2.5. Go back to the first column, calculate the sum of the pixels in the range of buff[0,b_w-1], and assign it to S[i=0,j], where i is the number of columns and j is the number of rows. Move right pixel by pixel, s[i,j]=s[i-1,j]-buff[i-1]+buff[i-1+b_w], until i=e_w-b_w(column);

[0026] 2.6. Go back to the first column, slide down one pixel (row number j plus 1), and update the array buffer (for each column, subtract the pixel value of the previous row and add the newly added pixel value);

[0027] If j<=(w_h-b_h), go to step 2.5;

[0028] If j>w_h-b_h, go to step 2.7;

[0029] 2.7. Obtain the box filter result S[cols,rows] of the original image A[cols,rows], and the box filter is completed.

[0030] Preferably, in step 2C, first calculate the average coefficient ratio = 1 / (b_w*b_h), create parameter delta, create parameter type (binarization type). Create array tab

[768] ;

[0031] If the type is bright pixel and the value is 255 after binarization, then: tab[0:255-delta]=0, Tab[255-delta,768]=255;

[0032] If the pixel of type dark is binarized and assigned to 255, then: tab[0:255-delta]=255, Tab[255-delta,768]=0;

[0033] Then create the binary image array T[cols*rows] and calculate its value T[i]=tab[A[i]-ratio*S[i]+255];

[0034] Preferably, in step 2D, the number of pixels n whose values ​​are 0 in T is counted, then the proportion of impurity or water flow P=n / (cols*rows), which measures the response value V of the flow of a single frame image. k =100*P.

[0035] Preferably, in step 2E, the current frame index is c, the accumulated frame number is n, and the single frame flow response value is V k , the flow response value is Flow_V, and its value range is [0,100*n];

[0036] Add the traffic response values ​​of n frames of video stream within a certain period of time:

[0037] In summary, the beneficial effects of the present invention are:

[0038] The present invention first installs a fill light on the back of a pipeline sight glass, and installs a visual sensor on the front of the sight glass to obtain a video image in the pipeline sight glass, and then processes single-frame image data, including detection area calibration, fast box filtering, image pixel binarization segmentation, zero-value pixel quantity statistics, and calculation of the percentage of zero-value pixels. Finally, the percentage of zero-value pixels of multiple frames of images within a certain period of time is accumulated as a response value for metering flow. Through the above method, the fluid flow in the pipeline sight glass when the pipe is not full or even when only intermittent fluid passes through can be effectively measured, and the impurity content in the fluid can also be measured. The response is sensitive and the response speed can reach 100ms, which fully meets the requirements of chemical production automation. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of the detection method steps of the present invention;

[0040] Figure 2 Schematic diagram of the imaging system structure of the present invention.

[0041] The reference numerals are as follows:

[0042] 1. Fill light; 2. Empty phase; 3. Fluid; 4. View mirror; 5. Visual sensor. Implementation

[0043] In order to deepen the understanding of the present invention, the present invention will be further described in detail below in conjunction with examples. The following examples are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.

[0044] like Figure 1-2 As shown, the present invention provides a method for detecting flow rate of a chemical sight glass based on machine vision technology. The method is a complete chemical sight glass flow detection function implemented on the basis of the imaging system hardware composed of a fill light and a visual sensor, including two major steps of fluid image acquisition and fluid image detection algorithm, which are specifically described as follows:

[0045] 1. Fluid image acquisition:

[0046] First, a fill light 1 is installed on the back of the mirror 4. An empty phase 2 and a fluid 3 are provided between the fill light 1 and the mirror 4. The light emitted by the fill light 1 passes through the empty phase 2, the fluid 3, and the mirror 4 in sequence. The light does not attenuate when passing through the empty phase 2, but attenuates when passing through the fluid 3 due to refraction, scattering, etc.;

[0047] The visual sensor 5 is installed in front of the mirror 4. Since the light intensity passing through the empty phase 2 is large and the light intensity passing through the fluid 3 is small, the visual sensor 5 collects an image of alternating light and dark. The brightness of the empty phase 2 is the highest, the brightness of the center of the fluid 3 is the second highest, and the brightness of the edge of the fluid 3 is the darkest, thereby obtaining the image video stream of the mirror 4;

[0048] 2. Fluid Image Detection Algorithm:

[0049] Assume that the current accumulated frame number of the initial mirror image video stream is i=0, and the response value buffer is v_buffer[n], where n is the accumulated frame number.

[0050] Detection area calibration: First, select the image data range to be measured, select a rectangular area on the mirror image as the detection area, with a height of rows and a width of cols, so as to obtain the image of the current frame detection area.

[0051] Perform box filtering on the two-dimensional image data within the detection area. The box filtering process is as follows:

[0052] 2.1. The original image selected above is set to A, that is, A[cols, rows], and the filter template size is set to [b_w, b_h], where b_w and b_h are odd numbers;

[0053] 2.2. Expand the original image A to image E[e_cols,e_rows], where:

[0054] e_cols=cols+b_w−1

[0055] e_rows=rows+b_h−1

[0056] The pixel values ​​of the expanded image E area are filled with the pixel values ​​of the edge of the original image A, as shown below:

[0057] If the pixel value of the original image A is: abcdefgh

[0058] The pixel values ​​of the expanded image E are: aaaaaa|abcdefgh|hhhhhh

[0059] 2.3. Then create an array buff of length e_cols, and then create an image array S[cols,rows];

[0060] 2.4. Starting from the first column, traverse each column of the image E until the last column. From the above array buff of length e_cols, we know that there are e_cols columns in total. Find the sum of the grayscale values ​​of the pixels in each column within the height range [0, b_h-1] and store them in the array buff in sequence.

[0061] 2.5. Go back to the first column, calculate the sum of the pixels in the range of buff[0,b_w-1], and assign it to S[i=0,j], where i is the number of columns and j is the number of rows. Move right pixel by pixel, s[i,j]=s[i-1,j]-buff[i-1]+buff[i-1+b_w], until i=e_w-b_w(column);

[0062] 2.6. Go back to the first column, slide down one pixel (row number j plus 1), and update the array buffer (for each column, subtract the pixel value of the previous row and add the newly added pixel value);

[0063] If j<=(w_h-b_h), go to step 2.5;

[0064] If j>w_h-b_h, go to step 2.7;

[0065] 2.7. Obtain the box filter result S[cols,rows] of the original image A[cols,rows], and the box filter is completed.

[0066] To perform binary segmentation of image pixels, first calculate the average coefficient ratio = 1 / (b_w*b_h), create parameter delta, create parameter type (binarization type). Create array tab

[768] ;

[0067] If the type is bright pixel and the value is 255 after binarization, then: tab[0:255-delta]=0, Tab[255-delta,768]=255;

[0068] If the pixel of type dark is binarized and assigned to 255, then: tab[0:255-delta]=255, Tab[255-delta,768]=0;

[0069] Then create the binarized image array T[cols*rows] and calculate its value T[i]=tab[A[i]-ratio*S[i]+255].

[0070] Calculate the percentage of zero-value pixels, count the number of pixels n with a value of 0 in T, then the proportion of impurity or water flow P=n / (cols*rows), which measures the response value V of the flow of a single frame image k=100*P, where v_buffer[i]=V k , the accumulated frame number i=i+1.

[0071] The flow response value is obtained by summing up the response values ​​of multiple frames. Let the current frame index be c, the number of accumulated frames be n, and the single frame flow response value be V k , the flow response value is Flow_V, and its value range is [0,100*n];

[0072] Finally, add up the traffic response values ​​of n frames of video stream within a certain period of time, that is, the sum of all values ​​in the output buffer v_buffer[n], as the traffic response value: .

Claims

1. A chemical industry sight glass flow detection method based on machine vision technology, characterized in that: Including fluid image acquisition and fluid image detection algorithm, the specific detection steps are:

1. Fluid image acquisition: 1A. First, a fill light (1) is installed on the back of the viewing mirror (4). An empty phase (2) and a fluid (3) are provided between the fill light (1) and the viewing mirror (4). Light emitted by the fill light (1) passes through the empty phase (2), the fluid (3), and the viewing mirror (4) in sequence. 1B. Install the visual sensor (5) in front of the mirror (4). Since the light intensity passing through the empty phase (2) is large and the light intensity passing through the fluid (3) is small, the visual sensor (5) collects images of light and dark, thereby obtaining a video stream of the mirror (4) image.

2. Fluid Image Detection Algorithm 2A. Detection area calibration: first select the image data range to be measured, and then select the detection area on the mirror image; Select the detection area on the image as a rectangular area with a height of rows and a width of cols; 2B. Perform box filtering on the two-dimensional image data in the detection area: expand the original image A, fill the pixel values ​​of the expanded image E area with the pixel values ​​of the edge of the original image A, create an array buff, traverse the image E and store the data into the array buff; 2.

1. The original image A is [cols, rows], the filter template size is [b_w, b_h], b_w and b_h are odd numbers; 2.

2. Expand the original image A to image E[e_cols,e_rows], where: e_cols = cols + b_w - 1 e_rows=rows+b_h-1 The pixel values ​​of the expanded image E area are filled with the pixel values ​​of the edge of the original image A; 2.

3. Create an array buff of length e_cols, create an image array S[cols,rows], and traverse the image E; 2.

4. Starting from the first column, traverse each column of image E until the last column, calculate the sum of the grayscale values ​​of the pixels in each column within the height range [0, b_h-1], and store them in the array buff in sequence; 2.

5. Go back to the first column, calculate the sum of the pixels in the range of buff[0,b_w-1], and assign it to S[i=0,j], where i is the column number and j is the row number. Move right pixel by pixel, s[i,j]=s[i-1,j]-buff[i-1]+buff[i-1+b_w], until i=e_w-b_w; 2.

6. Go back to the first column, slide down one pixel, and update the array buffer; If j <= (w_h-b_h), go to step 2.5; If j>w_h-b_h, go to step 2.7; 2.

7. Obtain the box filter result S[cols,rows] of the original image A[cols,rows], and the box filter is finished; 2C. Perform binary segmentation on the image pixels, create a binary image array T, and calculate the value of T; First, calculate the average coefficient ratio = 1 / (b_w*b_h), create parameter delta, create parameter type, and create array tab[768]; If the type is bright pixel and the value is 255 after binarization, then: tab[0:255-delta]=0, Tab[255-delta,768]=255; If the pixel of type dark is binarized to 255, then: tab[0:255-delta]=255, Tab[255-delta,768]=0; Then create the binary image array T[cols*rows] and calculate its value T[i]=tab[A[i]-ratio*S[i]+255]; 2D, calculate the percentage of zero-value pixels and measure the response value V of the single-frame image flow k ; In step 2D, the number of pixels n with values ​​of 0 in T is counted, and the proportion of impurity or water flow P = n / (cols*rows), which measures the response value V of the flow of a single frame image. k =100*P; 2E. The response values ​​of multiple frames of images are accumulated to obtain the flow response value.

2. According to the method for detecting flow rate of chemical industry sight glass based on machine vision technology in claim 1, it is characterized in that: In step 2E, the current frame index is c, the accumulated frame number is n, and the single frame flow response value is V k , the flow response value is Flow_V, and its value range is [0,100*n]; Add the traffic response values ​​of n frames of video stream within a certain period of time:

Citation Information

Patent Citations

  • Micro-flow detection method based on recognition of droplet images at pipeline outlet

    CN103148905A

  • Online fluid small flow detection system based on machine vision and online fluid small flow detection method based on machine vision for float flowmeter

    CN105953850A

  • Chemical sight glass flow dynamic detection method based on machine vision

    CN116794040A

  • Analytical method

    WO2014056951A1