CN111089632A - Method and device for detecting liquid level of resin solution tank - Google Patents

Method and device for detecting liquid level of resin solution tank Download PDF

Info

Publication number
CN111089632A
CN111089632A CN201911251977.XA CN201911251977A CN111089632A CN 111089632 A CN111089632 A CN 111089632A CN 201911251977 A CN201911251977 A CN 201911251977A CN 111089632 A CN111089632 A CN 111089632A
Authority
CN
China
Prior art keywords
image
liquid level
gray
resin solution
value
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
CN201911251977.XA
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.)
North University of China
Original Assignee
North University of China
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 North University of China filed Critical North University of China
Priority to CN201911251977.XA priority Critical patent/CN111089632A/en
Publication of CN111089632A publication Critical patent/CN111089632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01FMEASURING VOLUME, VOLUME FLOW, MASS FLOW OR LIQUID LEVEL; METERING BY VOLUME
    • G01F23/00Indicating or measuring liquid level or level of fluent solid material, e.g. indicating in terms of volume or indicating by means of an alarm
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Fluid Mechanics (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention belongs to the field of precious metal production, and provides a method and a device for detecting the liquid level of a resin solution tank, which are more intelligent and stable and can realize automatic adjustment so as to maximize the concentration efficiency of a precious metal solution. The method comprises the following steps: 1) a camera is used for aligning to a resin solvent tank, and a video is collected; 2) performing tilt correction on the video image, and extracting a G component of the image as an original image to perform gray level enhancement; 3) carrying out binarization processing on the image to obtain a binarized image; 4) carrying out expansion and corrosion operation; 5) extracting the bottle body; 6) the liquid level height is determined by SOM clustering algorithm. According to the invention, the liquid level image of the resin solution tank on the industrial site is acquired in real time, so that the automatic adjustment of liquid level control is realized, and the concentration efficiency is maximized while the operation safety on the industrial site is ensured.

Description

