Sewage discharge monitoring method and system based on image features
Patent Information
- Application Number
- CN202611113891.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-16
AI Technical Summary
[0005]本发明提供基于图像特征的污水排放监测方法及系统,通过边界缩进矢量场的多尺度流变分析、时序演化轨迹线的非线性动力学分析和污染判定二维特征坐标的分级决策,从形态、时序和判定三个维度全面克服了现有静态灰度阈值方法在干扰条件下识别准确率低、时序信息缺失和判定维度单一的技术缺陷,实现了高鲁棒性的油膜污染精准监测
[0069] The beneficial effects of this invention compared to the prior art are as follows: Existing wastewater discharge monitoring methods based on grayscale thresholds rely solely on the static grayscale features of a single frame image for oil film segmentation and pollution determination. Under interference conditions such as ripples, changes in illumination, and suspended matter, the accuracy of identification drops sharply. Furthermore, it cannot utilize the morphological evolution information of the oil film over time to distinguish between continuous discharge and occasional interference. At the same time, it lacks multi-dimensional comprehensive quantitative assessment and graded response capabilities, resulting in a high misjudgment rate in actual monitoring scenarios. This invention, by introducing boundary shrinkage vector field analysis technology, elevates the oil film morphology characteristics from traditional first-order geometric parameters such as area and perimeter to a multi-scale morphological rheological analysis dimension combining vector field differential operators (divergence, curl) and information entropy, significantly enhancing the anti-interference capability of oil film identification. By constructing a temporal evolution trajectory line and introducing curvature integral analysis and phase space reconstruction fractal dimension analysis, the temporal analysis is elevated from simple first-order difference comparison to a nonlinear dynamic analysis dimension, effectively distinguishing between continuous oil film discharge and occasional floating object interference. By constructing a two-dimensional feature coordinate system for pollution determination composed of pollution deviation degree and pollution urgency degree, the pollution determination is elevated from binary output to a multi-dimensional comprehensive quantitative assessment and graded response decision dimension. Thus, from the three core dimensions of morphological analysis, temporal analysis, and decision determination, this invention comprehensively solves the technical defects of low monitoring accuracy and poor robustness of existing technologies, significantly improving the accuracy and reliability of wastewater discharge monitoring under complex environmental conditions.
Smart Images

