CN117191141A - Chemical industry sight glass flow detection method based on machine vision technology - Google Patents

Chemical industry sight glass flow detection method based on machine vision technology Download PDF

Info

Publication number
CN117191141A
CN117191141A CN202311468863.7A CN202311468863A CN117191141A CN 117191141 A CN117191141 A CN 117191141A CN 202311468863 A CN202311468863 A CN 202311468863A CN 117191141 A CN117191141 A CN 117191141A
Authority
CN
China
Prior art keywords
image
pixel
flow
sight glass
cols
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311468863.7A
Other languages
Chinese (zh)
Inventor
陈栋飞
沈鸿飞
黄俊杰
凌正刚
龚卫东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong Haishi Photoelectric Co ltd
Original Assignee
Nantong Haishi Photoelectric Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nantong Haishi Photoelectric Co ltd filed Critical Nantong Haishi Photoelectric Co ltd
Priority to CN202311468863.7A priority Critical patent/CN117191141A/en
Publication of CN117191141A publication Critical patent/CN117191141A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention belongs to the technical field of chemical industry detection, and discloses a chemical industry sight glass flow detection method based on a machine vision technology.

Description

Chemical industry sight glass flow detection method based on machine vision technology
Technical Field
The invention belongs to the technical field of chemical industry detection, and particularly relates to a chemical industry sight glass flow detection method based on a machine vision technology.
Background
At present, the liquid flow in a chemical field measurement pipeline is mainly divided into a differential pressure type flowmeter, a rotameter, a volumetric flowmeter, an electromagnetic flowmeter and an ultrasonic flowmeter, the differential pressure type flowmeter is used for measuring the fluid flow in the pipeline or an open channel, the differential pressure type flowmeter is used for measuring the fluid flow of the full pipeline, a throttling device is arranged in the pipeline, the upstream and downstream static pressure difference is generated when the fluid passes through the throttling device, the flow is obtained according to the relationship between the differential pressure and the flow deduced by a Bernoulli equation and according to the continuity principle, the rotameter keeps the differential pressure on the upper side and the lower side of the rotameter constant by changing the flow area of the fluid, the fluid flow is measured according to the throttling principle, the volumetric flowmeter forms a fixed small volume through a mechanical measuring element to repeatedly measure the volume of the fluid passing through the flowmeter, the electromagnetic flowmeter measures the flow of conductive fluid by utilizing the electromagnetic induction principle, and the ultrasonic flowmeter measures the flow by detecting the action of the fluid flow on an ultrasonic beam.
The prior art has the defects that:
1. not applicable to non-full pipe flows and only intermittent fluid scenarios: the prior art mainly aims at full pipe flow measurement, and the measurement result is reliable when the pipeline is filled with liquid, and is not suitable for flow measurement of non-full pipes. When the fluid is not filling the pipe, flow signal disturbances can occur with techniques such as volumetric, electromagnetic, ultrasonic, etc., whereas with differential pressure, rotameters there is no response even when there is sporadic fluid passing (fluid does not contact the restriction or the rotor).
2. The impurity content in the fluid cannot be measured because the flowmeter only reacts to the fluid flow and cannot effectively distinguish different substances in the fluid.
Disclosure of Invention
In order to solve the problems, the invention provides a chemical industry sight glass flow detection method based on a machine vision technology, which can effectively measure the flow of fluid in a pipeline sight glass when a non-full pipe and even only intermittent fluid passes through, can also measure the impurity content in the fluid, is sensitive in response, and has the response speed of up to 100ms.
The technical scheme provided by the invention is as follows:
the chemical industry sight glass flow detection method based on the machine vision technology comprises a fluid image acquisition and fluid image detection algorithm, wherein the specific detection steps are as follows:
fluid image acquisition:
1A, firstly, mounting a light supplementing lamp on the back of a sight glass, wherein an empty phase and fluid are arranged between the light supplementing lamp and the sight glass, and light emitted by the light supplementing lamp sequentially passes through the empty phase, the fluid and the sight glass;
1B, installing a visual sensor in front of the sight glass, wherein the visual sensor acquires images with alternate brightness due to the fact that the light intensity passing through the air phase is high and the light intensity passing through the fluid is low, so that a sight glass image video stream is obtained;
(II) fluid image detection algorithm
2A, calibrating a detection area: firstly, selecting an image data range to be measured, and selecting a detection area on a sight glass image;
2B, performing box-type filtering on the two-dimensional image data in the detection area: expanding an original image A, filling pixel values of an expanded image E region with pixel values of the edge of the original image A, creating an array buff, traversing the image E and storing data into the array buff;
2C, performing image pixel binarization segmentation, creating a binarized image array T, and calculating the value of the image array T;
2D, calculating zero value pixel percentage, and measuring single frame imageResponse value V of image flow k
And 2E, accumulating the multi-frame image response values to obtain a flow response value.
Preferably, in step 2A, the detection area on the image is selected to be a rectangular area, the height is rows, and the width is cols.
Preferably, in step 2B:
2.1, original image A is [ cols, rows ], filter template size [ b_w, b_h ], b_w and b_h are odd;
2.2 expanding the original image A into an image E [ e_cols, e_rows]Wherein:
the pixel values of the extended image E area are filled by the pixel values of the edge of the original image A;
2.3, creating an array buff with the length of e_cols, creating an image array S [ cols, rows ], and traversing the image E;
2.4, starting from the first column, traversing each column of the image E until the last column (e_cols columns), solving the sum of pixel gray values of each column in the height range [0, b_h-1], and sequentially storing the sum into an array buff;
2.5, returning to the first column, calculating the pixel sum in the range of buff [0, b_w-1] and assigning to S [ i=0, j ], wherein i is the column number and j is the row number, moving to the 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);
2.6, returning to the first column, sliding one pixel downwards (the number j of rows is increased by 1), and updating an array buffer (the pixel value of the last row is subtracted from each column and the newly added pixel value is added);
if j < = (w_h-b_h), go to step 2.5;
if j > w_h-b_h, go to step 2.7;
and 2.7, obtaining a box type filtering result S [ cols, rows ] of the original image A [ cols, rows ], and finishing the box type filtering.
Preferably, in step 2C, the average coefficient ratio=1/(b_w×b_h) is first calculated, the parameter delta is created, and the parameter type (binarization type) is created. Creating an array tab [768];
if the type is a bright pixel, which is binarized to 255, then: tab [0:255-delta ] =0, tab [255-delta,768] =255;
if the type is 255 after binarization of the dark pixel, then: tab [0:255-delta ] =255, tab [255-delta,768] =0;
then creating a binarized image array T [ cols ] and calculating the value T [ i ] =tab [ A [ i ] -ratio S [ i ] +255];
preferably, in step 2D, counting n of all pixel points with 0 in T, the ratio p=n/(cols×rows) of impurity or water flow is measured, and the response value V of single frame image flow is measured k =100*P。
Preferably, in step 2E, the current frame index is c, the accumulated frame number is n, and the single frame traffic response value is V k The Flow response value is flow_V, and the value range is [0,100 x n ]];
Adding the flow response values of n frames of images in a certain time of the video stream:
in summary, the beneficial effects of the invention are as follows:
the invention firstly installs the light supplementing lamp on the back of the pipeline viewing mirror, the vision sensor is arranged on the front of the viewing mirror to obtain the video image in the pipeline viewing mirror, then processes the single frame image data, including the calibration of the detection area, the rapid box type filtering, the binarization segmentation of the image pixels, the statistics of the zero value pixel quantity, the calculation of the zero value pixel percentage ratio, and finally the accumulation of the zero value pixel percentages of the multi-frame image in a certain time as the response value of the metering flow.
Drawings
FIG. 1 is a flow chart of the steps of the detecting method of the present invention;
FIG. 2 is a schematic diagram of an imaging system according to the present invention.
The reference numerals are as follows:
1. a light supplementing lamp; 2. an empty phase; 3. a fluid; 4. a viewing mirror; 5. visual sensor.
Description of the embodiments
The present invention will be further described in detail with reference to the following examples, which are only for the purpose of illustrating the invention and are not to be construed as limiting the scope of the invention.
1-2, the invention provides a chemical industry sight glass flow detection method based on a machine vision technology, which is a complete chemical industry sight glass flow detection function realized on the basis of imaging system hardware of a light filling lamp and a vision sensor, and comprises two large steps of fluid image acquisition and fluid image detection algorithm, and is specifically described as follows:
1. fluid image acquisition:
firstly, a light supplementing lamp 1 is arranged on the back of a sight glass 4, an empty phase 2 and fluid 3 are arranged between the light supplementing lamp 1 and the sight glass 4, light emitted by the light supplementing lamp 1 sequentially passes through the empty phase 2, the fluid 3 and the sight glass 4, no attenuation occurs when the light passes through the empty phase 2, and attenuation occurs when the light passes through the fluid 3 due to refraction, scattering and other reasons;
the vision sensor 5 is arranged in front of the sight glass 4, and as the light intensity passing through the air phase 2 is large and the light intensity passing through the fluid 3 is small, the vision sensor 5 collects images with alternately bright and dark, the brightness of the air phase 2 is maximum, the brightness of the center of the fluid 3 is secondary, the brightness of the edge of the fluid 3 is darkest, so that an image video stream of the sight glass 4 is obtained;
2. fluid image detection algorithm:
let i=0, v_buffer [ n ] n be the accumulated frame number.
Calibrating a detection area: firstly, selecting an image data range to be measured, selecting a rectangular area on a sight glass image as a detection area, wherein the height is rows, and the width is cols, so that an image of the detection area of the current frame is acquired.
And performing box-type filtering on the two-dimensional image data in the detection area, wherein the box-type filtering flow is as follows:
2.1, setting the selected original image as A, namely A [ cols, rows ], and setting the filter template size [ b_w, b_h ], wherein b_w and b_h are odd numbers;
2.2, expanding the original image A into an image E [ e_cols, e_rows ], wherein:
e_cols=cols+b_w−1
e_rows=rows+b_h−1
the pixel values of the E region of the expanded image are filled by the pixel values of the edge of the original image A, and are shown as follows:
if the original image A pixel value is: abcdefgh
The pixel values of the expanded image E are: aaaaaa|abcdefgh|hhhhhhhhh
2.3, creating an array buff with the length of e_cols, and further creating an image array S [ cols, rows ];
2.4, traversing each column of the image E from the first column to the last column, obtaining the sum of pixel gray values of each column in the height range [0, b_h-1] from the e_cols columns, and sequentially storing the sum in the e_cols columns;
2.5, continuing to return to the first column, calculating the pixel sum in the range of buff [0, b_w-1] and assigning S [ i=0, j ], wherein i is the column number, j is the row number, and moving to the 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);
2.6, returning to the first column, sliding one pixel downwards (the number j of rows is increased by 1), and updating an array buffer (the pixel value of the last row is subtracted from each column and the newly added pixel value is added);
if j < = (w_h-b_h), go to step 2.5;
if j > w_h-b_h, go to step 2.7;
and 2.7, obtaining a box type filtering result S [ cols, rows ] of the original image A [ cols, rows ], and finishing the box type filtering.
The image pixel binarization segmentation is performed by first calculating an average coefficient ratio=1/(b_w×b_h), creating a parameter delta, and creating a parameter type (binarization type). Creating an array tab [768];
if the type is a bright pixel, which is binarized to 255, then: tab [0:255-delta ] =0, tab [255-delta,768] =255;
if the type is 255 after binarization of the dark pixel, then: tab [0:255-delta ] =255, tab [255-delta,768] =0;
then, a binarized image array T [ cols ] is created, and the value T [ i ] =tab [ A [ i ] -ratio S [ i ] +255] is calculated.
Calculating the zero value pixel percentage, counting the number n of all pixel points with the value of 0 in T, and measuring the response value V of single frame image flow if the ratio P=n/(cols rows) of impurity or water flow k =100×p, where v_buffer [ i ]]=V k The accumulated frame number i=i+1.
Accumulating the multi-frame image response values to obtain flow response values, setting the current frame index as c, the accumulated frame number as n and the single-frame flow response value as V k The Flow response value is flow_V, and the value range is [0,100 x n ]];
Finally, the flow response values of n frames of images in a certain time of the video stream are added, namely, a buffer zone v_buffer [ n ] is output]The sum of all values, as a flow response value:

Claims (3)

1. the chemical industry sight glass flow detection method based on the machine vision technology is characterized by comprising a fluid image acquisition algorithm and a fluid image detection algorithm, wherein the specific detection steps are as follows:
fluid image acquisition:
1A, firstly, mounting a light supplementing lamp (1) on the back of a sight glass (4), wherein an empty phase (2) and a fluid (3) are arranged between the light supplementing lamp (1) and the sight glass (4), and light emitted by the light supplementing lamp (1) sequentially passes through the empty phase (2), the fluid (3) and the sight glass (4);
1B, a visual sensor (5) is arranged in front of a sight glass (4), and the visual sensor (5) acquires images with alternate brightness due to the fact that the light intensity passing through an empty phase (2) is high and the light intensity passing through a fluid (3) is low, so that an image video stream of the sight glass (4) is obtained;
(II) fluid image detection algorithm
2A, calibrating a detection area: firstly, selecting an image data range to be measured, and selecting a detection area on a sight glass image;
selecting a detection area on the image as a rectangular area, wherein the height is rows, and the width is cols;
2B, performing box-type filtering on the two-dimensional image data in the detection area: expanding an original image A, filling pixel values of an expanded image E region with pixel values of the edge of the original image A, creating an array buff, traversing the image E and storing data into the array buff;
2.1, original image A is [ cols, rows ], filter template size [ b_w, b_h ], b_w and b_h are odd;
2.2 expanding the original image A into an image E [ e_cols, e_rows]Wherein:the pixel values of the expanded image E area are filled by the pixel values of the edge of the original image A;
2.3, creating an array buff with the length of e_cols, creating an image array S [ cols, rows ], and traversing the image E;
2.4, traversing each column of the image E from the first column to the last column, solving the sum of pixel gray values of each column in the height range [0, b_h-1], and sequentially storing the sum into an array buff;
2.5, returning to the first column, calculating the pixel sum in the range of buff [0, b_w-1] and assigning to S [ i=0, j ], wherein i is the column number and j is the row number, moving to the 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);
2.6, returning to the first row, sliding down one pixel, and updating an 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, obtaining a box type filtering result S [ cols, rows ] of the original image A [ cols, rows ], and ending the box type filtering;
2C, performing image pixel binarization segmentation, creating a binarized image array T, and calculating the value of T;
firstly, calculating an average coefficient ratio=1/(b_w×b_h), creating a parameter delta, creating a parameter type, and creating an array tab [768];
if the type is a bright pixel, which is binarized to 255, then: tab [0:255-delta ] =0, tab [255-delta,768] =255;
if the type is 255 after binarization of the dark pixel, then: tab [0:255-delta ] =255, tab [255-delta,768] =0;
then creating a binarized image array T [ cols ] and calculating the value T [ i ] =tab [ A [ i ] -ratio S [ i ] +255];
2D, calculating zero value pixel percentage, and measuring response value V of single frame image flow k
And 2E, accumulating the multi-frame image response values to obtain a flow response value.
2. The method for detecting the flow of the chemical industry sight glass based on the machine vision technology according to claim 1, wherein in the step 2D, the number n of the pixels with the value of 0 in the T is counted, the ratio p=n/(cols×rows) of the impurity or the water flow is calculated, and the response value V of the single frame image flow is measured k =100*P。
3. The method for detecting the flow of the chemical industry sight glass based on the machine vision technology according to claim 2, wherein in the step 2E, the index of the current frame 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 the value range is [0,100 x n ]];
Adding the flow response values of n frames of images in a certain time of the video stream:
CN202311468863.7A 2023-11-07 2023-11-07 Chemical industry sight glass flow detection method based on machine vision technology Pending CN117191141A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311468863.7A CN117191141A (en) 2023-11-07 2023-11-07 Chemical industry sight glass flow detection method based on machine vision technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311468863.7A CN117191141A (en) 2023-11-07 2023-11-07 Chemical industry sight glass flow detection method based on machine vision technology