Method and device for detecting liquid level of resin solution tank
Technical Field
The invention belongs to the field of precious metal production, and particularly relates to a method and a device for visually detecting the liquid level of a resin solution tank.
Background
The intelligent manufacturing is a modern manufacturing mode with comprehensiveness and high efficiency, greatly improves the yield, gradually becomes the mainstream of the global manufacturing development, and provides historical opportunity for China to enter a strong manufacturing line.
At present, the precious metal solution in a factory is concentrated, the liquid level is still manually adjusted manually, high-efficiency balance is difficult to realize, an overflow accident frequently occurs, certain threat is brought to the life safety of people, in the process of mass industrial production, the product quality is inspected by manual vision, the efficiency is low, the precision is not high, and the stability of the parameters of the product is difficult to guarantee. The traditional liquid level automatic detection methods include static pressure type liquid level measurement, floating body type liquid level measurement, capacitance type liquid level measurement and the like. However, static pressure measurement is greatly influenced by the density and temperature of a medium, the higher the requirement on the accuracy of the sensor is, and repeated calibration and timely maintenance and cleaning are needed when the sensor is used for a long time or liquid is replaced; in the capacitive measurement, the capacitive sensor is easily influenced by different container materials and solution properties, and has high output impedance, small output power, poor load capacity and large influence of parasitic capacitance; the floating body type measurement and detection precision is easily influenced by buoyancy, the repeatability precision is poor, different liquids need to be recalibrated, and the floating ball type measurement and detection device is not suitable for viscous or impurity-containing liquids and is easy to cause floating ball blockage. Based on factors such as environment, precision and manufacturing cost, a complete set of automatic system is particularly necessary, so that the labor condition can be improved, the labor intensity of workers is reduced, the production safety can be ensured, and the productivity is greatly improved.
Object recognition based on visual techniques refers to the process of finding a given object within a video or binary image. A great deal of research work is carried out in the aspects of target identification and tracking technology in countries in Europe and America. In the 90 s of the 20 th century, the university of massachusetts and other institutions of higher education in the united states began to study the application of video processing technology to civilian and military use. Many institutes in China also have achieved many achievements in the field of target recognition, such as the Chinese academy of sciences and the national defense science and technology university, the Qinghua university, and so on. Industrial vision inspection is increasingly used in the fields of network video communication, national defense and military and other various industrial productions. The Pailajuan provides a hydropneumatic control liquid level recognition technology based on computer vision (Pailajuan, recognition of hydropneumatic control liquid level of computer vision [ J ] university of Qingdao (Nature science version), 2017, 30, (1): 113-. Royal, et al (royal, liu kai hua, mao yong billao.a method for segmenting the affected part of a skin image [ P ]. chinese patent: 201610085988.5, 2016) propose a method for segmenting the affected part of a skin image by preprocessing the input skin image, converting HSV color space, completing the detection of skin color region and non-skin color region based on skin color detection algorithm, then filling the interior of the skin color region, calculating the optimal threshold T of the histogram by Otsu threshold method, eliminating the void inside the white region and smoothing the edge by the closure operation in morphological processing on the binarized image, finally marking the image edge and outputting. However, this method does not perform heterogeneous comparisons for different color space components, and there are no methods to find the maximum threshold value.
If a machine vision technology is introduced into the precious metal solution resin-passing impurity removal process, the production efficiency, the production automation degree and the life safety of workers can be effectively improved, automatic adjustment is realized, and the concentration efficiency is maximized. Because of from, for guaranteeing that noble metal refines efficiency and quality in the process, carry out the automated transformation to concentrated technology, design one set of detecting system that can the automatic identification resin solvent jar liquid level, can effectual improvement whole automatic system's effect, make its production more efficient and lower cost.
Disclosure of Invention
In order to realize the visual detection of the liquid levels of the resin solution tanks with different liquid levels and the control of the liquid levels, the invention provides a liquid level detection method and a liquid level detection device of the resin solution tank.
In order to solve the technical problems, the invention adopts the technical scheme that: a liquid level detection method for a resin solution tank comprises the following steps:
1) aligning a camera to a resin solvent tank, and continuously monitoring and acquiring a video;
2) performing tilt correction on each frame image in the video, and extracting a G component of the image as an original image to perform gray level enhancement;
3) obtaining an optimal segmentation threshold value based on a genetic algorithm, and performing binarization processing on the image to obtain a binarized image;
4) carrying out expansion and corrosion operation on the binarized image;
5) removing the rest connected components in the image, reserving the maximum connected component, and extracting the bottle body;
6) the liquid level height is determined by SOM clustering algorithm.
In the step 6), the specific step of determining the liquid level height by the SOM clustering algorithm is as follows:
A. initialization: inner star weight vector omega corresponding to each neuron in competition layerj(j is 1,2, …, m), the weight is initialized with smaller random value to establish the initial winning field Nj *(0) And an initial learning rate η, m being the number of neurons in the output layer;
B. inputting a sample: randomly taking an input mode from the training set, wherein the current input mode vector in the self-organizing network is
Figure BDA0002309302910000021
n is the number of input layer neurons; normalizing the currently input mode vector and the inner star weight vector;
C. finding winning neurons: the current input mode vector and the inner star weight vector W corresponding to all the neurons of the competition layerj(j ═ 1,2, …, m) similarity comparison is carried out, Euclidean distance is calculated, and the neuron with the minimum distance wins competition and is marked as a winning neuron;
D. adjusting the weight vector by the winning neuron;
E. when the learning efficiency α is less than or equal to αminAnd C, finishing the training, otherwise, turning to the step B to continue.
In the step 2), when performing tilt correction on each image, selecting Harris-based angular point feature detection to find the tilt angle, wherein the specific method for monitoring the angular points is as follows: firstly, calculating the gradient I of a pixel point I (x, y) in the x and y directionsxAnd Iy(ii) a Secondly, calculating a correlation matrix M on each pixel point; then, calculating a Harris angular point response value R of each pixel point; and finally, searching a maximum value point in the range of N multiplied by N, comparing the obtained maximum value point with a set initial threshold value, and regarding the Harris response value R as a corner point if the Harris response value R is greater than the threshold value.
In the step 2), the step of enhancing the image is as follows: the gray level enhancement is carried out by adopting piecewise linear transformation, and the expression of the piecewise linear transformation is as follows:
Figure BDA0002309302910000031
where f (x, y) represents the original image with a gray scale range of [ a, b ]](ii) a g (x, y) represents the transformed image with a linear extension of the gray scale range to [ c, d]Wherein F ismaxRepresenting the maximum gray scale range of the image before transformation, GmaxRepresenting the maximum gray scale range of the transformed image.
In the step 3), a specific method for obtaining the optimal segmentation threshold of the image based on the genetic algorithm comprises the following steps:
firstly, chromosome coding is carried out, namely, the target solution space is coded, the obtained image pixel number is represented by L, the gray value range is (0, L-1), and the histogram component P of the image is calculatediThe calculation formula is as follows: pi=Ni(ii) a/M; wherein N isiExpressing the number of pixels with the gray level i, and M is the total number of pixels;
secondly, setting a gray value threshold v, and dividing image pixels into two types: r0And R1;R0From grey values in the image in the range 0, V]Of all pixels in R1From gray-scale values in the range [ v +1, L-1]All the pixels of (1);
then, the maximum inter-class variance of the image is used as a fitness function, selection is carried out by a roulette selection method, and a gray value threshold value v which enables the inter-class variance to be maximum is calculated and used as an optimal segmentation threshold value;
the calculation formula of the between-class variance is as follows:
Figure BDA0002309302910000032
wherein m isGRepresenting the mean gray level, P, of the image0Representing a pixel being classified into R0M (v) represents the cumulative pixel gray average up to level v.
In addition, the invention also provides a liquid level detection system device of the resin solvent tank, which comprises a liquid level visual detection device and an intelligent image acquisition device, wherein the liquid level visual detection device comprises a bracket and a camera; the intelligent image acquisition device comprises an image acquisition card, a computer and an acousto-optic electric alarm device;
the camera transmits a video image to a computer through a video capture card, and the computer is used for analyzing the video image to obtain the real-time height of the liquid level during concentration; the liquid level alarm device is also used for judging the abnormal condition of the liquid level and sending an alarm prompt through the acousto-optic-electric alarm device (12) when the abnormal condition is found; and the device is also used for sending a control signal to the PLC and the electric cabinet when the real-time height of the liquid level of the solution in the resin solvent tank reaches a critical value, and controlling the flow rate when different liquid levels are controlled and the flow rate between the mutually communicated resin solution tanks to be matched.
According to the liquid level detection system device for the resin solvent tank, the camera is fixedly mounted on the support, the height of the camera is adjusted through the height control knob, and the support is fixedly arranged on a wall or a roof.
Compared with the prior art, the invention has the following beneficial effects:
1. aiming at the liquid level visual detection of a researched resin solution tank, a liquid level image is obtained through a camera, the liquid level image is timely transmitted to a PLC and an electric cabinet through image preprocessing, key feature extraction, liquid level calculation and other steps, whether an alarm is required to be sent to a worker or not is analyzed and autonomously judged according to a software intelligent processing algorithm, and the method has good real-time performance and robustness.
2. Compared with the traditional liquid level visual detection object with simple operation environment and single change, the resin solution tank is operated in a complex industrial environment, and the risk of overflow accidents is high. In addition, the change of the liquid level height is realized, and simultaneously, the change of the color of the monitored object caused by the real-time change of the concentration is realized, so that the monitored object is monitored and controlled among communicating tank bodies with different installation heights, different liquid level heights and different concentrations, and the complexity is quite high. This design is passed through the camera and is monitored resin solution jar in real time to carry out concrete analysis to the video that detects out, image module through image processing, in time transmit PLC and electric cabinet through transmission device when solution reaches a certain critical value in the resin solvent jar, flow when controlling different liquid levels and the flow between the resin solution jar that communicates each other match, and in time report to the police to the staff and indicate. The automatic control system overcomes a series of problems that the control of the resin solution in a complex industrial field needs manual regulation, high-efficiency balance is difficult to realize, overflow accidents often happen and the like, realizes the automatic regulation of liquid level control, and maximizes the concentration efficiency while ensuring the operation safety of the industrial field.
Drawings
FIG. 1 is a schematic diagram of the apparatus of the present invention;
FIG. 2 is an example resin solution tank inclination correction image;
FIG. 3 is an example resin solution tank RGB color space image;
FIG. 4 is a G component image after gray scale enhancement by piecewise linear transformation of the resin solution tank in the embodiment;
FIG. 5 is an image after binarization processing of the resin solution tank in the example;
FIG. 6 is an image after the dilation and erosion operations in the example;
FIG. 7 is an extracted image of a solution tank in an implementation;
FIG. 8 is an image of the final solution liquid component in practice;
FIG. 9 is the error of percentage value of the liquid level of the solution in the implementation;
in the figure: 1. the device comprises a steam electric proportional valve 2, a resin solution tank 3, a liquid anti-corrosion electric proportional valve 4, a camera support 5, a knob 6, a camera 7, a video acquisition card 8, image processing software 9, a computer display screen 10, a resin solution visual image 11, a computer 12 and an automatic alarm device.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments; all other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method for detecting the liquid level of a resin solution tank, which comprises the following steps:
1) a camera is aimed directly at a resin solvent tank and video is continuously monitored and acquired.
As shown in fig. 1, a schematic diagram of an apparatus used in the detection method according to an embodiment of the present invention includes a liquid level visual detection apparatus and an intelligent image acquisition apparatus, where the liquid level visual detection apparatus includes a support 4 and a camera 6; the intelligent image acquisition device comprises an image acquisition card 7, a computer 11 and an acousto-optic electric alarm device 12; the camera 6 transmits a video image to the computer 11 through the video acquisition card 7, and the computer 11 is used for analyzing the video image to obtain the real-time height of the liquid level during concentration; the liquid level alarm device is also used for judging the abnormal condition of the liquid level and sending an alarm prompt through the acousto-optic-electric alarm device 12 when the abnormal condition is found; and the device is also used for sending a control signal to the PLC and the electric cabinet when the real-time height of the liquid level of the solution in the resin solvent tank reaches a critical value, and controlling the flow rate when different liquid levels are controlled and the flow rate between the mutually communicated resin solution tanks to be matched.
Further, as shown in fig. 1, a camera 6 is fixedly installed on a bracket 4, the height of the camera 6 is adjusted by a height control knob 5, and the bracket 4 is fixedly installed on a wall or a roof.
And selecting 10 continuous frames of images in the concentration process, carrying out the image processing on the acquired images, and processing and analyzing the data.
2) And performing inclination correction on each frame image in the video, and extracting a G component of the image as an original image to perform gray level enhancement.
During image acquisition, the image is subject to a certain degree of tilt, and in order to obtain an accurate processing result, it is necessary to perform a tilt correction process. The image is generally subjected to tilt correction in two steps: firstly, searching an inclination angle; and secondly, carrying out coordinate transformation, thereby obtaining a corrected image. There are two commonly used methods of angle finding: one is to find the tilt angle by using Hough transform; another is to use corner detection to find the tilt angle. Based on the characteristics that the Harris operator has gray scale invariance, rotation invariance, scale invariance and the like, the Harris-based angular point feature detection is adopted in the embodiment.
A corner is usually defined as the intersection of two edges, and in practice most of the so-called corner detection methods detect image points with specific features, not just "corners". These feature points have specific coordinates in the image and have certain mathematical features such as local maximum or minimum gray levels, certain gradient features, etc.
Shifting the image I (x, y) window [ u, v ] yields the autocorrelation function of the gray scale change as follows:
E(x,y,u,v)=∑(x,y)εZw(x,y)[I(x+u,y+v)-I(x,y)]2;(1)
where [ u, v ] is the window shift direction and shift amount, Z represents the window shift region, and w (x, y) is a Gaussian weighting function.
Taylor expansion I (x + u, y + v) is as follows:
I(x+u,y+v)=I(x,y)+Ixu+Iyv+O(u2,v2);(2)
the gray scale is transformed to:
Figure BDA0002309302910000061
Figure BDA0002309302910000062
in the formula, M is a 2 × 2 matrix, E (x, y, u, v) is an elliptic equation, and the eigenvalue of M represents the fastest direction and the slowest direction of the gray scale change.
In this embodiment, when detecting the corner point, first, the gradient I of the pixel point I (x, y) in the x and y directions is calculatedxAnd Iy
Figure BDA0002309302910000063
Figure BDA0002309302910000064
Secondly, calculating a correlation matrix M on each pixel:
Figure BDA0002309302910000065
Figure BDA0002309302910000066
Figure BDA0002309302910000067
then, by calculating a Harris corner response value R of each pixel:
R=(ab-c2)-k(a+b)2;(10)
wherein k is an empirical constant, and is generally 0.04-0.06.
And finally, searching a maximum value point of the image I (x, y) in the range of N multiplied by N, wherein N is an image pixel point. The obtained maximum value point is compared with the set initial threshold value, if the Harris response value R is larger than the set threshold value, the Harris response value R is regarded as a corner point, and the tilt-corrected image is shown in fig. 2.
The collected graph is subjected to different component extraction, and a red component R (x, y) image, a green component G (x, y) image and a blue component B (x, y) image are obtained, as shown in fig. 3. By comparison, the G component in the RGB color space is taken as the original image of the image processing. The gray scale transformation enhancement can change the contrast of the image from weak to strong, so that each pixel value in the image is distributed as uniformly as possible or distributed in a certain form, thereby improving the quality of the image. The resin solution is brown, the processing effect of the image is compared by two methods of linear transformation and nonlinear transformation, and the gray level enhancement by piecewise linear transformation is determined. Let the original image be f (x, y), whose gray scale range is [ a, b ]; and if the transformed image is g (x, y), and the gray scale range is linearly expanded to [ c, d ], for the gray scale value f (x, y) of any point in the image, the transformed gray scale value is g (x, y), and the piecewise linear transformation expression is as follows:
Figure BDA0002309302910000071
wherein, FmaxRepresenting the maximum gray scale range of the image before transformation, GmaxRepresenting the maximum gray scale range of the transformed image. The image quality can be effectively improved by piecewise linear transformation, and the image after gray level enhancement is shown in fig. 4.
3) And obtaining an optimal segmentation threshold value based on a genetic algorithm, and performing binarization processing on the image to obtain a binarized image.
The binarization of the gray level image has a very important position in the process of processing the digital image, and the binarization of the image is favorable for further processing of the image, so that the image is simple, the data volume is reduced, the contour image of a target can be highlighted, and the subsequent image processing and analysis are convenient. In this example, the optimal segmentation threshold is derived based on a genetic algorithm.
Firstly, chromosome coding is carried out, namely, a target solution space is coded, wherein the collected image is an 8-bit gray picture, and 8-bit binary code strings are used for coding. Secondly, determining a fitness function, wherein the image range with the number of the collected image pixels being L is (0, L-1), and the histogram component of the image normalization is as follows:
Pi=Ni/M; (12)
wherein N isiThe number of pixels whose gray scale is i is represented, and M is the total number of pixels. Setting a threshold value v, and dividing image pixels into two types: r0And R1。R0From grey values in the image in the range 0, v]Of all pixels in R1From gray-scale values in the range [ v +1, L-1]All the pixel components of[12]. The expression for the threshold is as follows:
Figure BDA0002309302910000072
the average gray scale of the image is:
Figure BDA0002309302910000073
the pixel is classified into R0The probability of (c) is:
Figure BDA0002309302910000081
the cumulative pixel gray average up to level v is:
Figure BDA0002309302910000082
the inter-class variance thus gives:
Figure BDA0002309302910000083
the maximum inter-class variance of the image is used as a fitness function, a roulette selection method is used for selecting, and an optimal storage strategy is combined to ensure that the current individual with the optimal fitness can evolve to the next generation without being damaged by the randomness of genetic operation, so that the convergence of the algorithm is ensured. And performing crossing and compiling. Make it
Figure BDA0002309302910000084
Maximum P0The threshold v corresponding to the value is the optimum region segmentation threshold, and the image after the binarization processing is shown in fig. 5.
4) And carrying out expansion and corrosion operation on the binarized image.
The expansion in mathematical morphology can merge background points around the image into the object, and two objects with close distance can be connected together through the expansion operation, so that the cavity after the object is divided can be filled. The corrosion can eliminate the boundary points of the objects, and the objects with different sizes can be removed by selecting the structural elements with different sizes, so that two objects with small communication are separated.
And (3) expansion operation: in this embodiment, A represents a set to be processed, B represents a structural element to be used for processing, and Z represents2The sets a and B of the upper elements,a is swollen with B and is recorded as
Figure BDA0002309302910000085
Is defined as:
Figure BDA0002309302910000086
b is mapped with respect to the origin, and then the translation map is translated by z, where the intersection of the A and B maps is not an empty set. Namely, the displacement of the B mapping is in a set of the original positions of B when at least 1 nonzero element of A intersects, and the set formed by all the z points is the expansion image of B to A.
And (3) corrosion operation: to Z2The set of the upper elements A and B, the etching of A with B, is denoted A! B, formalized definition:
Figure BDA0002309302910000087
the result of A's erosion with B is a set of z's that satisfy the requirement that B is still all contained in A after translation, and all z's are made up of the origin points that B is all contained in A after translation. The set of all such z points is the dilated image of S vs. The image after the dilation and erosion operations is shown in fig. 6.
5) And removing the rest connected components in the image, keeping the maximum connected component, and extracting the bottle body.
Determining the pixel range of the bottle: from the image processing results, the obtained pixel range of the bottle in the pixel coordinate system is u ∈ [198,352], v ∈ [113,798], and the pixel height h of the bottle is 686. The vial was extracted as shown in FIG. 7.
6) The liquid level height is determined by SOM clustering algorithm.
The image is segmented by adopting an SOM clustering algorithm, the gray level of each pixel point of the resin liquid level image can be used as a sample, and the whole image forms a sample space, so that the task of image segmentation is converted into a clustering task of a data set. SOM clustering is an unsupervised learning method, and is characterized in that internal rules and different attributes in samples are automatically searched, pixel points in an image space are represented by corresponding feature vectors, the feature space is segmented according to feature similarity of the pixel points in the feature space, and then the feature space is mapped back to an original image space, so that segmentation is completed.
a. Initialization: inner star weight vector omega corresponding to each neuron in competition layerj(j is 1,2, …, m), the weight is initialized with smaller random value to establish the initial winning field Nj *(0) And an initial learning rate η, m is the number of neurons in the output layer.
b. Inputting a sample: randomly taking an input mode from the training set, wherein the current input mode vector in the self-organizing network is
Figure BDA0002309302910000091
n is the input layer neuron number.
For X, omegajAnd (3) carrying out normalization:
Figure BDA0002309302910000092
Figure BDA0002309302910000093
c. finding winning neurons
The inner star weight vector W corresponding to all the neurons of the X and competition layerj(j ═ 1,2, …, m) for similarity comparisons. The most similar neuron wins with a weight vector of Wj*. The euclidean distance of the samples and the weight vectors is calculated,
Figure BDA0002309302910000094
the least distant neuron wins the competition and is designated as the winning neuron.
d. Weight adjustment
Figure BDA0002309302910000095
Winning neuron adjusted weight vector WjSpecifically, the method comprises the following steps:
Figure BDA0002309302910000096
wherein, 0<α is equal to or less than 1, is the learning efficiency, training time and j of the j-th neuron and the winning neuron in the field*α generally decrease as the learning multidimensional progresses, i.e., the degree of adjustment becomes smaller and smaller, toward the cluster center.
e. End of judgment
When α is not more than αminWhen the training is finished, otherwise, go to step b to continue αminA threshold value representing learning efficiency.
Comparing different clustering algorithms, the K-means clustering algorithm must give the number of clusters in advance and is sensitive to noise and isolated points. The SOM clustering imposes adjacent relation on a cluster centroid, and clusters which are adjacent to each other are more related than non-adjacent clusters, so that the processing effect on a complex industrial field is better. As shown in fig. 8, a liquid component image. The pixel range of the bottle in the pixel coordinate system is u e [198,352], v e [113,798], and the pixel height h of the bottle is 686.
A threshold value is determined by selecting and dividing the algorithm into an SOM clustering algorithm, and the height of the liquid level is determined. We obtained the liquid level u coordinate of 10 frames of pictures by calculation, as shown in table 1.
Level u coordinate of table 110 frame picture
Actual u coordinate Solving for u coordinates Deviation of coordinates Bottle pixel height
605 607.8616 -2.8616 686
607 608.3612 -1.3612 673
610 610.1032 -0.1032 668
610 610.5981 -0.5981 679
611 612.5367 -1.5367 682
612 614.1765 -2.1765 697
613 614.8632 -1.8632 689
614 616.1361 -2.1361 675
614 617.7642 -3.7642 691
616 619 -3 686
The average value of the deviation between the u coordinate obtained by image processing and the actual u coordinate is-1.9401, and the error causes are as follows: (1) the reflection of light by the liquid surface may cause systematic errors. (2) When the liquid level height position is actually measured, because the liquid level height cannot be accurately measured, a measurement error is generated, so that the error is more serious when the measurement data and the experimental data are compared; (3) due to the fact that the camera is fixed, the liquid level height position shot by the camera can be correspondingly shifted due to different shooting angles of the resin solution tank at different positions.
The liquid level coordinates obtained by image processing were corrected, the average value of the deviations was added to the initial coordinates, and the corrected coordinates were taken as the final result, as shown in table 2.
TABLE 2 corrected liquid level coordinates
Figure BDA0002309302910000101
Figure BDA0002309302910000111
The percentage error in liquid level was plotted for the 10 sets of corrected data, as shown in FIG. 9. By extracting data images from 50 different liquid level heights, the liquid level detection result can obtain more than 98.5% of precision after the tank body and the liquid component are accurately extracted.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (7)