Figure CN122929495A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and environmental monitoring technology, and in particular to a wastewater discharge monitoring method and system based on image features. Background Technology
[0002] With the rapid development of industrialization and urbanization, wastewater discharge monitoring has become an important issue in the field of environmental protection. Image-based wastewater discharge monitoring methods, which acquire and analyze images of the water surface at discharge outlets to identify oil film areas and assess pollution risk, offer advantages such as non-contact operation, low cost, and continuous monitoring, and have become one of the mainstream technologies for wastewater discharge monitoring. Existing technologies, such as the authorized Chinese invention patent CN118115502B, acquire a set of wastewater surface images, identify suspected seed points based on pixel grayscale values, select seed points using the feature of larger grayscale values in oil film areas, segment the oil film areas using a watershed algorithm, and then determine whether wastewater discharge poses a pollution risk based on the characteristics of the oil film areas.
[0003] However, the aforementioned existing technical solutions have fundamental flaws: the core logic of these solutions is based on the single static assumption that "the gray value of the oil film area is large and stable," without considering the dynamic impact of water surface environmental interference factors on gray value characteristics. This results in the solution relying solely on gray value thresholds for static segmentation, leading to a sharp drop in oil film recognition accuracy under interference conditions such as ripples, changes in lighting, and suspended matter. Furthermore, the solution performs independent static analysis on each frame of the image, failing to utilize the morphological evolution information of the oil film over continuous time, and thus cannot distinguish between continuous oil film discharge and occasional floating object interference, resulting in a high false positive rate. In addition, its pollution determination is based solely on the binary output of whether the oil film area exceeds a threshold, lacking multi-dimensional comprehensive quantitative assessment and graded response capabilities, making it difficult to meet the accuracy and robustness requirements of actual monitoring scenarios.
[0004] Therefore, this invention proposes a wastewater discharge monitoring method and system based on image features. Summary of the Invention
[0005] This invention provides a wastewater discharge monitoring method and system based on image features. By using multi-scale rheological analysis of boundary indentation vector fields, nonlinear dynamic analysis of temporal evolution trajectory lines, and hierarchical decision-making of two-dimensional feature coordinates for pollution determination, it comprehensively overcomes the technical defects of existing static grayscale threshold methods, such as low recognition accuracy under interference conditions, lack of temporal information, and single determination dimension, from the three dimensions of morphology, temporality, and determination. This invention achieves highly robust and accurate monitoring of oil film pollution.
[0006] This invention provides a wastewater discharge monitoring method based on image features, comprising:
[0007] Acquire raw monitoring images of the sewage outlet monitoring area, classify the raw monitoring images into environmental scenes, and identify the environmental type corresponding to the raw monitoring images;
[0008] Based on the environment type, a target image enhancement strategy is matched, and the original monitoring image is enhanced by the target image enhancement strategy to obtain an enhanced monitoring image.
[0009] Extract multidimensional features of the interference environment from enhanced monitoring images and generate a baseline feature vector of the interference environment.
[0010] A dynamic screening threshold matrix is determined based on the baseline feature vector of the interference environment, and oil film candidate regions are extracted from the enhanced monitoring image according to the dynamic screening threshold matrix.
[0011] Extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters;
[0012] The candidate regions of oil film verified by oil film morphology are mapped to a two-dimensional feature space to obtain single-frame oil film feature points.
[0013] The oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained in single frames. The single frames of oil film feature points in multiple consecutive frames are connected in chronological order to obtain the temporal evolution trajectory line. The temporal consistency of the oil film candidate region is confirmed based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line.
[0014] Based on the oil film candidate regions confirmed through temporal consistency, pollution deviation and pollution urgency are generated. Two-dimensional feature coordinates for pollution determination are constructed based on pollution deviation and pollution urgency. The presence or absence of oil film pollution is determined based on the two-dimensional feature coordinates for pollution determination.
[0015] Furthermore, multidimensional features of the interference environment are extracted from the enhanced monitoring images to generate a baseline feature vector of the interference environment, including:
[0016] The peak frequency and frequency distribution bandwidth of water surface ripples in the enhanced monitoring image are extracted and used as the spectral feature values of water surface ripples.
[0017] Extract the gray-level gradient components of pixels in the horizontal and vertical directions in the enhanced monitoring image, synthesize the gradient magnitude of each pixel, and calculate the spatial distribution mean and standard deviation of the gradient magnitude as the gradient magnitude in the illumination direction.
[0018] The density and aggregation of pixels with gray values in the gray range of suspended matter in the enhanced monitoring image are extracted as the feature values of suspended matter density distribution.
[0019] The spectral characteristic values of water surface ripples, the gradient amplitude of illumination direction, and the characteristic values of suspended matter density distribution are combined to form the reference characteristic vector of the interference environment.
[0020] Furthermore, a dynamic screening threshold matrix is determined based on the baseline feature vector of the interference environment, including:
[0021] Adjust the upper and lower limits of grayscale filtering based on the gradient magnitude of the illumination direction in the baseline feature vector of the interference environment.
[0022] Adjust the upper and lower limits of the area screening based on the spectral feature values of water surface ripples in the baseline feature vector of the interference environment.
[0023] Adjust the upper limit and lower limit of the region roundness screening based on the suspended matter density distribution characteristic value in the interference environment baseline feature vector;
[0024] The adjusted grayscale filtering upper limit, grayscale filtering lower limit, area filtering upper limit, area filtering lower limit, area roundness filtering upper limit, and area roundness filtering lower limit are combined into a dynamic filtering threshold matrix.
[0025] Furthermore, oil film candidate regions are extracted from the enhanced monitoring image based on a dynamic screening threshold matrix, including:
[0026] In the grayscale image of the enhanced monitoring image, pixels with grayscale values between the upper and lower limits of grayscale screening are marked as oil film seed points.
[0027] Using the oil film seed point as the growth starting point, a region growth algorithm is used to expand the region and obtain the initial expansion region;
[0028] The initial expansion region whose area is between the upper and lower limits of the region area screening and whose roundness is between the upper and lower limits of the region roundness screening is marked as the oil film candidate region.
[0029] Further, the boundary indentation vector field of the oil film candidate region is extracted, and the morphological indentation feature parameters of the oil film candidate region are calculated based on the boundary indentation vector field, including:
[0030] Determine the geometric center of the oil film candidate region;
[0031] Starting from the geometric center, a boundary indentation vector field is generated by pointing to each pixel on the boundary of the oil film candidate region.
[0032] The divergence field is obtained by performing divergence calculation on the boundary shrinkage vector field. The divergence field characterizes the degree of convergence or divergence of the vector field at each point on the boundary of the oil film candidate region. The overall divergence intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all divergence values in the divergence field.
[0033] The curl field is obtained by performing curl calculation on the boundary shrinkage vector field. The curl field characterizes the degree of rotation of the vector field at each point on the boundary of the oil film candidate region. The overall curl intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all curl values in the curl field.
[0034] Multi-scale spatial sampling is performed on the magnitude of the boundary indentation vector field, and the information entropy of the magnitude distribution at each scale is statistically analyzed to obtain a multi-scale indentation entropy sequence. The mean of the multi-scale indentation entropy sequence is used as the comprehensive value of the multi-scale indentation entropy.
[0035] Calculate the standard deviation of the magnitude distribution of all vectors in the boundary indentation vector field, and use it as the magnitude distribution dispersion;
[0036] Calculate the directional distribution concentration of all vectors in the boundary indentation vector field. The directional distribution concentration is equal to the ratio of the absolute value of the cosine difference between the direction angles of all vectors and the principal direction angle to the total number of vectors.
[0037] The overall divergence intensity, overall curl intensity, multi-scale indentation entropy combined value, modulus distribution dispersion, and directional distribution concentration are combined into morphological indentation characteristic parameters.
[0038] Furthermore, the oil film morphology of candidate regions is verified based on morphological indentation characteristic parameters, including:
[0039] When the overall divergence intensity is less than the preset divergence intensity threshold, the overall curl intensity is less than the preset curl intensity threshold, the comprehensive value of the multi-scale indentation entropy is less than the preset indentation entropy threshold, the modulus distribution dispersion is less than the preset dispersion threshold, and the direction distribution concentration is less than the preset concentration threshold, the oil film candidate region is determined to pass the oil film morphology verification.
[0040] Furthermore, the candidate oil film regions verified through oil film morphology are mapped to a two-dimensional feature space to obtain single-frame oil film feature points, including:
[0041] The ratio of the area of the oil film candidate region to the total area of the monitoring region is obtained as the area contribution coordinate;
[0042] The morphological complexity coordinates are calculated based on the boundary complexity and morphological indentation characteristic parameters of the oil film candidate region. The morphological complexity coordinates are positively correlated with the boundary complexity and also positively correlated with the dispersion of the modulus distribution.
[0043] By using the area contribution coordinates as the abscissa values of the two-dimensional feature space and the morphological complexity coordinates as the ordinate values of the two-dimensional feature space, the oil film feature points of a single frame are obtained.
[0044] Furthermore, single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained. These single-frame oil film feature points are then connected in chronological order to obtain a temporal evolution trajectory line. Based on the trajectory geometry and temporal evolution features of the temporal evolution trajectory line, the temporal consistency of the oil film candidate region is confirmed, including:
[0045] The oil film feature points corresponding to each of the multiple consecutive enhanced monitoring images are obtained, and the oil film feature points of each single frame are connected in sequence according to the acquisition time to obtain the temporal evolution trajectory line.
[0046] Calculate the local curvature of the temporal evolution trajectory at each frame sampling point to obtain a curvature sequence, and perform time integration on each curvature value in the curvature sequence to obtain the cumulative curvature integral value of the trajectory;
[0047] The overall slope of the time-series evolution trajectory is calculated, and the overall slope represents the synchronous change trend of the oil film area contribution coordinate and the morphological complexity coordinate.
[0048] Calculate the area enclosed between the time-series evolution trajectory and the standard diffusion trajectory, and use it as the trajectory deviation area;
[0049] Based on the area contribution coordinates of each single-frame oil film feature point in the time-series evolution trajectory, the one-dimensional area time-series signal of the area contribution coordinates in the time dimension is extracted. The phase space reconstruction method is used to embed the one-dimensional area time-series signal into the two-dimensional or three-dimensional phase space to obtain the phase space reconstruction attractor. The fractal dimension of the phase space reconstruction attractor is calculated.
[0050] When the cumulative curvature integral value of the trajectory is less than the preset curvature integral threshold, the overall slope is greater than the preset slope threshold, the trajectory deviation area is less than the preset deviation area threshold, and the fractal dimension is less than the preset fractal dimension threshold, the oil film candidate region is determined to be confirmed through temporal consistency.
[0051] The oil film candidate regions confirmed through time-series consistency will be used to generate pollution deviation and pollution urgency.
[0052] Furthermore, based on the oil film candidate regions confirmed through temporal consistency, a contamination deviation degree and a contamination urgency degree are generated. A two-dimensional feature coordinate system for contamination determination is constructed based on the contamination deviation degree and the contamination urgency degree. The existence of oil film contamination is then determined based on this two-dimensional feature coordinate system, including:
[0053] The comprehensive pollution index is calculated based on the area contribution coordinates and morphological complexity coordinates of the oil film candidate regions confirmed through temporal consistency.
[0054] Acquire multi-frame enhanced monitoring images of historical pollution-free periods, calculate the baseline value based on the comprehensive pollution index of the multi-frame enhanced monitoring images of historical pollution-free periods, and update the baseline value based on the latest historical pollution-free period data every preset update cycle to obtain the adaptive drift baseline index.
[0055] The normalized distance between the comprehensive pollution index and the adaptive drift baseline index is used as the pollution deviation.
[0056] Calculate the rate of change of the comprehensive pollution index, calculate the ratio of the comprehensive pollution index to the preset historical maximum pollution index, multiply the rate of change and the ratio, and use the product as the pollution urgency level.
[0057] By using the degree of pollution deviation as the abscissa value of the two-dimensional feature coordinates and the degree of pollution urgency as the ordinate value of the two-dimensional feature coordinates, the two-dimensional feature coordinates for pollution determination are obtained.
[0058] In a two-dimensional plane divided by pollution deviation and pollution urgency, an asymmetric quadrant decision domain is preset, and the trigger threshold of the high deviation-high urgency quadrant is lower than that of the low deviation-low urgency quadrant.
[0059] Real-time location of the current landing point of the two-dimensional feature coordinates of pollution determination in the two-dimensional plane, and calculation of the dwell time integral value of the current landing point in each asymmetric quadrant decision domain;
[0060] When the residence time integral value of any asymmetric quadrant decision domain exceeds the preset residence time threshold corresponding to the asymmetric quadrant decision domain, oil film contamination is determined to exist, and the contamination response strategy corresponding to the asymmetric quadrant decision domain is output.
[0061] Obtain the actual pollution confirmation results and response time evaluation results after each output pollution response strategy, and perform feedback iterative adjustments to the trigger threshold and residence time threshold of each asymmetric quadrant decision domain based on the actual pollution confirmation results and response time evaluation results.
[0062] This invention provides a wastewater discharge monitoring system based on image features, comprising:
[0063] The image acquisition and enhancement module is used to acquire the original monitoring images of the sewage outlet monitoring area, classify the environmental scene of the original monitoring images, identify the environmental type corresponding to the original monitoring images, match the target image enhancement strategy according to the environmental type, and perform image enhancement processing on the original monitoring images using the target image enhancement strategy to obtain the enhanced monitoring images.
[0064] The interference benchmark extraction module is used to extract multi-dimensional features of the interference environment in the enhanced monitoring image and generate a benchmark feature vector of the interference environment.
[0065] The candidate region extraction module is used to determine a dynamic screening threshold matrix based on the baseline feature vector of the interference environment, and extract oil film candidate regions in the enhanced monitoring image according to the dynamic screening threshold matrix.
[0066] The morphological verification module is used to extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters.
[0067] The temporal confirmation module is used to map the oil film candidate regions verified by oil film morphology to a two-dimensional feature space, obtain single-frame oil film feature points, obtain single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images, connect the single-frame oil film feature points of multiple consecutive frames in chronological order to obtain a temporal evolution trajectory line, confirm the temporal consistency of the oil film candidate regions based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line, and use the oil film candidate regions that have passed the temporal consistency confirmation to generate pollution deviation degree and pollution urgency degree;
[0068] The contamination determination module is used to generate contamination deviation and contamination urgency based on the oil film candidate regions confirmed through time-series consistency, construct two-dimensional feature coordinates for contamination determination based on contamination deviation and contamination urgency, and determine whether oil film contamination exists based on the two-dimensional feature coordinates for contamination determination.
[0069] The beneficial effects of this invention compared to the prior art are as follows: Existing wastewater discharge monitoring methods based on grayscale thresholds rely solely on the static grayscale features of a single frame image for oil film segmentation and pollution determination. Under interference conditions such as ripples, changes in illumination, and suspended matter, the accuracy of identification drops sharply. Furthermore, it cannot utilize the morphological evolution information of the oil film over time to distinguish between continuous discharge and occasional interference. At the same time, it lacks multi-dimensional comprehensive quantitative assessment and graded response capabilities, resulting in a high misjudgment rate in actual monitoring scenarios. This invention, by introducing boundary shrinkage vector field analysis technology, elevates the oil film morphology characteristics from traditional first-order geometric parameters such as area and perimeter to a multi-scale morphological rheological analysis dimension combining vector field differential operators (divergence, curl) and information entropy, significantly enhancing the anti-interference capability of oil film identification. By constructing a temporal evolution trajectory line and introducing curvature integral analysis and phase space reconstruction fractal dimension analysis, the temporal analysis is elevated from simple first-order difference comparison to a nonlinear dynamic analysis dimension, effectively distinguishing between continuous oil film discharge and occasional floating object interference. By constructing a two-dimensional feature coordinate system for pollution determination composed of pollution deviation degree and pollution urgency degree, the pollution determination is elevated from binary output to a multi-dimensional comprehensive quantitative assessment and graded response decision dimension. Thus, from the three core dimensions of morphological analysis, temporal analysis, and decision determination, this invention comprehensively solves the technical defects of low monitoring accuracy and poor robustness of existing technologies, significantly improving the accuracy and reliability of wastewater discharge monitoring under complex environmental conditions.
[0070] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in this application.
[0071] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0072] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0073] Figure 1 This is a schematic diagram of the overall process of the wastewater discharge monitoring method based on image features according to the present invention.
[0074] Figure 2 This is a flowchart illustrating the boundary shrinkage vector field morphology verification steps in this invention.
[0075] Figure 3 This is a flowchart illustrating the steps of constructing the temporal evolution trajectory and verifying temporal consistency in this invention. Detailed Implementation
[0076] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0077] like Figure 1 As shown, the present invention provides a wastewater discharge monitoring method based on image features, comprising:
[0078] Acquire raw monitoring images of the sewage outlet monitoring area, classify the raw monitoring images into environmental scenes, and identify the environmental type corresponding to the raw monitoring images;
[0079] Based on the environment type, a target image enhancement strategy is matched, and the original monitoring image is enhanced by the target image enhancement strategy to obtain an enhanced monitoring image.
[0080] Extract multidimensional features of the interference environment from enhanced monitoring images and generate a baseline feature vector of the interference environment.
[0081] A dynamic screening threshold matrix is determined based on the baseline feature vector of the interference environment, and oil film candidate regions are extracted from the enhanced monitoring image according to the dynamic screening threshold matrix.
[0082] Extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters;
[0083] The candidate regions of oil film verified by oil film morphology are mapped to a two-dimensional feature space to obtain single-frame oil film feature points.
[0084] The oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained in single frames. The single frames of oil film feature points in multiple consecutive frames are connected in chronological order to obtain the temporal evolution trajectory line. The temporal consistency of the oil film candidate region is confirmed based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line.
[0085] Based on the oil film candidate regions confirmed through temporal consistency, pollution deviation and pollution urgency are generated. Two-dimensional feature coordinates for pollution determination are constructed based on pollution deviation and pollution urgency. The presence or absence of oil film pollution is determined based on the two-dimensional feature coordinates for pollution determination.
[0086] In this embodiment, the sewage outlet monitoring area refers to the water surface area corresponding to the sewage outlet to be monitored. This area is preset by the system and remains fixed during the monitoring process.
[0087] In this embodiment, the original monitoring image refers to the initial image obtained directly by the image acquisition device set up in the sewage outlet monitoring area without any processing.
[0088] In this embodiment, environmental scene classification is performed on the original monitoring image. Identifying the environment type corresponding to the original monitoring image involves inputting the original monitoring image into a pre-trained scene classification network. The scene classification network outputs probability values for each environment type, and the environment type with the highest probability value is taken as the environment type corresponding to the original monitoring image. Environment types include foggy, rainy, nighttime, backlighting, and normal. The scene classification network uses a convolutional neural network; the network's input is the pixel matrix of the original monitoring image, and its output is the probability distribution of the original monitoring image belonging to each environment type.
[0089] In this embodiment, matching the target image enhancement strategy according to the environment type means that the system has pre-established a correspondence between each environment type and a variety of image enhancement strategies. Based on the identified environment type, the system searches for and selects the image enhancement strategy that matches the environment type as the target image enhancement strategy.
[0090] In this embodiment, a target image enhancement strategy is used to enhance the original monitoring image. The resulting enhanced monitoring image is obtained by processing the original monitoring image according to the image processing operations corresponding to the target image enhancement strategy. When the target image enhancement strategy is a fog enhancement strategy, a dark channel prior dehazing algorithm is used to dehaze the original monitoring image; when the target image enhancement strategy is a rain enhancement strategy, a guided filtering-based rain line removal algorithm is used to remove rain from the original monitoring image; when the target image enhancement strategy is a night enhancement strategy, a Retinex-based low-light enhancement algorithm is used to increase the brightness and stretch the contrast of the original monitoring image; when the target image enhancement strategy is a backlight enhancement strategy, an adaptive gamma correction algorithm is used to adjust the grayscale distribution of the original monitoring image. The image processed in the above way is used as the enhanced monitoring image.
[0091] In this embodiment, extracting multidimensional features of the interference environment from the enhanced monitoring image and generating a baseline feature vector for the interference environment involves extracting the spectral feature values of water surface ripples, the gradient amplitude of the illumination direction, and the density distribution feature values of suspended matter from the enhanced monitoring image. These three feature values are then combined into a three-dimensional feature vector, which is the baseline feature vector for the interference environment. The spectral feature values of water surface ripples are obtained by performing a frequency domain transformation on the pixel values of the water surface region in the enhanced monitoring image to obtain frequency domain data, and then extracting the peak frequency and frequency distribution bandwidth. The gradient amplitude of the illumination direction is obtained by synthesizing the gray-level gradient components of each pixel in the horizontal and vertical directions in the enhanced monitoring image, and then statistically analyzing the spatial distribution mean and standard deviation of the gradient amplitude. The density distribution feature values of suspended matter are obtained by statistically analyzing the density and aggregation of pixels in the enhanced monitoring image whose gray-level values are located within the gray-level range of suspended matter.
[0092] In this embodiment, determining the dynamic screening threshold matrix based on the interference environment reference feature vector involves using the illumination direction gradient amplitude, water surface ripple spectrum feature value, and suspended matter density distribution feature value from the interference environment reference feature vector as adjustment criteria to dynamically adjust the preset grayscale screening upper limit, grayscale screening lower limit, region area screening upper limit, region area screening lower limit, region roundness screening upper limit, and region roundness screening lower limit. Specifically, the illumination direction gradient amplitude is used to adjust the grayscale screening upper and lower limits, the water surface ripple spectrum feature value is used to adjust the region area screening upper and lower limits, and the suspended matter density distribution feature value is used to adjust the region roundness screening upper and lower limits. The adjusted grayscale screening upper and lower limits, region area screening upper and lower limits, region roundness screening upper and lower limits are combined into a six-dimensional matrix, which is the dynamic screening threshold matrix.
[0093] In this embodiment, extracting oil film candidate regions from the enhanced monitoring image based on the dynamic screening threshold matrix involves marking pixels with grayscale values between the upper and lower grayscale screening limits as oil film seed points in the grayscale image of the enhanced monitoring image. Using these seed points as the starting point, a region growing algorithm is employed to expand the region, obtaining an initial expanded region. The initial expanded region, with an area between the upper and lower area screening limits and a roundness between the upper and lower roundness screening limits, is then marked as an oil film candidate region. The input to the region growing algorithm is the oil film seed points and the grayscale image of the enhanced monitoring image, and the output is the connected region formed after expansion.
[0094] In this embodiment, extracting the boundary indentation vector field of the oil film candidate region means determining the geometric center of the oil film candidate region, pointing to each pixel on the boundary of the oil film candidate region from the geometric center, and combining each vector pointing from the geometric center to the boundary pixel into a boundary indentation vector field.
[0095] In this embodiment, calculating the morphological shrinkage characteristic parameters of the oil film candidate region based on the boundary shrinkage vector field involves performing divergence operations on the boundary shrinkage vector field to obtain a divergence field, summing the absolute values of all divergence values in the divergence field to obtain the overall divergence intensity; performing curl operations on the boundary shrinkage vector field to obtain a curl field, summing the absolute values of all curl values in the curl field to obtain the overall curl intensity; performing multi-scale spatial sampling on the modulus of the boundary shrinkage vector field, statistically analyzing the information entropy of the modulus distribution at each scale to obtain a multi-scale shrinkage entropy sequence, and using the mean of the multi-scale shrinkage entropy sequence as the comprehensive value of the multi-scale shrinkage entropy; calculating the standard deviation of the modulus distribution of all vectors in the boundary shrinkage vector field as the modulus distribution dispersion; and calculating the directional distribution concentration of all vectors in the boundary shrinkage vector field, where the directional distribution concentration is equal to the ratio of the absolute values of the cosine differences between the direction angles of all vectors and the principal direction angle to the total number of vectors. The overall divergence intensity, overall curl intensity, multi-scale indentation entropy combined value, modulus distribution dispersion, and directional distribution concentration are combined into morphological indentation characteristic parameters.
[0096] In this embodiment, verifying the oil film morphology of candidate regions based on morphological indentation feature parameters involves comparing the overall divergence intensity with a preset divergence intensity threshold, the overall curl intensity with a preset curl intensity threshold, the multi-scale indentation entropy composite value with a preset indentation entropy threshold, the modulus length distribution dispersion with a preset dispersion threshold, and the directional distribution concentration with a preset concentration threshold. When the overall divergence intensity is less than the preset divergence intensity threshold, the overall curl intensity is less than the preset curl intensity threshold, the multi-scale indentation entropy composite value is less than the preset indentation entropy threshold, the modulus length distribution dispersion is less than the preset dispersion threshold, and the directional distribution concentration is less than the preset concentration threshold, the candidate oil film region is determined to have passed the oil film morphology verification.
[0097] In this embodiment, the oil film candidate regions verified by oil film morphology are mapped to a two-dimensional feature space. Obtaining single-frame oil film feature points involves using the ratio of the area of the oil film candidate region to the total area of the monitored region as the area contribution coordinate. The morphological complexity coordinate is calculated based on the boundary complexity and morphological indentation feature parameters of the oil film candidate region. The morphological complexity coordinate is positively correlated with the boundary complexity and the dispersion of the modulus distribution. The area contribution coordinate is used as the abscissa value of the two-dimensional feature space, and the morphological complexity coordinate is used as the ordinate value of the two-dimensional feature space to obtain single-frame oil film feature points.
[0098] In this embodiment, the single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained. The single-frame oil film feature points of multiple consecutive frames are connected in chronological order to obtain the temporal evolution trajectory line. This is done by connecting the single-frame oil film feature points corresponding to each frame of enhanced monitoring image in a two-dimensional feature space according to the acquisition time order, forming a continuous curve that extends with time. This curve is the temporal evolution trajectory line.
[0099] In this embodiment, the trajectory geometric features of the time-series evolution trajectory are geometric quantification indicators that can be extracted from the time-series evolution trajectory to describe the trajectory shape and change trend, including the trajectory cumulative curvature integral value, the overall slope, and the trajectory deviation area. The trajectory cumulative curvature integral value is obtained by integrating the local curvature of the time-series evolution trajectory at each frame sampling point over time; the overall slope is obtained by linearly fitting the coordinates of each point on the time-series evolution trajectory, characterizing the synchronous change trend of the oil film area contribution coordinate and the morphological complexity coordinate; the trajectory deviation area is obtained by calculating the enclosing area between the time-series evolution trajectory and the standard diffusion trajectory.
[0100] The aforementioned trajectory geometric features are Euclidean geometric properties extracted directly from the temporal evolution trajectory lines. In addition, the temporal evolution features also include the phase space reconstructed fractal dimension extracted based on the area temporal signal, which is used together with the trajectory geometric features to confirm temporal consistency.
[0101] In this embodiment, confirming the temporal consistency of oil film candidate regions based on the trajectory geometry and temporal evolution characteristics of the temporal evolution trajectory line involves comparing the cumulative curvature integral value of the trajectory with a preset curvature integral threshold, the overall slope with a preset slope threshold, the trajectory deviation area with a preset deviation area threshold, and the fractal dimension with a preset fractal dimension threshold. The fractal dimension is calculated as follows: based on the area contribution coordinates of each single-frame oil film feature point in the temporal evolution trajectory line, a one-dimensional area temporal signal of the area contribution coordinates in the time dimension is extracted. A phase space reconstruction method is used to embed the one-dimensional area temporal signal into a three-dimensional phase space to obtain a phase space reconstruction attractor, and the fractal dimension of the phase space reconstruction attractor is calculated. When the cumulative curvature integral value of the trajectory is less than a preset curvature integral threshold, the overall slope is greater than a preset slope threshold, the trajectory deviation area is less than a preset deviation area threshold, and the fractal dimension is less than a preset fractal dimension threshold, the oil film candidate region is determined to have passed the temporal consistency confirmation.
[0102] In this embodiment, the pollution deviation and pollution urgency are generated based on the oil film candidate regions confirmed through temporal consistency. This involves calculating the comprehensive pollution index based on the area contribution coordinates and morphological complexity coordinates of the oil film candidate regions confirmed through temporal consistency, acquiring multi-frame enhanced monitoring images from historical pollution-free periods, calculating the baseline value based on the comprehensive pollution index of the multi-frame enhanced monitoring images from historical pollution-free periods, updating the baseline value every preset update cycle based on the latest historical pollution-free period data to obtain an adaptive drift baseline index, and using the normalized distance between the comprehensive pollution index and the adaptive drift baseline index as the pollution deviation. The rate of change of the comprehensive pollution index is calculated, and the product of the rate of change and the ratio of the comprehensive pollution index to the preset historical maximum pollution index is used as the pollution urgency.
[0103] In this embodiment, constructing a two-dimensional feature coordinate system for pollution determination based on pollution deviation and pollution urgency involves using pollution deviation as the abscissa and pollution urgency as the ordinate. An asymmetric quadrant decision domain is preset within the two-dimensional plane defined by pollution deviation and pollution urgency. The trigger threshold for the high deviation-high urgency quadrant is lower than that for the low deviation-low urgency quadrant. The current location of the two-dimensional feature coordinate system in the two-dimensional plane is determined in real-time, and the integral value of the residence time of the current location in each asymmetric quadrant decision domain is calculated. When the integral value of the residence time in any asymmetric quadrant decision domain exceeds the preset residence time threshold corresponding to that asymmetric quadrant, the pollution response strategy corresponding to that asymmetric quadrant decision domain is output. The actual pollution confirmation result and response timeliness evaluation result are obtained after each output of the pollution response strategy. Based on the actual pollution confirmation result and response timeliness evaluation result, the trigger threshold and residence time threshold of each asymmetric quadrant decision domain are iteratively adjusted.
[0104] In this embodiment, determining whether oil film contamination exists based on the two-dimensional feature coordinates of the contamination determination is to determine whether the decision domain of the two-dimensional feature coordinates of the contamination determination in the two-dimensional plane and the corresponding residence time integral value exceed the preset residence time threshold. If they exceed the threshold, oil film contamination is determined to exist; if they do not exceed the threshold, oil film contamination is determined not to exist.
[0105] In another embodiment of the present invention, multidimensional features of the interference environment are extracted from the enhanced monitoring image to generate a baseline feature vector of the interference environment, including:
[0106] The peak frequency and frequency distribution bandwidth of water surface ripples in the enhanced monitoring image are extracted and used as the spectral feature values of water surface ripples.
[0107] Extract the gray-level gradient components of pixels in the horizontal and vertical directions in the enhanced monitoring image, synthesize the gradient magnitude of each pixel, and calculate the spatial distribution mean and standard deviation of the gradient magnitude as the gradient magnitude in the illumination direction.
[0108] The density and aggregation of pixels with gray values in the gray range of suspended matter in the enhanced monitoring image are extracted as the feature values of suspended matter density distribution.
[0109] The spectral characteristic values of water surface ripples, the gradient amplitude of illumination direction, and the characteristic values of suspended matter density distribution are combined to form the reference characteristic vector of the interference environment.
[0110] In this embodiment, the peak frequency and frequency distribution bandwidth of the water surface ripples in the frequency domain space are obtained by performing a Fourier transform on the pixel value matrix corresponding to the water surface area in the enhanced monitoring image to obtain frequency domain data. The frequency component with the largest amplitude in the frequency domain data is taken as the peak frequency, and the width of the frequency interval corresponding to the amplitude dropping to half of the peak amplitude on both sides of the peak frequency is taken as the frequency distribution bandwidth.
[0111] In this embodiment, extracting the peak frequency and frequency distribution bandwidth of water surface ripples in the frequency domain space as the spectral feature value of water surface ripples involves extracting the pixel value matrix corresponding to the water surface area from the enhanced monitoring image, performing a two-dimensional Fourier transform on the pixel value matrix to obtain frequency domain data, finding the frequency component with the largest amplitude in the frequency domain data as the peak frequency, and finding the two boundary frequencies corresponding to the amplitude dropping to half of the peak amplitude along the frequency axis with the peak frequency as the center. The difference between the two boundary frequencies is taken as the frequency distribution bandwidth, and the peak frequency and frequency distribution bandwidth are taken as the spectral feature value of water surface ripples.
[0112] In this embodiment, the gray-level gradient components of pixels in the enhanced monitoring image in the horizontal and vertical directions are extracted. The gradient magnitude of each pixel is synthesized by using the Sobel operator to calculate the gray-level gradient components in the horizontal and vertical directions of each pixel in the enhanced monitoring image, and then taking the square root of the sum of the squares of the gray-level gradient components in the horizontal and vertical directions to obtain the gradient magnitude of each pixel.
[0113] In this embodiment, the spatial distribution mean and standard deviation of the gradient amplitude are used as the illumination direction gradient amplitude. This involves calculating the arithmetic mean of the gradient amplitude of all pixels in the enhanced monitoring image as the spatial distribution mean of the gradient amplitude, and taking the square root of the average of the squares of the differences between the gradient amplitude of all pixels and the above arithmetic mean as the spatial distribution standard deviation of the gradient amplitude. The spatial distribution mean and spatial distribution standard deviation of the gradient amplitude are then combined to form the illumination direction gradient amplitude.
[0114] In this embodiment, the grayscale range of suspended matter is a numerical range consisting of a lower limit and an upper limit of grayscale values, which are determined in advance by statistically analyzing the distribution range of grayscale values of corresponding pixels of suspended matter in a large number of water surface images containing suspended matter. The lower limit and upper limit of grayscale values are set during system initialization and remain fixed in subsequent use.
[0115] In this embodiment, the pixel density and clustering degree of pixels whose gray values are located in the gray range of suspended matter in the enhanced monitoring image are extracted as suspended matter density distribution feature values. The pixel density is calculated as the ratio of the number of pixels in the enhanced monitoring image whose gray values are greater than or equal to the lower limit of the gray value of the suspended matter gray range and less than or equal to the upper limit of the gray value of the suspended matter gray range to the total number of pixels in the enhanced monitoring image. The clustering degree is calculated as the ratio of the number of connected regions formed by adjacent pixels among all pixels whose gray values are located in the gray range of suspended matter in the enhanced monitoring image to the total number of pixels. The pixel density and clustering degree are used as suspended matter density distribution feature values.
[0116] In this embodiment, combining the spectral feature values of water surface ripples, the gradient amplitude of the illumination direction, and the density distribution feature values of suspended matter into a reference feature vector for the interference environment involves arranging the peak frequency and frequency distribution bandwidth of the spectral feature values of water surface ripples, the mean and standard deviation of the spatial distribution of the gradient amplitude of the illumination direction, and the pixel density and aggregation degree of the density distribution feature values of suspended matter in a fixed order to form a seven-dimensional feature vector, which is the reference feature vector for the interference environment.
[0117] In another embodiment of the present invention, determining the dynamic screening threshold matrix based on the interference environment baseline feature vector includes:
[0118] Adjust the upper and lower limits of grayscale filtering based on the gradient magnitude of the illumination direction in the baseline feature vector of the interference environment.
[0119] Adjust the upper and lower limits of the area screening based on the spectral feature values of water surface ripples in the baseline feature vector of the interference environment.
[0120] Adjust the upper limit and lower limit of the region roundness screening based on the suspended matter density distribution characteristic value in the interference environment baseline feature vector;
[0121] The adjusted grayscale filtering upper limit, grayscale filtering lower limit, area filtering upper limit, area filtering lower limit, area roundness filtering upper limit, and area roundness filtering lower limit are combined into a dynamic filtering threshold matrix.
[0122] In this embodiment, adjusting the upper and lower limits of grayscale filtering based on the illumination direction gradient amplitude in the interference environment baseline feature vector means that a larger spatial distribution standard deviation in the illumination direction gradient amplitude indicates a more uneven overall illumination distribution in the enhanced monitoring image, requiring an increase in the upper limit and a decrease in the lower limit to expand the grayscale filtering range; conversely, a smaller spatial distribution standard deviation in the illumination direction gradient amplitude indicates a more uniform overall illumination distribution in the enhanced monitoring image, requiring a decrease in the upper limit and an increase in the lower limit to narrow the grayscale filtering range. The adjustment amount of the upper limit of grayscale filtering is equal to the product of the spatial distribution standard deviation and a first preset coefficient, and the adjustment amount of the lower limit of grayscale filtering is equal to the product of the spatial distribution standard deviation and a second preset coefficient. The first and second preset coefficients are set during system initialization.
[0123] In this embodiment, adjusting the upper and lower limits of the region area screening based on the water surface ripple spectrum feature values in the interference environment baseline feature vector means that the lower the peak frequency and the narrower the frequency distribution bandwidth in the water surface ripple spectrum feature values, the larger the scale of the water surface ripples in the enhanced monitoring image. The oil film area is easily fragmented into smaller fragmented areas under ripple interference, requiring a lower limit to retain smaller oil film fragmented areas. Conversely, the higher the peak frequency and the wider the frequency distribution bandwidth in the water surface ripple spectrum feature values, the smaller the scale of the water surface ripples in the enhanced monitoring image. The oil film area is less affected by ripples, requiring a higher lower limit to exclude smaller interference areas. The adjustment amount of the upper limit of the region area screening is equal to the product of the peak frequency and the third preset coefficient plus the product of the frequency distribution bandwidth and the fourth preset coefficient. The adjustment amount of the lower limit of the region area screening is equal to the product of the peak frequency and the fifth preset coefficient plus the product of the frequency distribution bandwidth and the sixth preset coefficient. The third, fourth, fifth, and sixth preset coefficients are set during system initialization.
[0124] In this embodiment, adjusting the upper and lower limits of the region roundness screening based on the suspended matter density distribution feature value in the interference environment baseline feature vector means that the higher the pixel density and aggregation of the suspended matter density distribution feature value, the more suspended matter there is in the enhanced monitoring image and the more concentrated its distribution. The suspended matter appears as irregular clumps in the image with a large roundness value. Oil film areas usually appear as relatively regular circles or ellipses with a small roundness value. It is necessary to lower the upper limit of the region roundness screening to eliminate the interference of irregular suspended matter clumps and raise the lower limit of the region roundness screening to tighten the screening range and ensure that only oil film areas with regular shapes are retained. The lower the pixel density and aggregation of the suspended matter density distribution feature value, the fewer the suspended matter there is in the enhanced monitoring image and the more dispersed its distribution. The proportion of irregular interference is low. The upper limit of the region roundness screening can be raised and the lower limit of the region roundness screening can be lowered to appropriately widen the screening range and reduce the missed detection of oil film. The adjustment amount of the upper limit value of the region roundness filtering is equal to the product of the pixel density and the seventh preset coefficient plus the product of the aggregation degree and the eighth preset coefficient. The adjustment amount of the lower limit value of the region roundness filtering is equal to the product of the pixel density and the ninth preset coefficient plus the product of the aggregation degree and the tenth preset coefficient. The seventh, eighth, ninth and tenth preset coefficients are set during system initialization.
[0125] In this embodiment, combining the adjusted grayscale filtering upper limit, grayscale filtering lower limit, area filtering upper limit, area filtering lower limit, area roundness filtering upper limit, and area roundness filtering lower limit into a dynamic filtering threshold matrix involves arranging the adjusted grayscale filtering upper limit, grayscale filtering lower limit, area filtering upper limit, area filtering lower limit, area roundness filtering upper limit, and area roundness filtering lower limit in a fixed order to form a six-dimensional matrix, which is the dynamic filtering threshold matrix.
[0126] In another embodiment of the present invention, extracting oil film candidate regions from the enhanced monitoring image based on a dynamic screening threshold matrix includes:
[0127] In the grayscale image of the enhanced monitoring image, pixels with grayscale values between the upper and lower limits of grayscale screening are marked as oil film seed points.
[0128] Using the oil film seed point as the growth starting point, a region growth algorithm is used to expand the region and obtain the initial expansion region;
[0129] The initial expansion region whose area is between the upper and lower limits of the region area screening and whose roundness is between the upper and lower limits of the region roundness screening is marked as the oil film candidate region.
[0130] In this embodiment, the grayscale image of the enhanced monitoring image is a single-channel image obtained by weighted summation of the values of the red, green and blue color channels of each pixel in the enhanced monitoring image. The grayscale value of each pixel represents the brightness information of that pixel.
[0131] In this embodiment, in the grayscale image of the enhanced monitoring image, marking pixels with grayscale values between the upper and lower grayscale screening limits as oil film seed points involves traversing every pixel in the grayscale image of the enhanced monitoring image, reading the grayscale value of each pixel, and marking all pixels with grayscale values greater than or equal to the lower grayscale screening limit and less than or equal to the upper grayscale screening limit as oil film seed points. Pixels with grayscale values less than the lower grayscale screening limit or greater than the upper grayscale screening limit are not marked.
[0132] In this embodiment, the oil film seed point is used as the growth starting point, and the region growth algorithm is used to expand the region. The initial expansion region is obtained by taking each unvisited oil film seed point as the growth starting point and using the gray value of the growth starting point as the reference value. The unvisited pixels adjacent to the growth starting point in the four-neighbor or eight-neighbor direction are checked, and the absolute value of the difference between the gray value of the adjacent pixel and the reference value is calculated. If the absolute value is less than the preset growth threshold, the adjacent pixel is included in the current expansion region and the reference value is updated to the average gray value of all pixels in the current expansion region. The above checking and inclusion process is repeated until no new pixels are included. The finally formed connected region is used as the initial expansion region.
[0133] In this embodiment, roundness is a quantitative index used to characterize how close a region's shape is to a circle. The roundness is calculated as follows: calculate the area of the region, calculate the perimeter of the region, and divide the square of the perimeter by the product of the area and pi multiplied by 4. The value obtained is the roundness. The range of the roundness value is greater than or equal to 1. The closer the roundness is to 1, the closer the shape of the region is to a circle.
[0134] In this embodiment, marking the initial expansion region whose area is between the upper and lower limits of the area screening and whose roundness is between the upper and lower limits of the roundness screening as an oil film candidate region involves calculating the area and roundness values of each initial expansion region. Initial expansion regions whose area value is greater than or equal to the lower limit of the area screening and less than or equal to the upper limit of the area screening, and whose roundness value is greater than or equal to the lower limit of the roundness screening and less than or equal to the upper limit of the roundness screening, are marked as oil film candidate regions. Initial expansion regions that do not meet either of the above area and roundness conditions are excluded.
[0135] like Figure 2As shown, in another embodiment of the present invention, the boundary indentation vector field of the oil film candidate region is extracted, and the morphological indentation feature parameters of the oil film candidate region are calculated based on the boundary indentation vector field, including:
[0136] Determine the geometric center of the oil film candidate region;
[0137] Starting from the geometric center, a boundary indentation vector field is generated by pointing to each pixel on the boundary of the oil film candidate region.
[0138] The divergence field is obtained by performing divergence calculation on the boundary shrinkage vector field. The divergence field characterizes the degree of convergence or divergence of the vector field at each point on the boundary of the oil film candidate region. The overall divergence intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all divergence values in the divergence field.
[0139] The curl field is obtained by performing curl calculation on the boundary shrinkage vector field. The curl field characterizes the degree of rotation of the vector field at each point on the boundary of the oil film candidate region. The overall curl intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all curl values in the curl field.
[0140] Multi-scale spatial sampling is performed on the magnitude of the boundary indentation vector field, and the information entropy of the magnitude distribution at each scale is statistically analyzed to obtain a multi-scale indentation entropy sequence. The mean of the multi-scale indentation entropy sequence is used as the comprehensive value of the multi-scale indentation entropy.
[0141] Calculate the standard deviation of the magnitude distribution of all vectors in the boundary indentation vector field, and use it as the magnitude distribution dispersion;
[0142] Calculate the directional distribution concentration of all vectors in the boundary indentation vector field. The directional distribution concentration is equal to the ratio of the absolute value of the cosine difference between the direction angles of all vectors and the principal direction angle to the total number of vectors.
[0143] The overall divergence intensity, overall curl intensity, multi-scale indentation entropy combined value, modulus distribution dispersion, and directional distribution concentration are combined into morphological indentation characteristic parameters.
[0144] In this embodiment, determining the geometric center of the oil film candidate region involves calculating the average horizontal and vertical coordinates of all pixels within the oil film candidate region, and using the coordinate point formed by the average horizontal and vertical coordinates as the geometric center of the oil film candidate region.
[0145] In this embodiment, starting from the geometric center, each pixel on the boundary of the oil film candidate region is pointed to. The boundary indentation vector field is generated by extracting all boundary pixels on the boundary of the oil film candidate region. For each boundary pixel, a direction vector is calculated from the geometric center to the boundary pixel. The starting point of the direction vector is the coordinate of the geometric center, and the ending point of the direction vector is the coordinate of the boundary pixel. All direction vectors are combined according to the arrangement order of the corresponding boundary pixels on the boundary to form the boundary indentation vector field.
[0146] In this embodiment, a divergence field is obtained by performing divergence calculation on the boundary shrinkage vector field. The divergence field characterizes the degree of convergence or divergence of the vector field at each point on the boundary of the oil film candidate region. For each vector in the boundary shrinkage vector field, the partial derivative of the horizontal component of the vector with respect to the horizontal coordinate and the partial derivative of the vertical component of the vector with respect to the vertical coordinate are calculated to obtain the divergence value at the location of the vector. The divergence values at all vector locations together constitute the divergence field.
[0147] In the above divergence calculation, the partial derivatives are approximated by the vector difference between adjacent boundary points. Specifically, for the i-th vector on the boundary, its horizontal partial derivative is approximated by dividing the difference between the horizontal components of the (i+1)-th and (i-1)-th vectors by the arc length distance along the boundary between the two points; the vertical partial derivative is obtained similarly. The curl calculation uses the same discrete difference approximation method to obtain the curl value at each point.
[0148] In this embodiment, the degree of convergence or divergence of the vector field at each point is defined as follows: when the divergence value is positive, it indicates that the vector field at that point is in a divergent state, and the vectors diffuse outward from that point; when the divergence value is negative, it indicates that the vector field at that point is in a convergent state, and the vectors converge from the surrounding area to that point; the larger the absolute value of the divergence value, the stronger the degree of convergence or divergence.
[0149] In this embodiment, the overall divergence intensity of the boundary contraction vector field is obtained by summing the absolute values of all divergence values in the divergence field. This is achieved by traversing each divergence value in the divergence field, taking the absolute value of each divergence value, and summing all the divergence values after taking the absolute values.
[0150] In this embodiment, a curl field is obtained by performing curl calculation on the boundary shrinkage vector field. The curl field characterizes the degree of rotation of the vector field at each point on the boundary of the oil film candidate region. For each vector in the boundary shrinkage vector field, the difference between the partial derivative of the vertical component of the vector with respect to the horizontal coordinate and the partial derivative of the horizontal component of the vector with respect to the vertical coordinate is calculated to obtain the curl value at the location of the vector. The curl values at all vector locations together constitute the curl field.
[0151] In this embodiment, the degree of rotation of the vector field at each point is the absolute value of the curl value. The larger the absolute value of the curl value, the greater the rotation intensity of the vector field at that point. The positive or negative sign of the curl value indicates the direction of rotation.
[0152] In this embodiment, the overall curl intensity of the boundary indentation vector field is obtained by summing the absolute values of all curl values in the curl field. This is achieved by traversing each curl value in the curl field, taking the absolute value of each curl value, and summing all the absolute curl values.
[0153] In this embodiment, the magnitude of the boundary indentation vector field is the length of each vector in the boundary indentation vector field. The magnitude of each vector is equal to the square root of the sum of the squares of the horizontal and vertical components of the vector.
[0154] In this embodiment, the modulus of the boundary indentation vector field is sampled at multiple scales, and the information entropy of the modulus distribution at each scale is statistically analyzed to obtain the multi-scale indentation entropy sequence. This involves setting multiple different spatial sampling intervals, sampling the vectors in the boundary indentation vector field at equal intervals along the boundary of the oil film candidate region according to the spatial sampling interval, obtaining the modulus data set at that scale, statistically analyzing the frequency of different modulus values in the modulus data set, calculating the information entropy of the modulus distribution at that scale based on the frequency of each modulus value, and arranging the information entropy obtained at all scales in ascending order of scale to form the multi-scale indentation entropy sequence.
[0155] In this embodiment, using the mean of the multi-scale indentation entropy sequence as the comprehensive value of multi-scale indentation entropy is to calculate the arithmetic mean of all information entropies in the multi-scale indentation entropy sequence, and use this arithmetic mean as the comprehensive value of multi-scale indentation entropy.
[0156] In this embodiment, all vectors in the boundary indentation vector field are all the direction vectors contained in the boundary indentation vector field that point from the geometric center to each boundary pixel.
[0157] In this embodiment, the standard deviation of the magnitude distribution of all vectors in the boundary indentation vector field is calculated. The magnitude distribution dispersion is obtained by calculating the arithmetic mean of the magnitudes of all vectors in the boundary indentation vector field, then calculating the average of the squares of the differences between the magnitude of each vector and the above arithmetic mean, and finally taking the square root of this average. The result is the magnitude distribution dispersion.
[0158] In this embodiment, the directional distribution concentration of all vectors in the boundary indentation vector field is calculated. The directional distribution concentration is equal to the ratio of the absolute value of the cosine difference between the direction angles of all vectors and the principal direction angle to the total number of vectors. This determines the direction angle with the highest frequency among all vector direction angles in the boundary indentation vector field as the principal direction angle. For each vector in the boundary indentation vector field, the difference between the direction angle of the vector and the principal direction angle is calculated, the cosine value of the difference is calculated and its absolute value is taken, the absolute cosine values of all vectors are added together to obtain the sum of the absolute cosine values, the total number of vectors in the boundary indentation vector field is counted as the total number of vectors, and the sum of the absolute cosine values is divided by the total number of vectors. The resulting ratio is the directional distribution concentration.
[0159] In this embodiment, the vector direction angle is the angle of each vector in the boundary indentation vector field relative to the positive horizontal direction in the two-dimensional plane, with the angle range from 0 degrees to 360 degrees.
[0160] In this embodiment, the principal direction angle is the angle value that appears most frequently among the direction angles of all vectors in the boundary indentation vector field.
[0161] In this embodiment, the sum of the absolute values of the cosine differences between all vector direction angles and the principal direction angle is the sum obtained by first calculating the difference between the direction angle and the principal direction angle of each vector in the boundary indentation vector field, then calculating the cosine function value of the difference, taking the absolute value of the cosine function value, and adding the above absolute values corresponding to all vectors.
[0162] In this embodiment, the total number of vectors is the total number of vectors contained in the boundary indentation vector field, which is equal to the total number of pixels on the boundary of the oil film candidate region.
[0163] In this embodiment, combining the overall divergence intensity, overall curl intensity, multi-scale indentation entropy composite value, modulus distribution dispersion, and directional distribution concentration into morphological indentation feature parameters involves arranging the overall divergence intensity, overall curl intensity, multi-scale indentation entropy composite value, modulus distribution dispersion, and directional distribution concentration in a fixed order to form a five-dimensional feature vector, which is the morphological indentation feature parameter.
[0164] In another embodiment of the present invention, oil film morphology verification of candidate oil film regions based on morphological indentation feature parameters includes:
[0165] When the overall divergence intensity is less than the preset divergence intensity threshold, the overall curl intensity is less than the preset curl intensity threshold, the comprehensive value of the multi-scale indentation entropy is less than the preset indentation entropy threshold, the modulus distribution dispersion is less than the preset dispersion threshold, and the direction distribution concentration is less than the preset concentration threshold, the oil film candidate region is determined to pass the oil film morphology verification.
[0166] In this embodiment, the preset divergence intensity threshold is a pre-set value used to compare with the overall divergence intensity. This value is determined by statistical analysis after calculating the overall divergence intensity from a large number of sample images of known oil film regions. When the overall divergence intensity is less than the threshold, it indicates that the vector field convergence and divergence of the oil film candidate region is within the range of normal oil film.
[0167] In this embodiment, the preset curl intensity threshold is a pre-set value used to compare with the overall curl intensity. This value is determined by statistical analysis after calculating the overall curl intensity from a large number of sample images of known oil film regions. When the overall curl intensity is less than the threshold, it indicates that the degree of vector field rotation of the oil film candidate region is within the range of normal oil film.
[0168] In this embodiment, the preset indentation entropy threshold is a pre-set value used to compare with the multi-scale indentation entropy comprehensive value. This value is determined by statistical analysis after calculating the multi-scale indentation entropy comprehensive value from a large number of sample images of known oil film regions. When the multi-scale indentation entropy comprehensive value is less than the threshold, it indicates that the modulus distribution of the oil film candidate region at different scales is within the range of normal oil film.
[0169] In this embodiment, the preset dispersion threshold is a value set in advance for comparison with the dispersion of the modulus length distribution. This value is determined by statistical analysis after calculating the dispersion of the modulus length distribution from a large number of sample images of known oil film regions. When the dispersion of the modulus length distribution is less than the threshold, it indicates that the uniformity of the distance from each point on the boundary of the oil film candidate region to the geometric center is within the range of normal oil film.
[0170] In this embodiment, the preset concentration threshold is a pre-set value used to compare with the directional distribution concentration. This value is determined by statistical analysis after calculating the directional distribution concentration from a large number of sample images of known oil film areas. When the directional distribution concentration is less than the threshold, it indicates that the directional aggregation of each point on the boundary of the oil film candidate area relative to the geometric center is within the range of normal oil film.
[0171] In another embodiment of the present invention, the oil film candidate region verified by oil film morphology is mapped to a two-dimensional feature space to obtain single-frame oil film feature points, including:
[0172] The ratio of the area of the oil film candidate region to the total area of the monitoring region is obtained as the area contribution coordinate;
[0173] The morphological complexity coordinates are calculated based on the boundary complexity and morphological indentation characteristic parameters of the oil film candidate region. The morphological complexity coordinates are positively correlated with the boundary complexity and also positively correlated with the dispersion of the modulus distribution.
[0174] By using the area contribution coordinates as the abscissa values of the two-dimensional feature space and the morphological complexity coordinates as the ordinate values of the two-dimensional feature space, the oil film feature points of a single frame are obtained.
[0175] In this embodiment, the area of the oil film candidate region is the total number of pixels contained in the oil film candidate region. Each pixel represents a unit area in the image, and the total number of pixels is the area value of the oil film candidate region.
[0176] In this embodiment, the total area of the monitoring area is the total number of pixels contained in the sewage outlet monitoring area. This total number is determined by the resolution of the image acquisition device and the range of the monitoring area in the image. It is set during system initialization and remains fixed during the monitoring process.
[0177] In this embodiment, the boundary complexity of the oil film candidate region is the complexity of the boundary shape of the oil film candidate region. The boundary complexity is calculated as follows: extract all boundary pixels on the boundary of the oil film candidate region, calculate the total number of boundary pixels, calculate the number of inflection points where the direction changes among the boundary pixels, and divide the number of inflection points by the total number of boundary pixels as the boundary complexity.
[0178] In this embodiment, the morphological complexity coordinates are calculated based on the boundary complexity and morphological indentation feature parameters of the oil film candidate region. The morphological complexity coordinates are positively correlated with the boundary complexity and the magnitude distribution dispersion. This means that the morphological complexity coordinates are calculated as follows: the magnitude distribution dispersion is extracted from the morphological indentation feature parameters, the product of the boundary complexity and the first weight coefficient is calculated, the product of the magnitude distribution dispersion and the second weight coefficient is calculated, and the two products are added together to obtain the morphological complexity coordinates. The first weight coefficient and the second weight coefficient are set during system initialization. The larger the boundary complexity value, the larger the morphological complexity coordinate value; the larger the magnitude distribution dispersion value, the larger the morphological complexity coordinate value.
[0179] In this embodiment, the area contribution coordinate is used as the horizontal coordinate value of the two-dimensional feature space, and the morphological complexity coordinate is used as the vertical coordinate value of the two-dimensional feature space. The single-frame oil film feature point is obtained by using the value of the area contribution coordinate as the horizontal axis coordinate and the value of the morphological complexity coordinate as the vertical axis coordinate to determine a point in the two-dimensional plane. This point is the single-frame oil film feature point.
[0180] like Figure 3 As shown, in another embodiment of the present invention, single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained; the single-frame oil film feature points of multiple consecutive frames are connected in chronological order to obtain a temporal evolution trajectory line; and the temporal consistency of oil film candidate regions is confirmed based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line, including:
[0181] The oil film feature points corresponding to each of the multiple consecutive enhanced monitoring images are obtained, and the oil film feature points of each single frame are connected in sequence according to the acquisition time to obtain the temporal evolution trajectory line.
[0182] Calculate the local curvature of the temporal evolution trajectory at each frame sampling point to obtain a curvature sequence, and perform time integration on each curvature value in the curvature sequence to obtain the cumulative curvature integral value of the trajectory;
[0183] The overall slope of the time-series evolution trajectory is calculated, and the overall slope represents the synchronous change trend of the oil film area contribution coordinate and the morphological complexity coordinate.
[0184] Calculate the area enclosed between the time-series evolution trajectory and the standard diffusion trajectory, and use it as the trajectory deviation area;
[0185] Based on the area contribution coordinates of each single-frame oil film feature point in the time-series evolution trajectory, the one-dimensional area time-series signal of the area contribution coordinates in the time dimension is extracted. The phase space reconstruction method is used to embed the one-dimensional area time-series signal into the two-dimensional or three-dimensional phase space to obtain the phase space reconstruction attractor. The fractal dimension of the phase space reconstruction attractor is calculated.
[0186] When the cumulative curvature integral value of the trajectory is less than the preset curvature integral threshold, the overall slope is greater than the preset slope threshold, the trajectory deviation area is less than the preset deviation area threshold, and the fractal dimension is less than the preset fractal dimension threshold, the oil film candidate region is determined to be confirmed through temporal consistency.
[0187] The oil film candidate regions confirmed through time-series consistency will be used to generate pollution deviation and pollution urgency.
[0188] In this embodiment, the local curvature of the temporal evolution trajectory line at each frame sampling point is calculated. The curvature sequence is obtained by taking three adjacent single-frame oil film feature points in the order of their arrangement on the temporal evolution trajectory line to form a local calculation window. For each local calculation window, an arc is fitted using the three points in the window. The reciprocal of the radius of the arc is used as the local curvature value at the middle point of the window. The local curvature values corresponding to all local calculation windows are arranged in chronological order to form a curvature sequence.
[0189] In this embodiment, the cumulative curvature integral value of the trajectory is obtained by performing time integration on each curvature value in the curvature sequence. This is achieved by multiplying each curvature value in the curvature sequence by the time interval corresponding to that curvature value and then summing the results. The time interval is the acquisition time difference between two adjacent frames. The sum of all the summed results is the cumulative curvature integral value of the trajectory.
[0190] In this embodiment, the overall slope of the time-series evolution trajectory line is calculated. The overall slope characterizes the synchronous change trend of the oil film area contribution coordinate and the morphological complexity coordinate. This is achieved by performing linear regression fitting on all single-frame oil film feature points on the time-series evolution trajectory line. The abscissa of each single-frame oil film feature point is used as the independent variable and the ordinate is used as the dependent variable. The slope of the fitted line is calculated using the least squares method. This slope is the overall slope of the time-series evolution trajectory line. An overall slope greater than zero indicates that the area contribution coordinate and the morphological complexity coordinate show the same trend of change, while an overall slope less than zero indicates that the area contribution coordinate and the morphological complexity coordinate show the opposite trend of change.
[0191] In this embodiment, the standard diffusion trajectory line is a pre-set reference curve representing the relationship between the area contribution coordinates and the morphological complexity coordinates of the oil film during normal diffusion. This reference curve is obtained by fitting the area contribution coordinates and morphological complexity coordinates at each moment after extracting a large amount of sample data of known normal oil film diffusion processes. It is set during system initialization and kept fixed during monitoring.
[0192] In this embodiment, the area enclosed between the time-series evolution trajectory and the standard diffusion trajectory is calculated. The trajectory deviation area is obtained by drawing the time-series evolution trajectory and the standard diffusion trajectory on the same two-dimensional plane, using the same range of values on the horizontal axis as the integration interval, and calculating the area value of the closed region enclosed by the two curves within the integration interval. This area value is the trajectory deviation area.
[0193] In this embodiment, based on the area contribution coordinates of each single-frame oil film feature point in the time-series evolution trajectory, the extraction of the one-dimensional area time-series signal of the area contribution coordinates in the time dimension is to arrange the area contribution coordinate values of each single-frame oil film feature point in the time-series evolution trajectory according to the acquisition time order of each single-frame oil film feature point, forming a one-dimensional signal sequence with time as the independent variable and area contribution coordinate value as the dependent variable. This one-dimensional signal sequence is the one-dimensional area time-series signal of the area contribution coordinates in the time dimension.
[0194] In this embodiment, a phase space reconstruction method is used to embed a one-dimensional area time series signal into a two-dimensional or three-dimensional phase space to obtain a phase space reconstruction attractor. Calculating the fractal dimension of the phase space reconstruction attractor involves setting the embedding dimension and the delay time. The embedding dimension is set to 2 or 3, and the delay time is determined through autocorrelation analysis of the one-dimensional area time series signal. Based on the embedding dimension and the delay time, each data point in the one-dimensional area time series signal is mapped to a point in the phase space. All mapped points together constitute the phase space reconstruction attractor. The fractal dimension is calculated using the box counting method. The phase space reconstruction attractor is covered in phase space with square grids of different side lengths. The number of grids required to cover the attractor for different grid side lengths is counted. The slope is calculated based on the linear relationship between grid side length and the number of grids in a logarithmic coordinate system. The absolute value of this slope is the fractal dimension.
[0195] In this embodiment, the preset curvature integral threshold is a pre-set value used to compare with the trajectory cumulative curvature integral value. This value is determined by statistical analysis after calculating the trajectory cumulative curvature integral value from a large number of sample data of known normal oil film diffusion processes. When the trajectory cumulative curvature integral value is less than the threshold, it indicates that the smoothness of the morphological change of the oil film candidate region is within the normal range.
[0196] In this embodiment, the preset slope threshold is a value set in advance for comparison with the overall slope. This value is determined by statistical analysis after calculating the overall slope from a large number of sample data of known normal oil film diffusion processes. When the overall slope is greater than the threshold, it indicates that the synchronous change trend of the area and morphology of the oil film candidate region is within the normal range.
[0197] In this embodiment, the preset deviation area threshold is a pre-set value used for comparison with the trajectory deviation area. This value is determined by statistical analysis after calculating the trajectory deviation area from a large number of sample data of known normal oil film diffusion processes. When the trajectory deviation area is less than the threshold, it indicates that the deviation between the temporal evolution trajectory of the oil film candidate region and the standard diffusion trajectory is within the normal range.
[0198] In this embodiment, the preset fractal dimension threshold is a pre-set value used for comparison with the fractal dimension. This value is determined by statistical analysis after calculating the fractal dimension from a large number of sample data of known normal oil film diffusion processes. When the fractal dimension is less than the threshold, it indicates that the time series dynamic complexity of the oil film candidate region is within the normal range.
[0199] In another embodiment of the present invention, a contamination deviation degree and a contamination urgency degree are generated based on the oil film candidate regions confirmed through temporal consistency; a two-dimensional feature coordinate system for contamination determination is constructed based on the contamination deviation degree and the contamination urgency degree; and the existence of oil film contamination is determined based on the two-dimensional feature coordinate system for contamination determination, including:
[0200] The comprehensive pollution index is calculated based on the area contribution coordinates and morphological complexity coordinates of the oil film candidate regions confirmed through temporal consistency.
[0201] Acquire multi-frame enhanced monitoring images of historical pollution-free periods, calculate the baseline value based on the comprehensive pollution index of the multi-frame enhanced monitoring images of historical pollution-free periods, and update the baseline value based on the latest historical pollution-free period data every preset update cycle to obtain the adaptive drift baseline index.
[0202] The normalized distance between the comprehensive pollution index and the adaptive drift baseline index is used as the pollution deviation.
[0203] Calculate the rate of change of the comprehensive pollution index, calculate the ratio of the comprehensive pollution index to the preset historical maximum pollution index, multiply the rate of change and the ratio, and use the product as the pollution urgency level.
[0204] By using the degree of pollution deviation as the abscissa value of the two-dimensional feature coordinates and the degree of pollution urgency as the ordinate value of the two-dimensional feature coordinates, the two-dimensional feature coordinates for pollution determination are obtained.
[0205] In a two-dimensional plane divided by pollution deviation and pollution urgency, an asymmetric quadrant decision domain is preset, and the trigger threshold of the high deviation-high urgency quadrant is lower than that of the low deviation-low urgency quadrant.
[0206] Real-time location of the current landing point of the two-dimensional feature coordinates of pollution determination in the two-dimensional plane, and calculation of the dwell time integral value of the current landing point in each asymmetric quadrant decision domain;
[0207] When the residence time integral value of any asymmetric quadrant decision domain exceeds the preset residence time threshold corresponding to the asymmetric quadrant decision domain, oil film contamination is determined to exist, and the contamination response strategy corresponding to the asymmetric quadrant decision domain is output.
[0208] Obtain the actual pollution confirmation results and response time evaluation results after each output pollution response strategy, and perform feedback iterative adjustments to the trigger threshold and residence time threshold of each asymmetric quadrant decision domain based on the actual pollution confirmation results and response time evaluation results.
[0209] In this embodiment, the pollution index is calculated by multiplying the area contribution coordinates and morphological complexity coordinates of the oil film candidate regions confirmed through time-series consistency by a first comprehensive weight, multiplying the morphological complexity coordinates by a second comprehensive weight, and then adding the two products together. The sum of these two products is used as the pollution index. The first and second comprehensive weights are set during system initialization.
[0210] In this embodiment, the historical pollution-free period is the time period during which the system has been confirmed to be free of oil film pollution. Enhanced monitoring images collected during this period are marked with pollution-free tags and stored in the system storage medium.
[0211] In this embodiment, acquiring multiple frames of enhanced monitoring images from historical pollution-free periods involves reading enhanced monitoring images that have been marked as pollution-free from the system storage medium.
[0212] In this embodiment, the baseline value is calculated based on the pollution comprehensive index of multiple frames of enhanced monitoring images from historical pollution-free periods. This involves calculating the pollution comprehensive index of each frame of enhanced monitoring images from historical pollution-free periods one by one, obtaining multiple pollution comprehensive index values, calculating the arithmetic mean of the multiple pollution comprehensive index values, and using the arithmetic mean as the baseline value.
[0213] In this embodiment, the preset update cycle is a pre-set time interval for updating the baseline value, which is set to 24 hours during system initialization.
[0214] In this embodiment, the latest historical pollution-free period data is all enhanced monitoring images and their corresponding comprehensive pollution index values collected during the most recent historical pollution-free period before the current moment.
[0215] In this embodiment, the baseline value is updated every preset update cycle based on the latest historical pollution-free period data. The adaptive drift baseline index is obtained by acquiring all enhanced monitoring images in the most recent historical pollution-free period before the current time every 24 hours, recalculating the arithmetic mean of the pollution comprehensive index of all enhanced monitoring images in that period, and replacing the original baseline value with the arithmetic mean as the new baseline value. The new baseline value is the adaptive drift baseline index.
[0216] In this embodiment, the normalized distance between the comprehensive pollution index and the adaptive drift baseline index is used as the pollution deviation. This involves calculating the difference between the comprehensive pollution index and the adaptive drift baseline index, dividing the absolute value of this difference by the maximum absolute value of the adaptive drift baseline index and the comprehensive pollution index to obtain the normalized distance, which is the pollution deviation.
[0217] In this embodiment, calculating the rate of change of the comprehensive pollution index involves obtaining the comprehensive pollution index of the current frame and the comprehensive pollution index of the previous frame, calculating the difference between the comprehensive pollution index of the current frame and the comprehensive pollution index of the previous frame, dividing the difference by the comprehensive pollution index of the previous frame, and obtaining the ratio, which is the rate of change of the comprehensive pollution index.
[0218] In this embodiment, the preset historical maximum pollution index is the maximum value among all the comprehensive pollution indices recorded since the system started operating. This maximum value is continuously recorded and updated in real time by the system.
[0219] In this embodiment, the pollution urgency is determined by multiplying the rate of change by the ratio of the comprehensive pollution index to the preset historical maximum pollution index. This involves calculating the ratio of the comprehensive pollution index to the preset historical maximum pollution index, multiplying this ratio by the rate of change, and obtaining the pollution urgency.
[0220] In this embodiment, the pollution deviation degree is used as the horizontal axis value of the two-dimensional feature coordinates, and the pollution urgency degree is used as the vertical axis value of the two-dimensional feature coordinates. The two-dimensional feature coordinates for pollution determination are obtained by using the pollution deviation degree value as the horizontal axis coordinate and the pollution urgency degree value as the vertical axis coordinate to determine a point in the two-dimensional plane. This point is the two-dimensional feature coordinates for pollution determination.
[0221] In this embodiment, an asymmetric quadrant decision domain is preset in a two-dimensional plane divided by pollution deviation and pollution urgency. The trigger threshold for the high deviation-high urgency quadrant is lower than that for the low deviation-low urgency quadrant. This is achieved by dividing the two-dimensional plane into four quadrant regions using two boundary lines: pollution deviation equal to a first boundary value and pollution urgency equal to a second boundary value. The first and second boundary values are set during system initialization. The high deviation-high urgency quadrant refers to the quadrant region where both pollution deviation and pollution urgency are greater than the first and second boundary values, respectively. The low deviation-low urgency quadrant refers to the quadrant region where both pollution deviation and pollution urgency are less than or equal to the first and second boundary values. The trigger threshold for the high deviation-high urgency quadrant is lower than that for the low deviation-low urgency quadrant.
[0222] In this embodiment, the trigger threshold of the high deviation-high emergency quadrant is the lower limit of the residence time integral value required to trigger the pollution response strategy when the two-dimensional feature coordinates of pollution determination fall into the high deviation-high emergency quadrant.
[0223] In this embodiment, the trigger threshold of the low deviation-low emergency quadrant is the lower limit of the residence time integral value required to trigger the pollution response strategy when the two-dimensional feature coordinates of pollution determination fall into the low deviation-low emergency quadrant.
[0224] In this embodiment, the real-time positioning of the two-dimensional feature coordinates of pollution determination in the two-dimensional plane is to obtain the two-dimensional feature coordinates of pollution determination corresponding to the current frame, mark the coordinates in the two-dimensional plane, and determine which quadrant region in the asymmetric quadrant decision domain the coordinates are located in.
[0225] In this embodiment, the integral value of the dwell time of the current landing point in each asymmetric quadrant decision domain is calculated by starting the timer from the first time the current landing point falls into a certain quadrant region, calculating the cumulative length of time the current landing point is continuously located in that quadrant region, and using this cumulative length of time as the integral value of the dwell time in that quadrant region.
[0226] In this embodiment, the preset dwell time threshold corresponding to the asymmetric quadrant decision domain is a lower limit value of dwell time set separately for each quadrant region. The preset dwell time thresholds for different quadrant regions are different from each other, and each threshold is set during system initialization.
[0227] In this embodiment, if the integral value of the residence time of any asymmetric quadrant decision domain exceeds the preset residence time threshold corresponding to the asymmetric quadrant decision domain, then for any quadrant region, when the integral value of the residence time of that quadrant region is greater than the preset residence time threshold corresponding to that quadrant region, the pollution response strategy corresponding to that quadrant region is triggered.
[0228] In this embodiment, the pollution response strategy corresponding to the asymmetric quadrant decision domain is a pre-set response action for each quadrant region. The pollution response strategy corresponding to the high deviation-high urgency quadrant is to immediately trigger the discharge outlet alarm and report to the law enforcement department. The pollution response strategy corresponding to the low deviation-low urgency quadrant is to record monitoring data and maintain the regular monitoring frequency. The pollution response strategy corresponding to the other quadrants is to send early warning notifications and increase the monitoring frequency.
[0229] In this embodiment, obtaining the actual pollution confirmation result and response timeliness evaluation result after each output pollution response strategy means that after each system outputs a pollution response strategy, the existence of pollution corresponding to the response strategy is confirmed by manual or automatic verification, and the time consumed from outputting the response strategy to obtaining the confirmation result is recorded. The confirmation result of whether the pollution exists is taken as the actual pollution confirmation result, and the time consumed is taken as the response timeliness evaluation result.
[0230] In this embodiment, the actual pollution confirmation results and response timeliness evaluation results after each output of the pollution response strategy are the set of corresponding actual pollution confirmation results and response timeliness evaluation results that the system obtains after each output of the pollution response strategy. These results are recorded and stored in the system storage medium in chronological order.
[0231] In this embodiment, the feedback iterative adjustment of the trigger threshold and residence time threshold for each asymmetric quadrant decision domain based on the actual pollution confirmation results and response timeliness evaluation results involves the system reading all historical data from the storage medium after obtaining a new set of actual pollution confirmation results and response timeliness evaluation results. This includes statistically analyzing the false alarm rate and false negative rate of the actual pollution confirmation results in each quadrant region, as well as the average time length of the response timeliness evaluation results. Based on the false alarm rate and false negative rate, and the average time length of the response timeliness evaluation results, the trigger threshold and residence time threshold are adjusted incrementally or incrementally according to a preset adjustment step size. When the false alarm rate is high, the corresponding trigger threshold and residence time threshold are increased according to the preset adjustment step size; when the false negative rate is high, the corresponding trigger threshold and residence time threshold are decreased according to the preset adjustment step size; and when the average time length of the response timeliness evaluation results exceeds the preset timeliness requirement, the corresponding residence time threshold is decreased according to the preset adjustment step size. The preset adjustment step size and preset timeliness requirement are set during system initialization. The adjusted trigger threshold and residence time threshold are stored in the system storage medium for pollution determination in subsequent monitoring cycles.
[0232] This invention provides an embodiment of a wastewater discharge monitoring system based on image features, comprising:
[0233] The image acquisition and enhancement module is used to acquire the original monitoring images of the sewage outlet monitoring area, classify the environmental scene of the original monitoring images, identify the environmental type corresponding to the original monitoring images, match the target image enhancement strategy according to the environmental type, and perform image enhancement processing on the original monitoring images using the target image enhancement strategy to obtain the enhanced monitoring images.
[0234] The interference benchmark extraction module is used to extract multi-dimensional features of the interference environment in the enhanced monitoring image and generate a benchmark feature vector of the interference environment.
[0235] The candidate region extraction module is used to determine a dynamic screening threshold matrix based on the baseline feature vector of the interference environment, and extract oil film candidate regions in the enhanced monitoring image according to the dynamic screening threshold matrix.
[0236] The morphological verification module is used to extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters.
[0237] The temporal confirmation module is used to map the oil film candidate regions verified by oil film morphology to a two-dimensional feature space, obtain single-frame oil film feature points, obtain single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images, connect the single-frame oil film feature points of multiple consecutive frames in chronological order to obtain a temporal evolution trajectory line, confirm the temporal consistency of the oil film candidate regions based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line, and use the oil film candidate regions that have passed the temporal consistency confirmation to generate pollution deviation degree and pollution urgency degree;
[0238] The contamination determination module is used to generate contamination deviation and contamination urgency based on the oil film candidate regions confirmed through time-series consistency, construct two-dimensional feature coordinates for contamination determination based on the contamination deviation and contamination urgency, and determine whether oil film contamination exists based on the two-dimensional feature coordinates for contamination determination.
[0239] In one specific embodiment of the present invention, taking an image acquisition device with a resolution of 1920×1080 pixels, a monitoring area covering the entire acquisition screen, and a monitoring sampling frequency of 1 frame per second as an example, the exemplary value ranges of the above-mentioned preset thresholds and preset coefficients are as follows:
[0240] The initial baseline value for the upper limit of grayscale filtering can be set to 200, and the initial baseline value for the lower limit of grayscale filtering can be set to 50. These values are determined based on the prior feature that the grayscale values of pixels in the oil film region of an 8-bit grayscale image are usually located in the higher grayscale range. The initial baseline value for the upper limit of region area filtering can be set to 500 pixels, and the initial baseline value for the lower limit of region area filtering can be set to 20 pixels. These values are used to exclude non-oil film connected regions with excessively large areas and isolated noise points with excessively small areas. The initial baseline value for the upper limit of region roundness filtering can be set to 2.0, and the initial baseline value for the lower limit of region roundness filtering can be set to 1.0. These values are determined based on the prior feature that the theoretical minimum value of custom roundness is 1.0 and that the oil film shape is regular and the roundness value is close to 1.0.
[0241] The preset divergence intensity threshold can be set to 0.8, the preset curl intensity threshold can be set to 0.6, the preset indentation entropy threshold can be set to 2.5, the preset dispersion threshold can be set to 0.4, and the preset concentration threshold can be set to 0.3. All five thresholds are dimensionless quantities. Among them, the smaller the values of divergence intensity, curl intensity, indentation entropy, and dispersion, the more regular the shape. The smaller the value of concentration, the more uniform the directional distribution. The above values were determined by statistical analysis of a large number of known oil film area samples and known non-oil film area samples, so that the accuracy of morphological verification reaches more than 95%.
[0242] The preset curvature integral threshold can be set to 5.0 (calculated based on 5 consecutive frames of sampling points), the preset slope threshold can be set to 0.1, the preset deviation area threshold can be set to 0.5 (based on the premise that the area contribution coordinates and morphological complexity coordinates are normalized to the [0,1] interval), and the preset fractal dimension threshold can be set to 1.5. The above values were determined by statistical analysis of a large number of known normal oil film diffusion process sample data, so that the accuracy of temporal consistency confirmation reaches more than 95%.
[0243] The values of the first to tenth preset coefficients can be selected from 0.1 to 0.5 respectively; the first comprehensive weight and the second comprehensive weight can be 0.6 and 0.4 respectively; the first boundary value and the second boundary value can be 0.5 and 0.5 respectively; the preset dwell time threshold can be set to 5 seconds; the preset update cycle can be set to 24 hours; and the preset adjustment step size can be set to 0.05.
[0244] The above values can be adjusted according to the water surface conditions, image acquisition device resolution, and monitoring sampling frequency of the actual monitoring scenario. Those skilled in the art can determine the optimal combination of values through a limited number of experiments. The above values do not constitute a limitation on the present invention.
[0245] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of this invention and its equivalents, this invention also intends to include these modifications and variations.
Claims
1. A wastewater discharge monitoring method based on image features, characterized in that, include: Acquire raw monitoring images of the sewage outlet monitoring area, classify the raw monitoring images into environmental scenes, and identify the environmental type corresponding to the raw monitoring images; Based on the environment type, a target image enhancement strategy is matched, and the original monitoring image is enhanced by the target image enhancement strategy to obtain an enhanced monitoring image. Extract multidimensional features of the interference environment from enhanced monitoring images and generate a baseline feature vector of the interference environment. A dynamic screening threshold matrix is determined based on the baseline feature vector of the interference environment, and oil film candidate regions are extracted from the enhanced monitoring image according to the dynamic screening threshold matrix. Extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters; The candidate regions of oil film verified by oil film morphology are mapped to a two-dimensional feature space to obtain single-frame oil film feature points. The oil film feature points corresponding to multiple consecutive enhanced monitoring images are obtained in single frames. The single frames of oil film feature points in multiple consecutive frames are connected in chronological order to obtain the temporal evolution trajectory line. The temporal consistency of the oil film candidate region is confirmed based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line. Based on the oil film candidate regions confirmed through temporal consistency, pollution deviation and pollution urgency are generated. Two-dimensional feature coordinates for pollution determination are constructed based on pollution deviation and pollution urgency. The presence or absence of oil film pollution is determined based on the two-dimensional feature coordinates for pollution determination.
2. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, Extract multidimensional features of the interference environment from the enhanced monitoring images to generate a baseline feature vector of the interference environment, including: The peak frequency and frequency distribution bandwidth of water surface ripples in the enhanced monitoring image are extracted and used as the spectral feature values of water surface ripples. Extract the gray-level gradient components of pixels in the horizontal and vertical directions in the enhanced monitoring image, synthesize the gradient magnitude of each pixel, and calculate the spatial distribution mean and standard deviation of the gradient magnitude as the gradient magnitude in the illumination direction. The density and aggregation of pixels with gray values in the gray range of suspended matter in the enhanced monitoring image are extracted as the feature values of suspended matter density distribution. The spectral characteristic values of water surface ripples, the gradient amplitude of illumination direction, and the characteristic values of suspended matter density distribution are combined to form the reference characteristic vector of the interference environment.
3. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, The dynamic screening threshold matrix is determined based on the baseline feature vector of the interference environment, including: Adjust the upper and lower limits of grayscale filtering based on the gradient magnitude of the illumination direction in the baseline feature vector of the interference environment. Adjust the upper and lower limits of the area screening based on the spectral feature values of water surface ripples in the baseline feature vector of the interference environment. Adjust the upper limit and lower limit of the region roundness screening based on the suspended matter density distribution characteristic value in the interference environment baseline feature vector; The adjusted grayscale filtering upper limit, grayscale filtering lower limit, area filtering upper limit, area filtering lower limit, area roundness filtering upper limit, and area roundness filtering lower limit are combined into a dynamic filtering threshold matrix.
4. The wastewater discharge monitoring method based on image features according to claim 3, characterized in that, Based on a dynamic screening threshold matrix, candidate regions for oil film are extracted from the enhanced monitoring image, including: In the grayscale image of the enhanced monitoring image, pixels with grayscale values between the upper and lower limits of grayscale screening are marked as oil film seed points. Using the oil film seed point as the growth starting point, a region growth algorithm is used to expand the region and obtain the initial expansion region; The initial expansion region whose area is between the upper and lower limits of the region area screening and whose roundness is between the upper and lower limits of the region roundness screening is marked as the oil film candidate region.
5. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, Extract the boundary indentation vector field of the oil film candidate region, and calculate the morphological indentation characteristic parameters of the oil film candidate region based on the boundary indentation vector field, including: Determine the geometric center of the oil film candidate region; Starting from the geometric center, a boundary indentation vector field is generated by pointing to each pixel on the boundary of the oil film candidate region. The divergence field is obtained by performing divergence calculation on the boundary shrinkage vector field. The divergence field characterizes the degree of convergence or divergence of the vector field at each point on the boundary of the oil film candidate region. The overall divergence intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all divergence values in the divergence field. The curl field is obtained by performing curl calculation on the boundary shrinkage vector field. The curl field characterizes the degree of rotation of the vector field at each point on the boundary of the oil film candidate region. The overall curl intensity of the boundary shrinkage vector field is obtained by summing the absolute values of all curl values in the curl field. Multi-scale spatial sampling is performed on the magnitude of the boundary indentation vector field, and the information entropy of the magnitude distribution at each scale is statistically analyzed to obtain a multi-scale indentation entropy sequence. The mean of the multi-scale indentation entropy sequence is used as the comprehensive value of the multi-scale indentation entropy. Calculate the standard deviation of the magnitude distribution of all vectors in the boundary indentation vector field, and use it as the magnitude distribution dispersion; Calculate the directional distribution concentration of all vectors in the boundary indentation vector field. The directional distribution concentration is equal to the ratio of the absolute value of the cosine difference between the direction angles of all vectors and the principal direction angle to the total number of vectors. The overall divergence intensity, overall curl intensity, multi-scale indentation entropy combined value, modulus distribution dispersion, and directional distribution concentration are combined into morphological indentation characteristic parameters.
6. The wastewater discharge monitoring method based on image features according to claim 5, characterized in that, Oil film morphology verification is performed on candidate regions based on morphological indentation feature parameters, including: When the overall divergence intensity is less than the preset divergence intensity threshold, the overall curl intensity is less than the preset curl intensity threshold, the comprehensive value of the multi-scale indentation entropy is less than the preset indentation entropy threshold, the modulus distribution dispersion is less than the preset dispersion threshold, and the direction distribution concentration is less than the preset concentration threshold, the oil film candidate region is determined to pass the oil film morphology verification.
7. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, The candidate regions of oil film verified by oil film morphology are mapped to a two-dimensional feature space to obtain single-frame oil film feature points, including: The ratio of the area of the oil film candidate region to the total area of the monitoring region is obtained as the area contribution coordinate; The morphological complexity coordinates are calculated based on the boundary complexity and morphological indentation characteristic parameters of the oil film candidate region. The morphological complexity coordinates are positively correlated with the boundary complexity and also positively correlated with the dispersion of the modulus distribution. By using the area contribution coordinates as the abscissa values of the two-dimensional feature space and the morphological complexity coordinates as the ordinate values of the two-dimensional feature space, the oil film feature points of a single frame are obtained.
8. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, The process involves acquiring single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images, connecting these feature points in chronological order to obtain a temporal evolution trajectory line, and then verifying the temporal consistency of oil film candidate regions based on the trajectory geometry and temporal evolution features of the trajectory line. This includes: The oil film feature points corresponding to each of the multiple consecutive enhanced monitoring images are obtained, and the oil film feature points of each single frame are connected in sequence according to the acquisition time to obtain the temporal evolution trajectory line. Calculate the local curvature of the temporal evolution trajectory at each frame sampling point to obtain a curvature sequence, and perform time integration on each curvature value in the curvature sequence to obtain the cumulative curvature integral value of the trajectory; The overall slope of the time-series evolution trajectory is calculated, and the overall slope represents the synchronous change trend of the oil film area contribution coordinate and the morphological complexity coordinate. Calculate the area enclosed between the time-series evolution trajectory and the standard diffusion trajectory, and use it as the trajectory deviation area; Based on the area contribution coordinates of each single-frame oil film feature point in the time-series evolution trajectory, the one-dimensional area time-series signal of the area contribution coordinates in the time dimension is extracted. The phase space reconstruction method is used to embed the one-dimensional area time-series signal into the two-dimensional or three-dimensional phase space to obtain the phase space reconstruction attractor. The fractal dimension of the phase space reconstruction attractor is calculated. When the cumulative curvature integral value of the trajectory is less than the preset curvature integral threshold, the overall slope is greater than the preset slope threshold, the trajectory deviation area is less than the preset deviation area threshold, and the fractal dimension is less than the preset fractal dimension threshold, the oil film candidate region is determined to be confirmed through temporal consistency. The oil film candidate regions confirmed through time-series consistency will be used to generate pollution deviation and pollution urgency.
9. The wastewater discharge monitoring method based on image features according to claim 1, characterized in that, Based on the oil film candidate regions confirmed through temporal consistency, contamination deviation and contamination urgency are generated. A two-dimensional feature coordinate system for contamination determination is constructed based on these two-dimensional feature coordinates. The presence of oil film contamination is then determined according to these coordinates, including: The comprehensive pollution index is calculated based on the area contribution coordinates and morphological complexity coordinates of the oil film candidate regions confirmed through temporal consistency. Acquire multi-frame enhanced monitoring images of historical pollution-free periods, calculate the baseline value based on the comprehensive pollution index of the multi-frame enhanced monitoring images of historical pollution-free periods, and update the baseline value based on the latest historical pollution-free period data every preset update cycle to obtain the adaptive drift baseline index. The normalized distance between the comprehensive pollution index and the adaptive drift baseline index is used as the pollution deviation. Calculate the rate of change of the comprehensive pollution index, calculate the ratio of the comprehensive pollution index to the preset historical maximum pollution index, multiply the rate of change and the ratio, and use the product as the pollution urgency level. By using the degree of pollution deviation as the abscissa value of the two-dimensional feature coordinates and the degree of pollution urgency as the ordinate value of the two-dimensional feature coordinates, the two-dimensional feature coordinates for pollution determination are obtained. In a two-dimensional plane divided by pollution deviation and pollution urgency, an asymmetric quadrant decision domain is preset, and the trigger threshold of the high deviation-high urgency quadrant is lower than that of the low deviation-low urgency quadrant. Real-time location of the current landing point of the two-dimensional feature coordinates of pollution determination in the two-dimensional plane, and calculation of the dwell time integral value of the current landing point in each asymmetric quadrant decision domain; When the residence time integral value of any asymmetric quadrant decision domain exceeds the preset residence time threshold corresponding to the asymmetric quadrant decision domain, it is determined that oil film contamination exists, and the contamination response strategy corresponding to the asymmetric quadrant decision domain is output. Obtain the actual pollution confirmation results and response time evaluation results after each output pollution response strategy, and perform feedback iterative adjustments to the trigger threshold and residence time threshold of each asymmetric quadrant decision domain based on the actual pollution confirmation results and response time evaluation results.
10. A wastewater discharge monitoring system based on image features, characterized in that, include: The image acquisition and enhancement module is used to acquire the original monitoring images of the sewage outlet monitoring area, classify the environmental scene of the original monitoring images, identify the environmental type corresponding to the original monitoring images, match the target image enhancement strategy according to the environmental type, and perform image enhancement processing on the original monitoring images using the target image enhancement strategy to obtain the enhanced monitoring images. The interference benchmark extraction module is used to extract multi-dimensional features of the interference environment in the enhanced monitoring image and generate a benchmark feature vector of the interference environment. The candidate region extraction module is used to determine a dynamic screening threshold matrix based on the baseline feature vector of the interference environment, and extract oil film candidate regions in the enhanced monitoring image according to the dynamic screening threshold matrix. The morphological verification module is used to extract the boundary indentation vector field of the oil film candidate region, calculate the morphological indentation feature parameters of the oil film candidate region based on the boundary indentation vector field, and verify the oil film morphology of the oil film candidate region based on the morphological indentation feature parameters. The temporal confirmation module is used to map the oil film candidate regions verified by oil film morphology to a two-dimensional feature space, obtain single-frame oil film feature points, obtain single-frame oil film feature points corresponding to multiple consecutive enhanced monitoring images, connect the single-frame oil film feature points of multiple consecutive frames in chronological order to obtain a temporal evolution trajectory line, confirm the temporal consistency of the oil film candidate regions based on the trajectory geometric features and temporal evolution features of the temporal evolution trajectory line, and use the oil film candidate regions that have passed the temporal consistency confirmation to generate pollution deviation degree and pollution urgency degree; The contamination determination module is used to generate contamination deviation and contamination urgency based on the oil film candidate regions confirmed through time-series consistency, construct two-dimensional feature coordinates for contamination determination based on the contamination deviation and contamination urgency, and determine whether oil film contamination exists based on the two-dimensional feature coordinates for contamination determination.
Citation Information
Patent Citations
Sewage discharge monitoring method and system based on image features
CN118115502B