Publications (1)

Publication Number Publication Date
CN117191141A true CN117191141A (en) 2023-12-08

Family

ID=88985440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311468863.7A Pending CN117191141A (en) 2023-11-07 2023-11-07 Chemical industry sight glass flow detection method based on machine vision technology

Country Status (1)

Country Link
CN (1) CN117191141A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103148905A (en) * 2013-02-03 2013-06-12 浙江大学 Micro-flow detection method based on recognition of droplet images at pipeline outlet
WO2014056951A1 (en) * 2012-10-08 2014-04-17 Pz Cormay S.A. Analytical method
CN105953850A (en) * 2016-06-27 2016-09-21 四川理工学院 Online fluid small flow detection system based on machine vision and online fluid small flow detection method based on machine vision for float flowmeter
CN116794040A (en) * 2022-12-14 2023-09-22 南通市海视光电有限公司 Chemical industry sight glass flow detection method based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014056951A1 (en) * 2012-10-08 2014-04-17 Pz Cormay S.A. Analytical method
CN103148905A (en) * 2013-02-03 2013-06-12 浙江大学 Micro-flow detection method based on recognition of droplet images at pipeline outlet
CN105953850A (en) * 2016-06-27 2016-09-21 四川理工学院 Online fluid small flow detection system based on machine vision and online fluid small flow detection method based on machine vision for float flowmeter
CN116794040A (en) * 2022-12-14 2023-09-22 南通市海视光电有限公司 Chemical industry sight glass flow detection method based on machine vision