1. A method for detecting the liquid level of a resin solution tank is characterized by comprising the following steps:
1) aligning a camera to a resin solvent tank, and continuously monitoring and acquiring a video;
2) performing tilt correction on each frame image in the video, and extracting a G component of the image as an original image to perform gray level enhancement;
3) obtaining an optimal segmentation threshold value based on a genetic algorithm, and performing binarization processing on the image to obtain a binarized image;
4) carrying out expansion and corrosion operation on the binarized image;
5) removing the rest connected components in the image, reserving the maximum connected component, and extracting the bottle body;
6) the liquid level height is determined by SOM clustering algorithm.
2. The method for monitoring the liquid level of the resin solution tank as claimed in claim 1, wherein in the step 6), the specific step of determining the liquid level height by the SOM clustering algorithm is as follows:
A. initialization: inner star weight vector omega corresponding to each neuron in competition layerj(j ═ 1,2, …, m), the weights are initialized with random values, establishing the initial winning field Nj *(0) And an initial learning rate η, m being the number of neurons in the output layer;
B. input deviceSample preparation: randomly taking an input mode from the training set, wherein the current input mode vector in the self-organizing network is
Figure FDA0002309302900000011
n is the number of input layer neurons; normalizing the currently input mode vector and the inner star weight vector;
C. finding winning neurons: the current input mode vector and the inner star weight vector omega corresponding to all the neurons of the competition layer are comparedj(j ═ 1,2, …, m) similarity comparison is carried out, Euclidean distance is calculated, and the neuron with the minimum distance wins competition and is marked as a winning neuron;
D. adjusting the weight vector by the winning neuron;
E. when the learning efficiency α is less than or equal to αminWhen it is time to finish training, αminA threshold value representing learning efficiency, otherwise go to step B and continue.
3. The method according to claim 1, wherein in the step 2), when performing tilt correction on each image, a Harris-based corner feature detection is selected to find the tilt angle, and the corner monitoring method specifically comprises: firstly, calculating the gradient I of a pixel point I (x, y) in the x and y directionsxAnd Iy(ii) a Secondly, calculating a correlation matrix M on each pixel point; then, calculating a Harris angular point response value R of each pixel point; and finally, searching a maximum value point of the Harris corner response value R in the image range, comparing the obtained maximum value point with the set initial threshold value, and if the maximum value point is greater than the threshold value, regarding the maximum value point as a corner point.
4. The method for monitoring the liquid level of the resin solution tank as claimed in claim 1, wherein in the step 2), the step of enhancing the image comprises: the gray level enhancement is carried out by adopting piecewise linear transformation, and the expression of the piecewise linear transformation is as follows:
Figure FDA0002309302900000021
where f (x, y) represents the original image with a gray scale range of [ a, b ]](ii) a g (x, y) represents the transformed image with a linear extension of the gray scale range to [ c, d]Wherein F ismaxRepresenting the maximum gray scale range of the image before transformation, GmaxRepresenting the maximum gray scale range of the transformed image.
5. The method for monitoring the liquid level of the resin solution tank according to claim 1, wherein in the step 3), the specific method for obtaining the optimal segmentation threshold of the image based on the genetic algorithm comprises:
firstly, chromosome coding is carried out, namely, the target solution space is coded, the obtained image pixel number is represented by L, the gray value range is (0, L-1), and the histogram component P of the image is calculatediThe calculation formula is as follows: pi=Ni(ii) a/M; wherein N isiExpressing the number of pixels with the gray level i, and M is the total number of pixels;
secondly, setting a gray value threshold v, and dividing image pixels into two types: r0And R1;R0From grey values in the image in the range 0, v]Of all pixels in R1From gray-scale values in the range [ v +1, L-1]All the pixels of (1);
then, the maximum inter-class variance of the image is used as a fitness function, selection is carried out by a roulette selection method, and a gray value threshold value v which enables the inter-class variance to be maximum is calculated and used as an optimal segmentation threshold value;
the calculation formula of the between-class variance is as follows:
Figure FDA0002309302900000022
wherein m isGRepresenting the mean gray level, P, of the image0Representing a pixel being classified into R0M (v) represents the cumulative pixel gray average up to level v.
6. A liquid level detection system device of a resin solvent tank is characterized by comprising a liquid level visual detection device and an intelligent image acquisition device, wherein the liquid level visual detection device comprises a bracket (4) and a camera (6); the intelligent image acquisition device comprises an image acquisition card (7), a computer (11) and an acousto-optic electric alarm device (12);
the camera (6) transmits a video image to the computer (11) through the video acquisition card (7), and the computer (11) is used for analyzing the video image to obtain the real-time height of the liquid level during concentration; the liquid level alarm device is also used for judging the abnormal condition of the liquid level and sending an alarm prompt through the acousto-optic-electric alarm device (12) when the abnormal condition is found; and the device is also used for sending a control signal to the PLC and the electric cabinet when the real-time height of the liquid level of the solution in the resin solvent tank reaches a critical value, and controlling the flow rate when different liquid levels are controlled and the flow rate between the mutually communicated resin solution tanks to be matched.
7. The system device for detecting the liquid level of a resin solvent tank according to claim 6, wherein: the camera (6) is fixedly arranged on the support (4), the height of the camera (6) is adjusted through the height control knob (5), and the support (4) is fixedly arranged on a wall or a roof.
CN201911251977.XA 2019-12-09 2019-12-09 Method and device for detecting liquid level of resin solution tank Pending CN111089632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911251977.XA CN111089632A (en) 2019-12-09 2019-12-09 Method and device for detecting liquid level of resin solution tank

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911251977.XA CN111089632A (en) 2019-12-09 2019-12-09 Method and device for detecting liquid level of resin solution tank

