CN116952930A - Permanganate index titration method and system - Google Patents
Permanganate index titration method and system Download PDFInfo
- Publication number
- CN116952930A CN116952930A CN202310656619.7A CN202310656619A CN116952930A CN 116952930 A CN116952930 A CN 116952930A CN 202310656619 A CN202310656619 A CN 202310656619A CN 116952930 A CN116952930 A CN 116952930A
- Authority
- CN
- China
- Prior art keywords
- titration
- frame
- calculating
- color
- space
- 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
Links
- 238000004448 titration Methods 0.000 title claims abstract description 136
- 238000004364 calculation method Methods 0.000 claims abstract description 58
- 238000006243 chemical reaction Methods 0.000 claims abstract description 58
- 238000000034 method Methods 0.000 claims abstract description 44
- 238000013139 quantization Methods 0.000 claims abstract description 43
- 238000009432 framing Methods 0.000 claims abstract description 19
- 239000012286 potassium permanganate Substances 0.000 claims abstract description 18
- 238000001514 detection method Methods 0.000 claims abstract description 13
- 238000002474 experimental method Methods 0.000 claims abstract description 13
- 238000011161 development Methods 0.000 claims description 7
- 230000018109 developmental process Effects 0.000 claims description 7
- 230000036632 reaction speed Effects 0.000 claims description 7
- 230000000007 visual effect Effects 0.000 claims description 6
- 239000003086 colorant Substances 0.000 claims description 5
- 238000012545 processing Methods 0.000 claims description 4
- 230000004456 color vision Effects 0.000 claims description 3
- 125000004122 cyclic group Chemical group 0.000 claims description 3
- 238000009792 diffusion process Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 230000001105 regulatory effect Effects 0.000 claims description 3
- 230000011218 segmentation Effects 0.000 claims description 3
- 230000002194 synthesizing effect Effects 0.000 claims description 3
- 230000004304 visual acuity Effects 0.000 claims description 3
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 abstract description 19
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 description 5
- 238000005259 measurement Methods 0.000 description 5
- 229910052760 oxygen Inorganic materials 0.000 description 5
- 239000001301 oxygen Substances 0.000 description 5
- 238000012544 monitoring process Methods 0.000 description 4
- KMUONIBRACKNSN-UHFFFAOYSA-N potassium dichromate Chemical compound [K+].[K+].[O-][Cr](=O)(=O)O[Cr]([O-])(=O)=O KMUONIBRACKNSN-UHFFFAOYSA-N 0.000 description 4
- 238000002798 spectrophotometry method Methods 0.000 description 4
- 239000000126 substance Substances 0.000 description 4
- 238000002835 absorbance Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 3
- 238000000354 decomposition reaction Methods 0.000 description 3
- 239000007800 oxidant agent Substances 0.000 description 3
- 230000001590 oxidative effect Effects 0.000 description 3
- 238000005375 photometry Methods 0.000 description 3
- 230000001276 controlling effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000000691 measurement method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000003651 drinking water Substances 0.000 description 1
- 235000020188 drinking water Nutrition 0.000 description 1
- 239000010842 industrial wastewater Substances 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 230000033116 oxidation-reduction process Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000010865 sewage Substances 0.000 description 1
- 239000002352 surface water Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/75—Systems in which material is subjected to a chemical reaction, the progress or the result of the reaction being investigated
- G01N21/77—Systems in which material is subjected to a chemical reaction, the progress or the result of the reaction being investigated by observing the effect on a chemical indicator
- G01N21/78—Systems in which material is subjected to a chemical reaction, the progress or the result of the reaction being investigated by observing the effect on a chemical indicator producing a change of colour
- G01N21/79—Photometric titration
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/46—Measurement of colour; Colour measuring devices, e.g. colorimeters
- G01J2003/467—Colour computing
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N2021/8411—Application to online plant, process monitoring
Landscapes
- Physics & Mathematics (AREA)
- Chemical & Material Sciences (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Plasma & Fusion (AREA)
- Chemical Kinetics & Catalysis (AREA)
- Engineering & Computer Science (AREA)
- Investigating Or Analyzing Non-Biological Materials By The Use Of Chemical Means (AREA)
Abstract
The invention belongs to the technical field of water detection, and particularly relates to a permanganate index titration method and system. The method comprises the following steps: s1, collecting a potassium permanganate titration video, and framing; s2, performing color space conversion on the RGB image after framing, and converting the RGB image into an HSV space; s3, calculating the H component, generating a histogram, and calculating the similarity value of the histogram of the H channel; s4, calculating the S component, generating a histogram, and calculating the saturation of the histogram of the S channel; s5, taking the video frame meeting the calculation result as a titration frame M for the beginning of the experiment, and calculating the reaction rate of the subsequent frames; s6, calculating the gradient of the color region of the multiple anchor frames; and S7, calculating a color quantization interval of the video frame after the titration starts, and detecting a jump frame of the quantization interval after the color reaction ends. The invention has the characteristics of improving the precision of the titration critical value, improving the timeliness and the accuracy of titration and realizing automatic detection.
Description
Technical Field
The invention belongs to the technical field of water detection, and particularly relates to a permanganate index titration method and system.
Background
Chemical Oxygen Demand (COD) is an important index for monitoring organic pollution of water body, and can reflect pollution degree of water body. COD measurement values are different due to the difference of reducing substances, oxidant types and measurement methods in the water body. The common COD measurement method mainly comprises a potassium dichromate method and a potassium permanganate method (permanganate index method), wherein the former method uses potassium dichromate as an oxidant, and is suitable for measuring heavy pollution water bodies such as domestic sewage, industrial wastewater and the like; the latter uses potassium permanganate as oxidant, is suitable for measuring water bodies with lighter pollution, such as surface water, drinking water, and the like, and has the advantages of small secondary pollution, high analysis speed, and the like.
The traditional permanganate index method relies on manual on-site sampling and then is carried back to a laboratory for analysis, and has the defects that the sample is easy to be polluted in the transportation process, the water quality analysis data is lagged, and the like. The permanganate index online analyzer can realize real-time, rapid and automatic water quality monitoring and is convenient to operate. The detection methods adopted by the main stream permanganate index online analyzer in the market mainly comprise a spectrophotometry method, an oxidation-reduction potential method and a titration method. Because the water quality in each region is different, the color of the water body and the turbidity caused by various substances dissolved in the water body can have certain influence on the light intensity, so that the measurement result of a spectrophotometry is inaccurate. The redox potential method has problems of high manufacturing cost and short lifetime of the electrode. The titration method mainly judges the titration end point according to the principles of photometry and titration jump, is not easily interfered by chromaticity and turbidity of a water sample, has relatively simple operation, higher accuracy, lower cost and longer service life, and has wider application prospect. However, the judgment of the titration critical value and the control of the titration speed are usually carried out manually by the current titration method, and the method has the problems of human error, long time consumption, low automation degree and the like.
Therefore, it is necessary to design a permanganate index titration method and system capable of improving the titration critical value accuracy, improving the titration timeliness and accuracy and realizing automatic detection.
For example, an on-line monitoring and automatic titration determination method for permanganate index and a device thereof described in chinese patent application No. CN201710723721.9 are disclosed, based on an automatic measurement flow, the endpoint is determined together with two modes of absorbance and potential, in the titration determination method, the relationship between the change of absorbance and potential of a solution and the titration volume is utilized simultaneously, the whole titration process is designed in stages and in different conditions, and different titration speeds are adopted in different titration stages, so as to ensure the titration accuracy. And simultaneously, by utilizing the two conditions of absorbance and potential, when the solution is automatically dripped, the condition that the photometry judges the end point is met, and the condition that the electrode judges the end point is met, so that the titration can be judged to reach the end point. Although the problems that the traditional photometry is interfered by factors such as water color and turbidity and the electric potential of the ORP electrode can age and drift after long-time use are solved by a specific titration algorithm and a specific judgment mode, the method has the defects that the automatic titration judgment method for the permanganate index on-line monitoring still adopts the traditional spectrophotometry, and has the problems that the light intensity is influenced to a certain extent by the water quality in each region, the color of the water body and the turbidity caused by various substances dissolved in the water body, and the measurement result of the spectrophotometry is inaccurate.
Disclosure of Invention
The invention provides a permanganate index titration method and a permanganate index titration system capable of improving titration critical value precision, improving titration timeliness and accuracy and realizing automatic detection, and aims to solve the problems of inaccurate measurement results, high electrode manufacturing cost, short service life and lower automation degree of a detection method adopted by an existing permanganate index online analyzer in the prior art.
In order to achieve the aim of the invention, the invention adopts the following technical scheme:
a permanganate index titration method comprising the steps of:
s1, collecting a potassium permanganate titration video, and carrying out framing treatment to obtain a framed RGB image;
s2, performing color space conversion on the RGB image after framing, and converting the RGB image into an HSV space;
s3, calculating an H component in the HSV space, generating a histogram, and calculating a similarity value of the histogram of the H channel;
s4, calculating an S component in the HSV space, generating a histogram, and simultaneously calculating the saturation of the histogram of the S channel;
s5, taking the video frame meeting the calculation results of the step S3 and the step S4 as a titration frame M for starting an experiment, and calculating the reaction rate of the subsequent frames;
s6, calculating the gradient of the color region of the multiple anchor frames;
and S7, performing color quantization interval calculation in the process of the step S6 on the video frame after the titration starts, and detecting a quantization interval jump frame after the color reaction is finished.
Preferably, in step S2, the calculation process of RGB to HSV space is as follows:
V=max(R,G,B) (3-1)
wherein R represents an R channel of RGB space, and G and B represent a space G channel and a space B channel respectively; HSV is a color space created from the visual properties of colors, H is hue, S is saturation, and V is brightness.
Preferably, the step S2 further includes the steps of:
s21, carrying out quantization processing on the HSV color space:
the calculation process of the quantization process is as follows: the H, S, V components are quantized at unequal intervals according to human color perception, and the hue H space is divided into 8 parts and the saturation S space and the brightness V space are divided into 3 parts according to human visual resolving power; the spatial segmentation process is as follows:
wherein h, s, v represent the hue component, saturation component, and luminance component before quantization, respectively; H. s, V the tone value, saturation value, and luminance value after division;
s22, constructing a one-dimensional feature vector, and synthesizing 3 color components into a one-dimensional feature vector L according to the quantization step in the step S21; the calculation process is as follows:
L=9H+3S+V(3-7)。
preferably, step S3 includes the steps of:
s31, if the similarity of the adjacent frames is larger than a set threshold value T, the color change is obvious, and the next step is continued; if the similarity is smaller than the threshold T, indicating that the titration experiment is not started, and if the titration frame is not detected, carrying out cyclic judgment on the subsequent frames until the calculated similarity is larger than the threshold T;
the similarity of the adjacent frames is calculated by using the Euclidean distance of the histogram, and the calculation process is as follows:
wherein D represents the similarity of neighboring frames; n represents the dimension of the histogramA number; m is m i And m is equal to i-1 The histograms of the i-th frame and the i-1 frame of the H component are respectively shown.
Preferably, step S4 includes the steps of:
s41, if the saturation difference value of the adjacent frames is larger than a set threshold value Q, continuing the next step; if the saturation difference value is smaller than the threshold value Q, continuing to perform saturation circulation calculation by using the subsequent frames until the calculated saturation difference value is larger than the threshold value Q; the calculation process of the saturation difference is as follows:
W=S i -S i-1 (3-9)
wherein W represents the difference in saturation of adjacent frames; s is S i And S is equal to i-1 The histograms of the i-th frame and the i-1 frame of the saturation S component are represented, respectively.
Preferably, in step S5, the reaction rate calculation formula is as follows:
wherein ,mi And m is equal to i-1 Histograms respectively representing the i-th frame and i-1 frame of H component, v i A single frame histogram loss is represented and used to refer to the rate of inter-frame reaction.
Preferably, step S6 includes the steps of:
s61, recording and calibrating a central area of the potassium permanganate falling into the cup through a plurality of titration experiments;
setting 4 anchor frames, wherein the aspect ratios are 1:1, 1.5:1, 1:1.5 and 3:1 respectively, and the anchor frames cover a potassium permanganate dropping area and a diffused color development area; different weights are distributed to each anchor frame and used for comprehensively judging quantization intervals of the color development diffusion areas; the evaluation formula is specifically as follows:
wherein W is the comprehensive quantization space to which the anchor frame belongs, H i Is the componentization space of various anchor frames, w i And the sum of the weight values is 1 for the weight values of the anchor frames.
Preferably, step S7 includes the steps of:
s71, performing color quantization interval calculation in the process of step S6 on the video frame after the titration starts, and detecting a jump frame of the quantization interval after the color reaction ends, wherein the specific discrimination process is as follows:
if(H j -H j-1 )>0,P=j (3-13)
wherein ,Hj For the comprehensive quantization space to which the j-th frame belongs, H j-1 P is a jump frame for ending the single titration reaction, which is the comprehensive quantization space to which the j-1 th frame belongs;
s72, calculating a frame difference gradient between a titration start frame M and a section jump frame P after the single titration reaction is finished, wherein the frame difference gradient is shown in the following formula:
Δt=P-M (3-14)
s73, calculating the average reaction speed of each titration, wherein the average reaction speed is shown as the following formula:
wherein ,for the average speed of each titration, Δt is the single reaction frame difference gradient; v i A single frame histogram loss is represented and used to refer to the rate of inter-frame reaction.
S74, setting a dropping speed for the titration pump at the beginning of titration and recording as V start Simultaneously, continuously recording the average reaction speed of each titration; the average speed of the first titration is recorded as the maximum value V of the average speed max And continuously updating the maximum value V in the subsequent frames max The dropping speed of the titration pump is changed by the average speed change of single reaction, and the dropping speed calculation formula is as follows:
wherein ,Vnow For the regulated dropping speed of the titration pump, V start For initial titration pump dripping speed, V i For the average reaction rate of the ith titration, V max The maximum value of the average reaction rate was titrated.
The invention also provides a permanganate index titration system, comprising:
the acquisition and framing module is used for acquiring the potassium permanganate titration video, framing the video and obtaining a framed RGB image;
the color space conversion module is used for carrying out color space conversion on the RGB image after framing, and converting the RGB image into an HSV space;
the H component calculation module is used for calculating H components in the HSV space, generating a histogram and calculating the similarity value of the histogram of the H channel;
the S component calculation module is used for calculating an S component in the HSV space, generating a histogram and simultaneously calculating the saturation of the histogram of the S channel;
the reaction rate calculation module takes the video frame meeting the calculation results of the H component calculation module and the S component calculation module as a titration frame M for the beginning of an experiment, and carries out reaction rate calculation on the subsequent frames;
the gradient calculation module is used for calculating the gradient of the color region of the multiple anchor frames;
and the detection judging module is used for calculating a color quantization interval of the video frame after the titration starts and detecting a quantization interval jump frame after the color reaction ends.
Compared with the prior art, the invention has the beneficial effects that: (1) The technical characteristics of gradient speed control of the color region of the multi-anchor frame improve the titration critical value precision of the permanganate index titration device; (2) The timeliness and accuracy of the permanganate index titration device are effectively improved through the technical characteristics of controlling the change of the dropping speed of the titration pump by the closed-loop color gamut gradient; (3) The potassium permanganate index titration device with the color gamut speed control algorithm replaces manual observation and judgment, realizes automatic detection, reduces the output of labor cost and improves the degree of automation.
Drawings
FIG. 1 is a hardware block diagram of a permanganate index titration system in accordance with the present invention;
FIG. 2 is a flow chart of a permanganate index titration method in accordance with the present invention;
FIG. 3 is a schematic representation of the multi-scale anchor frame color region calculation of the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention, specific embodiments of the present invention will be described below with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
Examples:
as shown in fig. 2, the present invention provides a permanganate index titration method comprising the steps of:
s1, a camera collects potassium permanganate titration video, framing is carried out at the speed of 30fps, an RGB image after framing is obtained, and the RGB image after framing is imported into embedded equipment for subsequent processing;
s2, performing color space conversion on the RGB image after framing, and converting the RGB image into an HSV space which can more intuitively express the darkness, the tone and the vividness of the color, so that the contrast between the colors is facilitated. The number of colors appearing in a picture is particularly large, so that the dimension of a histogram vector is high, and therefore the HSV color space is quantized;
specifically, the calculation process of converting RGB to HSV space is as follows:
V=max(R,G,B) (3-1)
wherein R represents an R channel of RGB space, and G and B represent a space G channel and a space B channel respectively; HSV is a color space created from the visual properties of colors, H is hue, S is saturation, and V is brightness.
The calculation process for the quantization processing of the HSV color space is as follows: the H, S, V components are quantized at unequal intervals according to human color perception, and the hue H space is divided into 8 parts and the saturation S space and the brightness V space are divided into 3 parts according to human visual resolving power; the spatial segmentation process is as follows:
wherein h, s, v represent the hue component, saturation component, and luminance component before quantization, respectively; H. s, V the tone value, saturation value, and luminance value after division;
s22, constructing a one-dimensional feature vector, and synthesizing 3 color components into a one-dimensional feature vector L according to the quantization step in the step S21; the calculation process is as follows:
L=9H+3S+V(3-7)。
s3, calculating an H component in the HSV space, generating a histogram, and calculating a similarity value of the histogram of the H channel;
if the similarity of the adjacent frames is larger than the set threshold value T, the color change is obvious, and the next step is continued; if the similarity is smaller than the threshold T, indicating that the titration experiment is not started, and if the titration frame is not detected, carrying out cyclic judgment on the subsequent frames until the calculated similarity is larger than the threshold T;
the similarity of the adjacent frames is calculated by using the Euclidean distance of the histogram, and the calculation process is as follows:
wherein D represents the similarity of neighboring frames; n represents the dimension of the histogram; m is m i And m is equal to i-1 The histograms of the i-th frame and the i-1 frame of the H component are respectively shown.
S4, calculating an S component in the HSV space, generating a histogram, and simultaneously calculating the saturation of the histogram of the S channel;
in different water quality detection processes, turbid water can cause false judgment of color quantization interval jump under the action of a magnetic stirrer, so that calculation of adjacent frame saturation is introduced, and secondary judgment of titration frames is realized;
s41, if the saturation difference value of the adjacent frames is larger than a set threshold value Q, continuing the next step; if the saturation difference value is smaller than the threshold value Q, continuing to perform saturation circulation calculation by using the subsequent frames until the calculated saturation difference value is larger than the threshold value Q; the calculation process of the saturation difference is as follows:
W=S i -S i-1 (3-9)
wherein W represents the difference in saturation of adjacent frames; s is S i And S is equal to i-1 The histograms of the i-th frame and the i-1 frame of the saturation S component are represented, respectively.
S5, taking the video frame meeting the calculation results of the step S3 and the step S4 as a titration frame M for starting an experiment, and calculating the reaction rate of the subsequent frames;
the reaction rate calculation formula is as follows:
wherein ,mi And m is equal to i-1 Respectively representing the histograms of the ith frame and the i-1 frame of the H component; v i A single frame histogram loss is represented and used to refer to the rate of inter-frame reaction.
S6, calculating the gradient of the color areas of the multiple anchor frames, and improving the judgment precision of the titration critical frames;
s61, recording and calibrating a central area of the potassium permanganate falling into the cup through a plurality of titration experiments, wherein the central area is shown as a black solid line frame in fig. 3;
setting 4 anchor frames, wherein the aspect ratios are 1:1, 1.5:1, 1:1.5 and 3:1 respectively, and the anchor frames cover a potassium permanganate dropping area and a diffused color development area; different weights are distributed to each anchor frame and used for comprehensively judging quantization intervals of the color development diffusion areas; the evaluation formula is specifically as follows:
wherein W is the comprehensive quantization space to which the anchor frame belongs, H i Is the componentization space of various anchor frames, w i And the sum of the weight values is 1 for the weight values of the anchor frames.
Compared with the traditional whole-graph color gamut space judgment, the comprehensive judgment method with the anchor frame is more accurate in attribution of the color development area, and can remarkably improve the judgment precision of the titration critical frame.
S7, calculating a color quantization interval in the process of the step S6 on the video frame after the titration starts, detecting a jump frame of the quantization interval after the color reaction ends, and specifically judging the jump frame as follows:
if(H j -H j-1 )>0,P=j (3-13)
wherein ,Hj For the comprehensive quantization space to which the j-th frame belongs, H j-1 P is a jump frame for ending the single titration reaction, which is the comprehensive quantization space to which the j-1 th frame belongs;
calculating the frame difference gradient between the titration start frame M and the interval jump frame P after the single titration reaction is finished, wherein the frame difference gradient is shown in the following formula:
Δt=P-M (3-14)
the average reaction rate per titration was calculated as shown in the following formula:
wherein ,for the average speed of each titration, Δt is the single reaction frame difference gradient; v i A single frame histogram loss is represented and used to refer to the rate of inter-frame reaction.
The titration pump is set with a relatively quick and reasonable dripping speed at the beginning of titration and is marked as V start Simultaneously, continuously recording the average reaction speed of each titration; the average speed of the first titration is recorded as the maximum value V of the average speed max And continuously updating the maximum value V in the subsequent frames max The dropping speed of the titration pump is changed by the average speed change of single reaction, and the dropping speed calculation formula is as follows:
wherein ,Vnow For the regulated dropping speed of the titration pump, V start For initial titration pump dripping speed, V i For the average reaction rate of the ith titration, V max The maximum value of the average reaction rate was titrated.
In addition, the invention also provides a permanganate index titration system, comprising:
the acquisition and framing module is used for acquiring the potassium permanganate titration video, framing the video and obtaining a framed RGB image;
the color space conversion module is used for carrying out color space conversion on the RGB image after framing, and converting the RGB image into an HSV space;
the H component calculation module is used for calculating H components in the HSV space, generating a histogram and calculating the similarity value of the histogram of the H channel;
the S component calculation module is used for calculating an S component in the HSV space, generating a histogram and simultaneously calculating the saturation of the histogram of the S channel;
the reaction rate calculation module takes the video frame meeting the calculation results of the H component calculation module and the S component calculation module as a titration frame M for the beginning of an experiment, and carries out reaction rate calculation on the subsequent frames;
the gradient calculation module is used for calculating the gradient of the color region of the multiple anchor frames;
and the detection judging module is used for calculating a color quantization interval of the video frame after the titration starts and detecting a quantization interval jump frame after the color reaction ends.
The specific system hardware structure is built as shown in fig. 1, the magnetic stirrer continuously works to accelerate the reaction, the titration pump pumps the potassium permanganate solution to perform titration at the initial speed of 5s intervals, the camera captures titration images, the controller judges titration frames, calculates the color quantization space of the subsequent frames, and adjusts the titration speed of the titration pump through the regional color space and gradient change.
As shown in fig. 3, the actual application flow of the dissolved oxygen prediction system based on data fluctuation decomposition and time sequence mining in the present invention is shown. Firstly, dissolved oxygen time sequence data in a certain period are collected through a sensor, then the data are divided into a period item, a fluctuation item and a trend item by using an STL decomposition method, and the irregular fluctuation item which is still unstable and strong is subjected to secondary decomposition by using EEMD, so that the input data tend to be stable, and noise existing in the data is reduced. And then predicting by using the GRU model, and correcting errors of a predicted result by SVR after the prediction, so that the prediction precision of the model is further improved. And finally, analyzing the obtained future prediction result, judging whether the current dissolved oxygen has potential risk factors, and taking relevant treatment measures on the current dissolved oxygen.
The technical characteristics of gradient speed control of the color region of the multi-anchor frame improve the titration critical value precision of the permanganate index titration device; the timeliness and accuracy of the permanganate index titration device are effectively improved through the technical characteristics of controlling the change of the dropping speed of the titration pump by the closed-loop color gamut gradient; the potassium permanganate index titration device with the color gamut speed control algorithm replaces manual observation and judgment, realizes automatic detection, reduces the output of labor cost and improves the degree of automation.
The foregoing is only illustrative of the preferred embodiments and principles of the present invention, and changes in specific embodiments will occur to those skilled in the art upon consideration of the teachings provided herein, and such changes are intended to be included within the scope of the invention as defined by the claims.
Claims (9)
1. A permanganate index titration method, comprising the steps of:
s1, collecting a potassium permanganate titration video, and carrying out framing treatment to obtain a framed RGB image;
s2, performing color space conversion on the RGB image after framing, and converting the RGB image into an HSV space;
s3, calculating an H component in the HSV space, generating a histogram, and calculating a similarity value of the histogram of the H channel;
s4, calculating an S component in the HSV space, generating a histogram, and simultaneously calculating the saturation of the histogram of the S channel;
s5, taking the video frame meeting the calculation results of the step S3 and the step S4 as a titration frame M for starting an experiment, and calculating the reaction rate of the subsequent frames;
s6, calculating the gradient of the color region of the multiple anchor frames;
and S7, performing color quantization interval calculation in the process of the step S6 on the video frame after the titration starts, and detecting a quantization interval jump frame after the color reaction is finished.
2. The permanganate index titration method according to claim 1, wherein in step S2, the calculation of RGB to HSV space is as follows:
V=max(R,G,B) (3-1)
wherein R represents an R channel of RGB space, and G and B represent a space G channel and a space B channel respectively; HSV is a color space created from the visual properties of colors, H is hue, S is saturation, and V is brightness.
3. The permanganate index titration method according to claim 2, characterized in that step S2 further comprises the steps of:
s21, carrying out quantization processing on the HSV color space:
the calculation process of the quantization process is as follows: the H, S, V components are quantized at unequal intervals according to human color perception, and the hue H space is divided into 8 parts and the saturation S space and the brightness V space are divided into 3 parts according to human visual resolving power; the spatial segmentation process is as follows:
wherein h, s, v represent the hue component, saturation component, and luminance component before quantization, respectively; H. s, V the tone value, saturation value, and luminance value after division;
s22, constructing a one-dimensional feature vector, and synthesizing 3 color components into a one-dimensional feature vector L according to the quantization step in the step S21; the calculation process is as follows:
L=9H+3S+V(3-7)。
4. the permanganate index titration method according to claim 1, wherein step S3 comprises the steps of:
s31, if the similarity of the adjacent frames is larger than a set threshold value T, the color change is obvious, and the next step is continued; if the similarity is smaller than the threshold T, indicating that the titration experiment is not started, and if the titration frame is not detected, carrying out cyclic judgment on the subsequent frames until the calculated similarity is larger than the threshold T;
the similarity of the adjacent frames is calculated by using the Euclidean distance of the histogram, and the calculation process is as follows:
wherein D represents the similarity of neighboring frames; n represents the dimension of the histogram; m is m i And m is equal to i-1 The histograms of the i-th frame and the i-1 frame of the H component are respectively shown.
5. The permanganate index titration method according to claim 1, wherein step S4 comprises the steps of:
s41, if the saturation difference value of the adjacent frames is larger than a set threshold value Q, continuing the next step; if the saturation difference value is smaller than the threshold value Q, continuing to perform saturation circulation calculation by using the subsequent frames until the calculated saturation difference value is larger than the threshold value Q; the calculation process of the saturation difference is as follows:
W=|S i -S i-1 | (3-9)
wherein W represents the difference in saturation of adjacent frames; s is S i And S is equal to i-1 The histograms of the i-th frame and the i-1 frame of the saturation S component are represented, respectively.
6. The permanganate index titration method according to claim 1, wherein in step S5, the reaction rate calculation formula is as follows:
wherein ,mi And m is equal to i-1 Respectively representing the histograms of the ith frame and the i-1 frame of the H component; v i A single frame histogram loss is represented and used to refer to the rate of inter-frame reaction.
7. The permanganate index titration method according to claim 1, wherein step S6 comprises the steps of:
s61, recording and calibrating a central area of the potassium permanganate falling into the cup through a plurality of titration experiments;
setting 4 anchor frames, wherein the aspect ratios are 1:1, 1.5:1, 1:1.5 and 3:1 respectively, and the anchor frames cover a potassium permanganate dropping area and a diffused color development area; different weights are distributed to each anchor frame and used for comprehensively judging quantization intervals of the color development diffusion areas; the evaluation formula is specifically as follows:
wherein W is the comprehensive quantization space to which the anchor frame belongs, H i Is the componentization space of various anchor frames, w i And the sum of the weight values is 1 for the weight values of the anchor frames.
8. The permanganate index titration method according to claim 1, wherein step S7 comprises the steps of:
s71, performing color quantization interval calculation in the process of step S6 on the video frame after the titration starts, and detecting a jump frame of the quantization interval after the color reaction ends, wherein the specific discrimination process is as follows:
if(H j -H j-1 )>0,P=j (3-13)
wherein ,Hj For the comprehensive quantization space to which the j-th frame belongs, H j-1 P is a jump frame for ending the single titration reaction, which is the comprehensive quantization space to which the j-1 th frame belongs;
s72, calculating a frame difference gradient between a titration start frame M and a section jump frame P after the single titration reaction is finished, wherein the frame difference gradient is shown in the following formula:
Δt=P-M (3-14)
s73, calculating the average reaction speed of each titration, wherein the average reaction speed is shown as the following formula:
wherein ,for the average speed of each titration, Δt is the single reaction frame difference gradient, v i Representing a single frame histogram loss for indicating an inter-frame reaction rate;
s74, setting a dropping speed for the titration pump at the beginning of titration and recording as V start Simultaneously, continuously recording the average reaction speed of each titration; the average speed of the first titration is recorded as the maximum value V of the average speed max And continuously updating the maximum value V in the subsequent frames max The dropping speed of the titration pump is changed by the average speed change of single reaction, and the dropping speed calculation formula is as follows:
wherein ,Vnow For the regulated dropping speed of the titration pump, V start For initial titration pump dripping speed, V i Average reaction rate for the ith titrationDegree of V max The maximum value of the average reaction rate was titrated.
9. A permanganate index titration system for implementing the permanganate index titration method according to any of claims 1-8, wherein the permanganate index titration system comprises:
the acquisition and framing module is used for acquiring the potassium permanganate titration video, framing the video and obtaining a framed RGB image;
the color space conversion module is used for carrying out color space conversion on the RGB image after framing, and converting the RGB image into an HSV space;
the H component calculation module is used for calculating H components in the HSV space, generating a histogram and calculating the similarity value of the histogram of the H channel;
the S component calculation module is used for calculating an S component in the HSV space, generating a histogram and simultaneously calculating the saturation of the histogram of the S channel;
the reaction rate calculation module takes the video frame meeting the calculation results of the H component calculation module and the S component calculation module as a titration frame M for the beginning of an experiment, and carries out reaction rate calculation on the subsequent frames;
the gradient calculation module is used for calculating the gradient of the color region of the multiple anchor frames;
and the detection judging module is used for calculating a color quantization interval of the video frame after the titration starts and detecting a quantization interval jump frame after the color reaction ends.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310656619.7A CN116952930A (en) | 2023-06-05 | 2023-06-05 | Permanganate index titration method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310656619.7A CN116952930A (en) | 2023-06-05 | 2023-06-05 | Permanganate index titration method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116952930A true CN116952930A (en) | 2023-10-27 |
Family
ID=88455474
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310656619.7A Pending CN116952930A (en) | 2023-06-05 | 2023-06-05 | Permanganate index titration method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116952930A (en) |
-
2023
- 2023-06-05 CN CN202310656619.7A patent/CN116952930A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200394494A1 (en) | Method And System For Predicting Content Of Multiple Components In Rare Earth Extraction Process | |
CN110161233B (en) | Rapid quantitative detection method for immunochromatography test paper card | |
CN110335294B (en) | Mine water pump house water leakage detection method based on frame difference method and 3D convolutional neural network | |
CN110782455B (en) | Novel method for determining mud content of raw sand based on image processing method | |
CN103344583B (en) | A kind of praseodymium-neodymium (Pr/Nd) component concentration detection system based on machine vision and method | |
CN110487737B (en) | Image information extraction and calculation method and system for spectrum detection of smart phone | |
CN109323999B (en) | Spectrophotometric detection method based on image numerical analysis | |
CN102088539B (en) | Method and system for evaluating pre-shot picture quality | |
TW202218995A (en) | Wastewater decolorization reaction automatic tracking operation method and system | |
CN113945556A (en) | Water quality fluoride detection method based on digital image colorimetric analysis | |
CN110749555B (en) | Hyperspectral technology-based device and method for detecting internal fermentation state of white spirit koji | |
CN116952930A (en) | Permanganate index titration method and system | |
CN109856133B (en) | Test paper detection method utilizing multiple illumination intensities and multiple color illumination | |
CN115578553B (en) | Formaldehyde rapid detection method based on time sequence image sequence | |
CN116793979A (en) | Method for detecting chemical oxygen demand in water sample | |
CN115598164A (en) | Machine learning integrated soil heavy metal concentration detection method and system | |
CN113916817B (en) | Spectrum method chromaticity online measurement method for urban living drinking water | |
Wi et al. | Analysis of vanadium species (V (IV)/V (III)) in the electrolyte manufacturing process for vanadium redox flow battery using digital image | |
KR20090097102A (en) | Optical microbe sensor and method for detecting microbe using the same | |
CN115615976A (en) | Water quality chemical oxygen demand detection method based on laser spectrum technology | |
CN115508276A (en) | Water quality detection method, detection device and detection system | |
CN114998326A (en) | Method and system for detecting distribution condition of gas flow based on artificial intelligence | |
CN113607726A (en) | Water quality monitoring system device and water quality monitoring method for heavy metal wastewater | |
Iacono et al. | pH strip reader for beer samples based on image analysis | |
Liping et al. | Prediction and Realization of DO in sewage Treatment based on Machine Vision and BP Neural Network |
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 |