Similar Documents

Publication Publication Date Title
US11200684B2 (en) Apparatus and method for measuring flow velocity of stream using optical flow image processing
Hay et al. A backlighted imaging technique for particle size measurements in two-phase flows
JP2004260574A (en) Flicker detecting method and detector
CN105321342B (en) A kind of intersection vehicles queue length detection method based on video of taking photo by plane
CN106228161B (en) A kind of pointer-type dial plate automatic reading method
CN103808492B (en) A kind of curve display packing of OTDR image data
CN102680481B (en) Detection method for cotton fiber impurities
CN108550160B (en) Non-uniform light bar characteristic region extraction method based on light intensity template
CN106408563B (en) A kind of snow noise detection method based on the coefficient of variation
CN102889907B (en) Flow monitoring device and flow monitoring method based on visual inspection
CN113012105B (en) Yarn hairiness detection and rating method based on image processing
Fan et al. Dim small target detection based on high-order cumulant of motion estimation
Rodrı́guez et al. Entrainment of gas in the liquid film of horizontal, annular, two-phase flow
CN110260945B (en) Total reflection type gas-liquid interface flow display method and gas-liquid interface position identification method
CN106124562A (en) A kind of Liquid water content measuring method
CN117191141A (en) Chemical industry sight glass flow detection method based on machine vision technology
CN106056612B (en) Blood layered recognition method
CN116794040A (en) Chemical industry sight glass flow detection method based on machine vision
CN106603942A (en) TOF camera noise reduction method
US10209404B2 (en) Method for measuring a particle precipitation rate, and device thereof
CN116309417A (en) Grid line detection method and device for solar cell
CN106530248A (en) Method for intelligently detecting scene video noise of transformer station
CN110231068B (en) Method for identifying gas-liquid interface position
CN101888568B (en) Method for measuring motion image response characteristic parameters
CN101925823B (en) Method for optical measurement of velocities according to spatial frequency filtering method and sensor for optical measurement of velocities

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