Publications (1)

Publication Number Publication Date
CN111089632A true CN111089632A (en) 2020-05-01

Family

ID=70396295

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911251977.XA Pending CN111089632A (en) 2019-12-09 2019-12-09 Method and device for detecting liquid level of resin solution tank

Country Status (1)

Country Link
CN (1) CN111089632A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115772A (en) * 2020-08-06 2020-12-22 摩力孚环保科技有限公司 Waste liquid recovery detection monitoring system and method based on infrared thermal imaging technology
CN112666047A (en) * 2021-01-14 2021-04-16 新疆大学 Liquid viscosity detection method
CN113183608A (en) * 2021-04-23 2021-07-30 广州诚鼎机器人有限公司 Slurry supplementing equipment and elliptical printing machine
CN113566927A (en) * 2021-07-08 2021-10-29 中国航发湖南动力机械研究所 Liquid level measuring device and method for container with variable inclination angle
CN113577422A (en) * 2021-07-12 2021-11-02 健帆生物科技集团股份有限公司 Quality inspection method and assembly method of dialyzer

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6636842B1 (en) * 2000-07-15 2003-10-21 Intevep, S.A. System and method for controlling an industrial process utilizing process trajectories
CN102494733A (en) * 2011-12-12 2012-06-13 西安电子科技大学 Water level monitoring system based on image processing and method
CN103886612A (en) * 2014-04-08 2014-06-25 马鸿旭 Automatic water level extraction method and system based on reservoir monitoring camera
CN107631782A (en) * 2017-07-18 2018-01-26 南京邮电大学 A kind of level testing methods based on Harris Corner Detections
CN108830824A (en) * 2018-04-16 2018-11-16 中北大学 Transfusion liquid facial vision detects alarm system and its detection method
CN109443480A (en) * 2018-11-02 2019-03-08 南京邮电大学 Gauge positioning and water level measurement method based on image procossing
US20200124461A1 (en) * 2018-10-18 2020-04-23 Endress+Hauser Conducta Gmbh+Co. Kg Method for determining a process variable with a classifier for selecting a measuring method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6636842B1 (en) * 2000-07-15 2003-10-21 Intevep, S.A. System and method for controlling an industrial process utilizing process trajectories
CN102494733A (en) * 2011-12-12 2012-06-13 西安电子科技大学 Water level monitoring system based on image processing and method
CN103886612A (en) * 2014-04-08 2014-06-25 马鸿旭 Automatic water level extraction method and system based on reservoir monitoring camera
CN107631782A (en) * 2017-07-18 2018-01-26 南京邮电大学 A kind of level testing methods based on Harris Corner Detections
CN108830824A (en) * 2018-04-16 2018-11-16 中北大学 Transfusion liquid facial vision detects alarm system and its detection method
US20200124461A1 (en) * 2018-10-18 2020-04-23 Endress+Hauser Conducta Gmbh+Co. Kg Method for determining a process variable with a classifier for selecting a measuring method
CN109443480A (en) * 2018-11-02 2019-03-08 南京邮电大学 Gauge positioning and water level measurement method based on image procossing

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
KUN-SEOK OH,ET AL.: "SOM-based R*-tree for similarity retrieval", 《PROCEEDINGS SEVENTH INTERNATIONAL CONFERENCE ON DATABASE SYSTEMS FOR ADVANCED APPLICATIONS》 *
MARGARITA FAVORSKAYA,ET AL.: "Image inpainting based on self-organizing maps by using multi-agent implementation", 《PROCEDIA COMPUTER SCIENCE》 *
王福杰 等: "基于MPSO-BP神经网络的PSD误差补偿", 《仪表技术与传感器》 *
程高庆: "基于数字图像处理的水位标尺识别研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
陈雯柏 等: "《人工神经网路原理与实践》", 31 January 2016 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115772A (en) * 2020-08-06 2020-12-22 摩力孚环保科技有限公司 Waste liquid recovery detection monitoring system and method based on infrared thermal imaging technology
CN112666047A (en) * 2021-01-14 2021-04-16 新疆大学 Liquid viscosity detection method
CN113183608A (en) * 2021-04-23 2021-07-30 广州诚鼎机器人有限公司 Slurry supplementing equipment and elliptical printing machine
CN113183608B (en) * 2021-04-23 2022-04-22 广州诚鼎机器人有限公司 Slurry supplementing equipment and elliptical printing machine
CN113566927A (en) * 2021-07-08 2021-10-29 中国航发湖南动力机械研究所 Liquid level measuring device and method for container with variable inclination angle
CN113566927B (en) * 2021-07-08 2024-02-27 中国航发湖南动力机械研究所 Variable dip angle container liquid level measuring device and method
CN113577422A (en) * 2021-07-12 2021-11-02 健帆生物科技集团股份有限公司 Quality inspection method and assembly method of dialyzer
CN113577422B (en) * 2021-07-12 2023-05-26 健帆生物科技集团股份有限公司 Quality inspection method and assembly method of dialyzer

Similar Documents

Publication Publication Date Title
CN111089632A (en) Method and device for detecting liquid level of resin solution tank
CN113469177B (en) Deep learning-based drainage pipeline defect detection method and system
CN111626190B (en) Water level monitoring method for scale recognition based on clustering partition
CN113160192B (en) Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background
CN107145905B (en) Image recognition detection method for looseness of elevator fastening nut
WO2019228063A1 (en) Product inspection terminal, method and system, computer apparatus and readable medium
CN110647850A (en) Automatic lane deviation measuring method based on inverse perspective principle
CN108921163A (en) A kind of packaging coding detection method based on deep learning
CN104751187A (en) Automatic meter-reading image recognition method
CN109242870A (en) A kind of sea horizon detection method divided based on image with textural characteristics
CN110097596A (en) A kind of object detection system based on opencv
CN111879244B (en) Method for measuring support height and top beam inclination angle of hydraulic support of fully mechanized mining face
CN117689655B (en) Metal button surface defect detection method based on computer vision
CN108460344A (en) Dynamic area intelligent identifying system in screen and intelligent identification Method
CN116310845A (en) Intelligent monitoring system for sewage treatment
CN111476246A (en) Robust and efficient intelligent reading method for pointer instrument applied to complex environment
CN116205907A (en) Decorative plate defect detection method based on machine vision
CN112102189B (en) Line structure light bar center line extraction method
CN112396580B (en) Method for detecting defects of round part
CN115984360B (en) Method and system for calculating length of dry beach based on image processing
CN112112631A (en) Intelligent identification method for indicator diagram of oil pumping unit
CN116883498A (en) Visual cooperation target feature point positioning method based on gray centroid extraction algorithm
CN116486212A (en) Water gauge identification method, system and storage medium based on computer vision
CN115761467A (en) Underwater target detection method based on high-low frequency characteristic difference pyramid neural network
CN112581472B (en) Target surface defect detection method facing human-computer interaction

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200501

RJ01 Rejection of invention patent application after publication