CN115797813B - Water environment pollution detection method based on aerial image - Google Patents
Water environment pollution detection method based on aerial image Download PDFInfo
- Publication number
- CN115797813B CN115797813B CN202310092012.0A CN202310092012A CN115797813B CN 115797813 B CN115797813 B CN 115797813B CN 202310092012 A CN202310092012 A CN 202310092012A CN 115797813 B CN115797813 B CN 115797813B
- Authority
- CN
- China
- Prior art keywords
- garbage
- area
- water surface
- real
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A20/00—Water conservation; Efficient water supply; Efficient water use
- Y02A20/20—Controlling water pollution; Waste water treatment
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of image data processing, in particular to a water environment pollution detection method based on aerial images. According to the method, a real-time water surface image and a reference image of a water area are acquired, garbage to-be-detected areas in the two images are acquired respectively according to gray values, a shape matrix of the garbage to-be-detected areas is acquired based on positions of edge pixel points, a texture matrix of the garbage to-be-detected areas is acquired based on gray values of the pixel points, a feature matrix of the garbage to-be-detected areas is acquired by combining the shape matrix and the texture matrix, a corresponding garbage to-be-detected area of a water surface floating object in the two images forms a matching area pair according to feature matrix differences, ripple influence values are acquired according to position information in the matching area pair, a feature difference threshold value is acquired, whether the garbage to-be-detected areas are water surface floating garbage or not is judged based on the feature difference threshold value, water environment pollution conditions of the water area are determined according to distribution information of the water surface floating garbage, and accuracy of water environment pollution condition detection of the water area is improved.
Description
Technical Field
The invention relates to the technical field of image data processing, in particular to a water environment pollution detection method based on aerial images.
Background
With the progress of urban and industrial production and the development of the tourism industry, a large amount of wastes are generated in daily production and life, and various environmental problems are caused by the wastes, namely, the pollution of the garbage on the water surface. The garbage generally floats on the surface of the water body to influence the quality of the water body, not only shields sunlight from entering the sea to influence the growth of underwater vegetation, but also is easy to swallow by fish, water birds and other organisms, so that the water surface needs to be detected. When floating garbage appears on the water surface, the garbage can be salvaged timely, so that secondary pollution caused by garbage collection is reduced, and the influence on the environment is reduced.
In the prior art, an image of a water area is divided into a plurality of non-overlapping super-pixel image blocks by using a linear iterative clustering algorithm, the super-pixel image blocks which do not contain pollutants are selected to be used as an optimized background template, a primary saliency map is obtained according to a matrix of the optimized background template, the super-pixel image blocks which meet the threshold value of the primary saliency map are screened to form a front Jing Moban, the optimized background template and a front Jing Moban feature matrix are combined, a parameter vector is obtained based on feature matrix fitting, the parameter vector is subjected to multidimensional color feature linear fusion to obtain a secondary saliency map, and the primary saliency map and the secondary saliency map are fused to generate a final saliency map; the feature matrix is built only based on the color features of the super-pixel image blocks, the feature matrix is not built according to the prominent features of the garbage, the accuracy of the feature matrix in representing the corresponding garbage area can be effectively guaranteed, the position of the garbage in the real life water area can change along with the time, and if the water environment pollution condition of the water area is judged according to one image, the water environment pollution judgment deviation exists.
Disclosure of Invention
In order to solve the technical problem that deviation occurs in water environment pollution judgment due to inaccurate acquisition of a feature matrix of a garbage area, the invention aims to provide an aerial image-based water environment pollution detection method, which adopts the following specific technical scheme:
the invention provides a water environment pollution detection method based on aerial images, which comprises the following steps:
acquiring a real-time water surface image of a water area, and taking the real-time water surface image of a preset time interval before the corresponding moment of the real-time water surface image as a reference image;
acquiring a garbage waiting area in a real-time water surface image and a garbage waiting area in a reference image according to the gray value;
acquiring a shape matrix of each garbage to-be-detected area based on the positions of the edge pixel points; acquiring a texture matrix of each garbage to-be-detected area based on gray values of pixel points; combining the number of pixel points, the shape matrix and the texture matrix to obtain a feature matrix of each garbage to-be-detected area;
matching the garbage waiting area between the real-time water surface image and the reference image according to the feature matrix difference to obtain a matching area pair; acquiring ripple influence values according to the position information in each matching region pair, and acquiring characteristic difference threshold values based on the ripple influence values;
judging whether the corresponding garbage to-be-detected area in the real-time water surface image is water surface floating garbage or not according to the feature matrix difference and the feature difference threshold value in the matching area pair, and judging whether water environment pollution exists or not according to water surface floating garbage distribution.
Further, the method for acquiring the garbage waiting area in the real-time water surface image and the garbage waiting area in the reference image according to the gray value comprises the following steps:
and respectively acquiring a saliency map of the real-time water surface image and a saliency map of the reference image, taking an area formed by pixel points with gray values different from 0 in the two saliency maps as an area to be detected of the corresponding saliency map, and clustering the pixel points in each to-be-detected area of the real-time water surface image and each to-be-detected area of the reference image in sequence to respectively acquire a garbage to-be-detected area of the real-time water surface image and a garbage to-be-detected area of the reference image.
Further, the method for obtaining the shape matrix comprises the following steps:
and obtaining Fourier descriptors of the corresponding garbage to-be-detected areas according to the position coordinates of the edge pixel points in each garbage to-be-detected area, and sequentially arranging elements in the Fourier descriptors to obtain a shape matrix.
Further, the method for obtaining the texture matrix comprises the following steps:
obtaining LBP values of all pixel points in each garbage to-be-detected area, filling the LBP values of all pixel points into corresponding positions according to the positions of the pixel points to obtain matrixes, complementing the matrixes into square matrixes by using 0, and carrying out dimension reduction on the matrixes to obtain texture matrixes corresponding to the garbage to-be-detected areas; the number of lines of the texture matrix is equal to the number of columns of the shape matrix, and the number of columns of the texture matrix is equal to the number of lines of the shape matrix.
Further, the method for acquiring the feature matrix comprises the following steps:
multiplying the shape matrix and the texture matrix to obtain an initial morphological feature matrix;
taking the normalized value of the number of the pixel points in each garbage to-be-detected area as a weighting coefficient of the corresponding initial form feature matrix, and taking the product of the weighting coefficient and the initial form matrix as the feature matrix of the corresponding garbage to-be-detected area.
Further, the method for acquiring the feature matrix differences comprises the following steps:
and sequentially arranging all elements in each feature matrix to form a feature sequence corresponding to the garbage to-be-detected area, wherein the distance between the feature sequence of each garbage to-be-detected area in the real-time water surface image and the sequence of each garbage to-be-detected area in the reference image is used as the feature matrix difference.
Further, the method for acquiring the matching region pair comprises the following steps:
and taking the garbage to-be-detected area in the reference image corresponding to the minimum feature matrix difference of each garbage to-be-detected area in the real-time water surface image as a matching area corresponding to the garbage to-be-detected area in the real-time water surface image, and obtaining a matching area pair.
Further, the method for acquiring the ripple influence value comprises the following steps:
obtaining a ripple influence vector according to the position coordinates of the mass center between the two areas in the matching area pair;
the method comprises the steps of arranging the modular lengths of ripple influence vectors of all matching area pairs from small to large to obtain a first modular length sequence, judging a garbage area to be detected in a real-time water surface image corresponding to a mutation value in the first modular length sequence as a first water ripple area, and removing the mutation value of the modular length in the first modular length sequence to obtain a second modular length sequence;
and taking the average value of all the modular lengths in the second modular length sequence as a ripple influence value.
Further, the method for acquiring the characteristic difference threshold value comprises the following steps:
and carrying out normalization processing on the ripple influence value to obtain a normalized ripple influence value, setting a first constant, and taking the difference value between the first constant and the normalized ripple influence value as a characteristic difference threshold.
Further, the method for judging water environment pollution comprises the following steps:
removing a first water wave area in the real-time water surface image, and carrying out normalization processing on the feature matrix differences in the corresponding matching area pairs of each garbage area to be detected in the real-time water surface image to obtain a normalized minimum feature value;
when the normalized minimum characteristic value is smaller than or equal to the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be water surface floating garbage; when the normalized minimum characteristic value is larger than the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be a second water wave area;
setting a quantity threshold and an area threshold, and when the quantity of the garbage to-be-detected areas identified as the water surface floating garbage in the water area is larger than or equal to the quantity threshold or the ratio of the sum of the areas of the garbage to-be-detected areas identified as the water surface floating garbage in the water area to the area of the whole water area is larger than or equal to the area threshold, considering that the water area has water environment pollution.
The invention has the following beneficial effects:
in the embodiment of the invention, a real-time water surface image of a water area and a reference image of the real-time water surface image are obtained, and whether the water surface floating object in the water area is water surface floating garbage can be accurately judged by comparing the difference of the same water surface floating object in the two images; when there are a plurality of water surface floating garbage in the water surface, the water surface floating garbage may be adjacent to each other, or when there are water waves in the water surface, the water waves may also be adjacent to the water surface floating garbage, and both the water waves may cause different water surface floating objects to be identified as a region in the image, in order to analyze the water surface floating objects in the two images in detail, the garbage waiting area in the real-time water surface image and the garbage waiting area in the reference image are acquired according to the gray values; the garbage to-be-detected area may correspond to water waves or water surface floating garbage, and the shape of the water waves is not fixed due to the fact that the water waves cannot be maintained for a long time, and the shape and the texture of the water surface floating garbage are fixed, so that a shape matrix and a texture matrix of each garbage to-be-detected area are obtained; because the feature matrix comprehensively reflects the shape, texture and size characteristics of the garbage to-be-detected area, the feature matrix of each garbage to-be-detected area is obtained by combining the number of pixel points, the shape matrix and the texture matrix; the position of the same garbage to-be-detected area in the real-time water surface image and the reference image is changed due to the influence of wind or other external factors, and in order to carry out deep analysis on the relevant characteristics of the same garbage to-be-detected area, the garbage to-be-detected area between the real-time water surface image and the reference image is matched according to the characteristic matrix difference so as to obtain a matched area pair; when the position change degree of the two garbage to-be-detected areas in the matching area pair is larger, the water flow around the water surface floating garbage corresponding to the area is faster, and the waves are more, the degree of influence of the water surface waves corresponding to the influence area can be judged based on the position change degree of the two garbage to-be-detected areas in the matching area pair, so that the wave influence value is obtained according to the position information in each matching area pair, and the characteristic difference threshold value is obtained based on the wave influence value; judging whether the corresponding garbage to-be-detected area in the real-time water surface image is water surface floating garbage or not according to the feature matrix difference and the feature difference threshold value in the matching area pair, and confirming the condition of water environment pollution based on water surface floating garbage distribution, so that the accuracy of judging the water surface floating objects corresponding to the garbage to-be-detected area is improved, and the accuracy of detecting the water environment pollution is further realized.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a step flowchart of a water environment pollution detection method based on an aerial image according to an embodiment of the present invention.
Detailed Description
In order to further explain the technical means and effects adopted by the invention to achieve the preset aim, the following is a detailed description of specific implementation, structure, characteristics and effects thereof based on the water environment pollution detection method based on the aerial image provided by the invention with reference to the accompanying drawings and the preferred embodiment. In the following description, different "one embodiment" or "another embodiment" means that the embodiments are not necessarily the same. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The invention aims at the specific scene: the method comprises the steps of obtaining aerial images of a water area needing to be detected for pollution of the water surface floating garbage, analyzing the pollution condition of the water surface floating garbage according to the images, and being suitable for situations needing to consider the influence of water surface waves in the analysis process, such as windy water surface.
The invention provides a water environment pollution detection method based on aerial images, which is concretely described below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of steps of a water environment pollution detection method based on aerial images according to an embodiment of the present invention is shown, where the method includes:
step S1: and acquiring a real-time water surface image of the water area, and taking the real-time water surface image of a preset time interval before the corresponding moment of the real-time water surface image as a reference image.
The unmanned aerial vehicle is used for carrying a camera to the upper portion of a water area, remote sensing images of two water areas are obtained at the same position for 30 seconds, the remote sensing image obtained at the current moment is used as a real-time water surface image, the remote sensing image at the moment corresponding to the 30 th s before the current moment is used as a reference image, and the real-time water surface image and the reference image are all RGB images. Noise inevitably occurs on the acquired real-time water surface image and the reference image due to the influence of factors such as vibration of the environment and internal parts of the camera, and in order to avoid the influence of the noise on the subsequent analysis result, gaussian filtering is used for respectively convoluting each channel of the real-time water surface image and the reference image, so that the purpose of reducing the noise in the real-time water surface image and the reference image is achieved, and the precision and quality of the real-time water surface image and the reference image are improved. The gaussian filtering denoising is a well-known technique, and a specific method is not described here.
Step S2: and acquiring a garbage waiting area in the real-time water surface image and a garbage waiting area in the reference image according to the gray value.
When there are a plurality of water surface floating garbage in the water surface of the water area, the water surface floating garbage may be adjacent to each other, or when there are water waves on the water surface, the water waves may also be adjacent to the water surface floating garbage, and these conditions may cause different water surface floating objects to be identified as one area in the real-time water surface image and the reference image, resulting in errors in subsequent analysis results, so as to analyze the water surface floating objects in the real-time water surface image and the reference image in detail, and acquire the garbage waiting area of the real-time water surface image and the garbage waiting area of the reference image, respectively.
The method for acquiring the garbage waiting area of the real-time water surface image and the garbage waiting area of the reference image comprises the following steps: and respectively acquiring a saliency map of the real-time water surface image and a saliency map of the reference image, taking an area formed by pixel points with gray values different from 0 in the two saliency maps as an area to be detected of the corresponding saliency map, and clustering the pixel points in each to-be-detected area of the real-time water surface image and each to-be-detected area of the reference image in sequence to respectively acquire a garbage to-be-detected area of the real-time water surface image and a garbage to-be-detected area of the reference image.
And respectively acquiring a saliency map of the real-time water surface image and a saliency map of the reference image by using an FT saliency detection algorithm on the real-time water surface image and the reference image, wherein the two saliency maps are gray images, pixel points with gray values of 0 in the two saliency maps respectively correspond to pixel points which are not salient in the real-time water surface image and the reference image, pixel points with gray values of not 0 respectively correspond to pixel points which are more salient in the real-time water surface image and the reference image, and the larger the gray values are, the larger the saliency of the corresponding pixel points in the real-time water surface image and the reference image is. Taking an area formed by pixel points with gray values different from 0 in a salient image of the real-time water surface image as an area to be detected of the salient image of the real-time water surface image, wherein the area to be detected corresponds to each area which possibly floats garbage on the water surface in the real-time water surface image; and taking an area formed by pixel points with gray values different from 0 in the saliency map of the reference image as an area to be detected of the saliency map of the reference image, wherein the area to be detected corresponds to each area which possibly floats garbage on the water surface in the reference image. The FT significance detection algorithm is a well-known technology, and a specific method is not described herein.
In the real-time water surface image and the reference image, the areas corresponding to the adjacent water surface floating objects are easy to identify as a to-be-detected area, and in order to enable the identification result to be more accurate, the areas corresponding to the different water surface floating objects are required to be divided independently, so that the influence of a plurality of water surface floating objects on the analysis result in the same to-be-detected area is avoided. And clustering the pixel points in each to-be-detected area of the real-time water surface image and each to-be-detected area of the reference image by using a hierarchical clustering algorithm, wherein the adjacent pixel points with similar pixel value information are clustered, so that a plurality of clusters can be obtained for the real-time water surface image and the reference image, each cluster corresponds to a water surface floating object, one cluster in the real-time water surface image and the reference image is used as a garbage to-be-detected area, the garbage to-be-detected area of the real-time water surface image and the garbage to-be-detected area of the reference image are respectively obtained, and a plurality of garbage to-be-detected areas are formed in the real-time water surface image and the reference image.
Step S3: acquiring a shape matrix of each garbage to-be-detected area based on the positions of the edge pixel points; acquiring a texture matrix of each garbage to-be-detected area based on gray values of pixel points; and combining the number of the pixel points, the shape matrix and the texture matrix to obtain a characteristic matrix of each garbage to-be-detected area.
The garbage waiting area may correspond to water surface floating garbage or water wave. The water wave is formed by blowing wind, impact of underwater hidden current and the like, the shape is not fixed, the difference can occur at the same position at different moments, and the water wave cannot be maintained for a long time; the shape and texture of the floating garbage on the water surface are fixed, and the difference is not large at different moments with shorter differences. Based on the method, the garbage to-be-detected areas are analyzed sequentially from two aspects of shape characteristics and texture characteristics, the shape matrix and the texture matrix of each garbage to-be-detected area are sequentially obtained, and the specific method for obtaining the shape matrix and the texture matrix is as follows:
(1) Analyzing the shape characteristics of the garbage to-be-detected area to obtain a shape matrix of the garbage to-be-detected area: and obtaining Fourier descriptors of the corresponding garbage to-be-detected areas according to the position coordinates of the edge pixel points in each garbage to-be-detected area, and sequentially arranging elements in the Fourier descriptors to obtain a shape matrix.
Graying is carried out on the real-time water surface image and the reference image to respectively obtain a real-time water surface gray level image and a reference gray level image, channel edge detection is used on the real-time water surface gray level image and the reference gray level image, a real-time water surface edge image and a reference edge image are respectively obtained, and the real-time water surface edge image and the reference edge image are both binary images. The channel edge detection is a well-known technique, and a specific method is not described herein.
The Fourier descriptor takes Fourier transformation of object boundary information as shape feature, transforms outline feature from space domain to frequency domain, extracts frequency domain information as feature vector of corresponding object, namely the feature vector describes edge feature of corresponding area of object, when edge features of two areas are similar, difference value of each numerical value between feature matrixes corresponding to the two areas is smaller.
As an example, each pixel point with a pixel value of 1 in the real-time water surface edge image and the reference edge image is obtained respectively, and the positions of the pixel points corresponding to each garbage to-be-detected area in the real-time water surface gray level image and the reference gray level image are found out, and the positions are the position coordinates of the edge pixel points of each garbage to-be-detected area. Evaluating the edge of each garbage to-be-tested area by using Fourier descriptors to obtain Fourier descriptors, and selecting the first 5 elements in the Fourier descriptors to form a shape matrixAnd shape matrix->Is a 5*1 matrix.
(2) Analyzing texture features of the garbage to-be-detected area to obtain a texture matrix of the garbage to-be-detected area: obtaining LBP values of all pixel points in each garbage to-be-detected area, filling the LBP values of all pixel points into corresponding positions according to the positions of the pixel points to obtain matrixes, complementing the matrixes into square matrixes by using 0, and carrying out dimension reduction on the matrixes to obtain texture matrixes corresponding to the garbage to-be-detected areas; the number of lines of the texture matrix is equal to the number of columns of the shape matrix, and the number of columns of the texture matrix is equal to the number of lines of the shape matrix.
LBP refers to a local binary pattern, is an operator for describing local texture characteristics of an image, and has the remarkable advantages of rotation invariance, gray level invariance and the like. The LBP operator compares the relation between the window center point and the neighborhood point, and recodes the window center point and the neighborhood point to form new features, so that the influence of the external scene on the image is eliminated to a certain extent, and the problem of feature description in the complex scene is solved to a certain extent.
As an example, obtaining an LBP value of each pixel point in the garbage to-be-detected area, filling the LBP value of each pixel point into a position of a corresponding pixel point to obtain a matrix, complementing the matrix with 0 to form a square matrix for a vacant position in the matrix, performing dimension reduction on the square matrix by using a Principal Component Analysis (PCA) method to reduce the calculation amount, and obtaining a texture matrix after dimension reductionAnd texture matrix->A 1*5 matrix, i.e., the number of rows of the texture matrix is equal to the number of columns of the shape matrix and the number of columns of the texture matrix is equal to the number of rows of the shape matrix. The principal component analysis method of PCA is a known technique, and the specific method is not described here.
(3) Combining the shape characteristics and texture characteristics of the garbage to-be-detected area to obtain a feature matrix of the garbage to-be-detected area: multiplying the shape matrix and the texture matrix to obtain an initial morphological feature matrix; taking the normalized value of the number of the pixel points in each garbage to-be-detected area as a weighting coefficient of the corresponding initial form feature matrix, and taking the product of the weighting coefficient and the initial form matrix as the feature matrix of the corresponding garbage to-be-detected area.
As an example, a garbage waiting area with real-time water surface imageFor example, refuse treatment area->The number of inner pixels is recorded as +.>Acquiring the number of pixels in each garbage to-be-detected area in a real-time water surface image, and recording the maximum value of the number of pixels in the garbage to-be-detected area as +.>Sequentially acquiring garbage waiting area of real-time water surface image>Shape matrix of->And texture matrix->Combining the number of pixel points in each garbage waiting area in the real-time water surface image and the garbage waiting area of the real-time water surface image>The shape matrix and the texture matrix of the water surface image to obtain a garbage waiting area of the real-time water surface image>Is a feature matrix of (a). Garbage waiting area of real-time water surface image>Feature matrix +.>The calculation formula of (2) is as follows:
in the method, in the process of the invention,garbage waiting area for real-time water surface image>Feature matrix of>Garbage waiting area for real-time water surface image>The number of inner pixels, +.>For the maximum value of the number of pixel points in each garbage to-be-detected area in the real-time water surface image,garbage waiting area for real-time water surface image>Shape matrix of>Garbage waiting area for real-time water surface image>Is a texture matrix of (a).
It should be noted that, due to the garbage waiting area of the real-time water surface imageFeature matrix +.>By corresponding weighting coefficients->And an initial morphological feature matrix, wherein the initial morphological feature matrix is obtained by a shape matrix +.>And texture matrix->Multiplying; maximum value of pixel point number in each garbage to-be-detected area in real-time water surface image +.>Unchanged, when garbage is treated in the area->The greater the number of intra pixels, the weighting coefficient +.>The larger. Therefore, after the weighting coefficient is adjusted, the feature matrix can reflect the size features of the corresponding garbage to-be-detected area, and the larger the number of elements in the feature matrix is, the more the garbage to-be-detected area is->The more pronounced the size characteristics of (2); initial morphological feature matrix->Can comprehensively reflect the shape characteristics and texture characteristics of the corresponding garbage to-be-detected area, and is taken as an initial morphological characteristic matrix +.>The more pronounced the shape and texture features, the more marked the refuse treatment area +.>The more pronounced are both the shape features and the texture features.
And respectively acquiring the characteristic matrix of each garbage to-be-detected area in the real-time water surface image and the reference image according to the method.
Step S4: matching the garbage waiting area between the real-time water surface image and the reference image according to the feature matrix difference to obtain a matching area pair; and acquiring a ripple influence value according to the position information in each matching region pair, and acquiring a characteristic difference threshold value based on the ripple influence value.
The real-time water surface image and the reference image are images obtained at the same position in a fixed short time period, the morphological characteristics of the water surface floating garbage are basically kept unchanged in a short time period, the water wave changes at any moment, the garbage waiting areas in the matching area pairs in the real-time water surface image and the reference image are compared according to the water wave, and the characteristic difference threshold value between the garbage waiting areas at different moments is obtained according to the difference between the characteristic matrixes of the two garbage waiting areas in each matching area pair.
Firstly, acquiring a feature matrix difference between each garbage waiting area in a real-time water surface image and each garbage waiting area in a reference image: and sequentially arranging all elements in each feature matrix to form a feature sequence corresponding to the garbage to-be-detected area, wherein the distance between the feature sequence of each garbage to-be-detected area in the real-time water surface image and the sequence of each garbage to-be-detected area in the reference image is used as the feature matrix difference.
As an example, a garbage waiting area with real-time water surface imageFor example, the garbage waiting area for acquiring real-time water surface images is +.>Feature matrix +.>Characteristic matrix->The elements in the water surface image are sequentially arranged from left to right from top to bottom to form a garbage waiting area of the real-time water surface image>Is>. Selecting a garbage waiting area from the reference image at will, wherein the garbage waiting area of the reference image is +.>For example, the garbage waiting area of the reference image is also +.>Feature matrix +.>The elements in the garbage can are sequentially arranged from left to right from top to bottom to form a garbage waiting area of the reference image>Is>. Based on the characteristic sequence->And the characteristic sequence->Garbage waiting area for acquiring real-time water surface image>Garbage waiting area with reference image>Is a feature matrix difference of (a).
Garbage waiting area of real-time water surface imageGarbage waiting area with reference image>Feature matrix difference->The calculation formula of (2) is as follows:
in the method, in the process of the invention,garbage waiting area for real-time water surface image>Is characterized by>Garbage waiting area serving as reference imageIs characterized by>For the distance dtw between the two sequences in brackets.
Note that, the feature matrix differencesGarbage waiting area reflecting real-time water surface image>Feature matrix of (a)Garbage waiting area with reference image>Feature matrix +.>The degree of difference between the two when the garbage is to be detected>Feature matrix +.>With rubbish waiting area->Feature matrix +.>The smaller the difference between them, the feature matrix +.>And feature matrix->Feature matrix difference between->The smaller.
By the method, the garbage to-be-detected area of the real-time water surface image is calculated respectivelyFeature matrix difference between the real-time water surface image and each garbage waiting area in the reference image, namely the garbage waiting area of the real-time water surface image>A corresponding feature matrix difference exists between the image and each garbage waiting area in the reference image; meanwhile, calculating the feature matrix difference between each garbage waiting area of the real-time water surface image and each garbage waiting area in the reference image.
And secondly, acquiring a garbage waiting area of the same water surface floating object corresponding to the real-time water surface image and a garbage waiting area of the reference image, wherein the two garbage waiting areas form a matching area pair corresponding to the water surface floating object, namely, the garbage waiting area in the reference image corresponding to the minimum feature matrix difference of each garbage waiting area in the real-time water surface image is used as the matching area of the corresponding garbage waiting area in the real-time water surface image, and the matching area pair is obtained.
The method comprises the steps that a corresponding feature matrix difference exists between any one garbage waiting area of a real-time water surface image and each garbage waiting area in a reference image, and as the feature matrix difference between two garbage waiting areas corresponding to the same water surface floating garbage in the real-time water surface image and the reference image is minimum, the garbage waiting areas in the reference image are respectively selected corresponding to the minimum feature matrix difference of each garbage waiting area in the real-time water surface image, the garbage waiting areas are used as matching areas of the corresponding garbage waiting areas in the real-time water surface image, and a matching area pair is formed by the garbage waiting areas in the real-time water surface image and the matching areas of the garbage waiting areas in the reference image.
Then, the ripple influence value corresponding to the influence water area is judged based on the position change between the two garbage to-be-detected areas in the matching area pair: obtaining a ripple influence vector according to the position coordinates of the mass center between the two areas in the matching area pair; the method comprises the steps of arranging the modular lengths of ripple influence vectors of all matching area pairs from small to large to obtain a first modular length sequence, judging a garbage area to be detected in a real-time water surface image corresponding to a mutation value in the first modular length sequence as a first water ripple area, and removing the mutation value of the modular length in the first modular length sequence to obtain a second modular length sequence; and taking the average value of all the modular lengths in the second modular length sequence as a ripple influence value.
When the real-time water surface image and the reference image are acquired, a certain time interval exists, in the time interval, water surface floating garbage can move along with water flow, when the water surface floating garbage is in an environment with faster water flow and larger water surface ripple, the water surface floating garbage shifts more along with water flow, and the position change between two garbage to-be-detected areas in the matching area pair of each water surface floating garbage is larger, so that the ripple influence value corresponding to the influence water area is judged according to the position change between the two garbage to-be-detected areas in the matching area pair of the water surface floating garbage.
The method comprises the steps of placing a real-time water surface image and a reference image in the same rectangular coordinate system, obtaining positions of two garbage to-be-detected areas in each matching area pair corresponding to the real-time water surface image and the reference image, taking the mass centers of the two garbage to-be-detected areas in the matching area pair, taking the mass center of the garbage to-be-detected areas in the matching area pair located in the real-time water surface image as a starting point, taking the mass center of the garbage to-be-detected areas in the matching area pair located in the reference image as an ending point, obtaining a ripple influence vector, obtaining the module length of the ripple influence vector, wherein the module length of the ripple influence vector represents the distance between the two garbage to-be-detected areas in the matching area pair in the same rectangular coordinate system. According to the same method, the modular lengths of the ripple influence vectors between the two garbage to-be-detected areas in each matching area pair are respectively obtained, and the modular lengths of all the ripple influence vectors are arranged from small to large to obtain a first modular length sequence.
In the same water area, the water flow has consistent influence on the water surface floating objects in the same time interval, so that the numerical values in the first model length sequence are similar, and if an abnormal value appears in the first model length sequence, the water surface floating objects of the matched area pair corresponding to the numerical values are considered to be water waves with similar characteristics, but not the water surface floating garbage. And identifying mutation values in the first modular length sequence by using a BG segmentation algorithm, and judging a garbage region to be detected in the real-time water surface image corresponding to the identified mutation values as a first water wave region. Removing mutation values in the first modular length sequence to obtain a second modular length sequence, and respectively marking each modular length in the second modular length sequence asWherein->For the 1 st module length in the second module length sequence,>for the 2 nd modular length in the second modular length sequence, is->Is the +.sup.th in the second modular length sequence>And the length of each die is longer. The BG segmentation algorithm is a known technique, and a specific method is not described herein.
Calculating a ripple influence value based on the modulo lengths in the second modulo length sequence, the ripple influence valueThe calculation formula of (2) is as follows:
in the method, in the process of the invention,is the +.sup.th in the second modular length sequence>Length of individual module>Is the number of modes in the second mode length sequence.
It should be noted that, the ripple influence value reflects the moving distance of the water surface floating objects within a certain time interval, and when the water flow in the water area is more turbulent, the further the moving distance of each water surface floating object within a certain time interval is, that is, the greater each module length in the second module length sequence is, the greater the ripple influence value of the water area is.
And finally, acquiring characteristic difference thresholds of two garbage to-be-detected areas in the matching area pair according to the ripple influence value. And carrying out normalization processing on the ripple influence value to obtain a normalized ripple influence value, setting a first constant, and taking the difference value between the first constant and the normalized ripple influence value as a characteristic difference threshold.
When the distance that the water surface floating object moves in a certain time interval is larger, the water flow of the water area is more turbulent, at the moment, the more the water waves in the water area are, the larger the influence on the matching of each garbage waiting area in the real-time water surface image and the reference image is, and the more severe the characteristic difference threshold value of the matching area to the two garbage waiting areas is caused to be determined later.
Impact on moireNormalization processing is carried out to obtain a normalized ripple influence value +.>Determining characteristic difference threshold values of two garbage to-be-detected areas in the matching area pair based on the normalized ripple influence value, and then determining the characteristic difference threshold values +.>The calculation formula of (2) is as follows:
in the method, in the process of the invention,normalizing the ripple effect value; />The first constant has an empirical value of 1, and can be set by the practitioner by himself, but the set value should be not less than 1 to ensure +.>。
When the moire influence value isThe larger the water surface floating object in the water area moves more in a certain time interval, the more turbulent water flow in the water area is reflected, the more water waves in the water area are caused, and in order to make the judgment of the garbage to-be-detected area more accurate, the characteristic difference threshold value is->The value of (2) should be more strict, so the characteristic difference threshold value +.>The smaller should be.
Thus, the acquisition of the characteristic difference threshold is completed.
Step S5: judging whether the corresponding garbage to-be-detected area in the real-time water surface image is water surface floating garbage or not according to the feature matrix difference and the feature difference threshold value in the matching area pair, and judging whether water environment pollution exists or not according to water surface floating garbage distribution.
Judging whether the corresponding garbage waiting area in the real-time water surface image corresponds to water surface floating garbage according to the characteristic difference threshold value, and further judging the water surface garbage pollution condition of the water area.
Determining that water surface floating objects corresponding to each garbage to-be-detected area in the real-time water surface image are water surface floating garbage or water waves: removing a first water wave area in the real-time water surface image, and carrying out normalization processing on the feature matrix differences in the corresponding matching area pairs of each garbage area to be detected in the real-time water surface image to obtain a normalized minimum feature value; when the normalized minimum characteristic value is smaller than or equal to the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be water surface floating garbage; and when the normalized minimum characteristic value is larger than the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be a second water wave area.
The method for judging the water environment pollution of the water area according to the judgment result of the garbage to-be-detected area corresponding to the water surface floating object in the real-time water surface image comprises the following steps: setting a quantity threshold and an area threshold, and when the quantity of the garbage to-be-detected areas identified as the water surface floating garbage in the water area is larger than or equal to the quantity threshold or the ratio of the sum of the areas of the garbage to-be-detected areas identified as the water surface floating garbage in the water area to the area of the whole water area is larger than or equal to the area threshold, considering that the water area has water environment pollution.
In the embodiment of the invention, the number threshold takes an empirical value of 10, and the area threshold takes an empirical value of 0.1%.
So far, the judgment of each garbage waiting area in the real-time water surface image is completed, the garbage waiting areas corresponding to the floating garbage on the water surface are screened out, and the water surface garbage pollution condition of the water area is accurately judged.
In summary, in the embodiment of the invention, a real-time water surface image of a water area and a reference image of the real-time water surface image are acquired, garbage to-be-detected areas in the two images are acquired respectively according to gray values, shape and texture characteristics of the garbage to-be-detected areas are analyzed, a shape matrix of each garbage to-be-detected area is acquired based on positions of edge pixel points, a texture matrix of each garbage to-be-detected area is acquired based on gray values of the pixel points, a feature matrix corresponding to the garbage to-be-detected areas is acquired by combining the number of the pixel points, the shape matrix and the texture matrix in the garbage to-be-detected areas, a matching area pair is formed by corresponding garbage to-be-detected areas in the two images according to feature matrix differences, ripple influence values are acquired according to position information in the matching area pair, further a feature difference threshold is acquired, whether the garbage to-be-detected areas are water surface floating garbage or not is judged based on the feature difference threshold, water environment pollution conditions of the water area are determined according to distribution information of the water surface floating garbage, and accuracy of water environment pollution condition detection is improved.
It should be noted that: the sequence of the embodiments of the present invention is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing description of the preferred embodiments of the present invention is not intended to be limiting, but rather, any modifications, equivalents, improvements, etc. that fall within the principles of the present invention are intended to be included within the scope of the present invention.
Claims (4)
1. The water environment pollution detection method based on the aerial image is characterized by comprising the following steps of:
acquiring a real-time water surface image of a water area, and taking the real-time water surface image of a preset time interval before the corresponding moment of the real-time water surface image as a reference image;
acquiring a garbage waiting area in a real-time water surface image and a garbage waiting area in a reference image according to the gray value;
acquiring a shape matrix of each garbage to-be-detected area based on the positions of the edge pixel points; acquiring a texture matrix of each garbage to-be-detected area based on gray values of pixel points; combining the number of pixel points, the shape matrix and the texture matrix to obtain a feature matrix of each garbage to-be-detected area;
matching the garbage waiting area between the real-time water surface image and the reference image according to the feature matrix difference to obtain a matching area pair; acquiring ripple influence values according to the position information in each matching region pair, and acquiring characteristic difference threshold values based on the ripple influence values;
judging whether the corresponding garbage to-be-detected area in the real-time water surface image is water surface floating garbage or not according to the feature matrix difference and the feature difference threshold value in the matching area pair, and judging whether water environment pollution exists or not according to water surface floating garbage distribution;
the method for acquiring the garbage waiting area in the real-time water surface image and the garbage waiting area in the reference image according to the gray value comprises the following steps:
respectively acquiring a saliency map of the real-time water surface image and a saliency map of the reference image, taking an area formed by pixel points with gray values different from 0 in the two saliency maps as an area to be detected of the corresponding saliency map, sequentially clustering the pixel points in each to-be-detected area of the real-time water surface image and each to-be-detected area of the reference image, and respectively acquiring a garbage to-be-detected area of the real-time water surface image and a garbage to-be-detected area of the reference image;
the method for acquiring the feature matrix differences comprises the following steps:
sequentially arranging all elements in each feature matrix to form a feature sequence corresponding to the garbage to-be-detected area, and taking the distance between the feature sequence of each garbage to-be-detected area in the real-time water surface image and the sequence of each garbage to-be-detected area in the reference image as the feature matrix difference;
the method for acquiring the matching region pair comprises the following steps:
taking the garbage to-be-detected area in the reference image corresponding to the minimum feature matrix difference of each garbage to-be-detected area in the real-time water surface image as a matching area corresponding to the garbage to-be-detected area in the real-time water surface image, and obtaining a matching area pair;
the method for acquiring the ripple influence value comprises the following steps:
obtaining a ripple influence vector according to the position coordinates of the mass center between the two areas in the matching area pair;
the method comprises the steps of arranging the modular lengths of ripple influence vectors of all matching area pairs from small to large to obtain a first modular length sequence, judging a garbage area to be detected in a real-time water surface image corresponding to a mutation value in the first modular length sequence as a first water ripple area, and removing the mutation value of the modular length in the first modular length sequence to obtain a second modular length sequence;
taking the average value of all the module lengths in the second module length sequence as a ripple influence value;
the method for acquiring the characteristic difference threshold comprises the following steps:
normalizing the ripple influence value to obtain a normalized ripple influence value, setting a first constant, and taking the difference value between the first constant and the normalized ripple influence value as a characteristic difference threshold;
the method for judging the water environment pollution comprises the following steps:
removing a first water wave area in the real-time water surface image, and carrying out normalization processing on the feature matrix differences in the corresponding matching area pairs of each garbage area to be detected in the real-time water surface image to obtain a normalized minimum feature value;
when the normalized minimum characteristic value is smaller than or equal to the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be water surface floating garbage; when the normalized minimum characteristic value is larger than the characteristic difference threshold value, the corresponding garbage waiting area in the real-time water surface image is considered to be a second water wave area;
setting a quantity threshold and an area threshold, and when the quantity of the garbage to-be-detected areas identified as the water surface floating garbage in the water area is larger than or equal to the quantity threshold or the ratio of the sum of the areas of the garbage to-be-detected areas identified as the water surface floating garbage in the water area to the area of the whole water area is larger than or equal to the area threshold, considering that the water area has water environment pollution.
2. The method for detecting water environmental pollution based on aerial images according to claim 1, wherein the method for obtaining the shape matrix comprises the following steps:
and obtaining Fourier descriptors of the corresponding garbage to-be-detected areas according to the position coordinates of the edge pixel points in each garbage to-be-detected area, and sequentially arranging elements in the Fourier descriptors to obtain a shape matrix.
3. The method for detecting water environmental pollution based on aerial images according to claim 2, wherein the method for acquiring the texture matrix comprises the following steps:
obtaining LBP values of all pixel points in each garbage to-be-detected area, filling the LBP values of all pixel points into corresponding positions according to the positions of the pixel points to obtain matrixes, complementing the matrixes into square matrixes by using 0, and carrying out dimension reduction on the matrixes to obtain texture matrixes corresponding to the garbage to-be-detected areas; the number of lines of the texture matrix is equal to the number of columns of the shape matrix, and the number of columns of the texture matrix is equal to the number of lines of the shape matrix.
4. The method for detecting water environmental pollution based on aerial images according to claim 3, wherein the method for acquiring the feature matrix comprises the following steps:
multiplying the shape matrix and the texture matrix to obtain an initial morphological feature matrix;
taking the normalized value of the number of the pixel points in each garbage to-be-detected area as a weighting coefficient of the corresponding initial form feature matrix, and taking the product of the weighting coefficient and the initial form matrix as the feature matrix of the corresponding garbage to-be-detected area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310092012.0A CN115797813B (en) | 2023-02-10 | 2023-02-10 | Water environment pollution detection method based on aerial image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310092012.0A CN115797813B (en) | 2023-02-10 | 2023-02-10 | Water environment pollution detection method based on aerial image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115797813A CN115797813A (en) | 2023-03-14 |
CN115797813B true CN115797813B (en) | 2023-04-25 |
Family
ID=85430726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310092012.0A Active CN115797813B (en) | 2023-02-10 | 2023-02-10 | Water environment pollution detection method based on aerial image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115797813B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116152115B (en) * | 2023-04-04 | 2023-07-07 | 湖南融城环保科技有限公司 | Garbage image denoising processing method based on computer vision |
CN117392465B (en) * | 2023-12-08 | 2024-03-22 | 聚真宝(山东)技术有限公司 | Visual-based garbage classification digital management method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115147733A (en) * | 2022-09-05 | 2022-10-04 | 山东东盛澜渔业有限公司 | Artificial intelligence-based marine garbage recognition and recovery method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2632176C1 (en) * | 2016-06-17 | 2017-10-02 | Федеральное государственное бюджетное научное учреждение "Научно-исследовательский институт аэрокосмического мониторинга АЭРОКОСМОС" | Method for identifying sea surface contamination |
CN112241692B (en) * | 2020-09-25 | 2022-09-13 | 天津大学 | Channel foreign matter intelligent detection and classification method based on aerial image super-pixel texture |
-
2023
- 2023-02-10 CN CN202310092012.0A patent/CN115797813B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115147733A (en) * | 2022-09-05 | 2022-10-04 | 山东东盛澜渔业有限公司 | Artificial intelligence-based marine garbage recognition and recovery method |
Also Published As
Publication number | Publication date |
---|---|
CN115797813A (en) | 2023-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108961235B (en) | Defective insulator identification method based on YOLOv3 network and particle filter algorithm | |
CN111223088B (en) | Casting surface defect identification method based on deep convolutional neural network | |
CN111428748B (en) | HOG feature and SVM-based infrared image insulator identification detection method | |
CN107545239B (en) | Fake plate detection method based on license plate recognition and vehicle characteristic matching | |
CN109101924B (en) | Machine learning-based road traffic sign identification method | |
CN108121991B (en) | Deep learning ship target detection method based on edge candidate region extraction | |
CN115797813B (en) | Water environment pollution detection method based on aerial image | |
CN114749342B (en) | Lithium battery pole piece coating defect identification method, device and medium | |
CN114549981A (en) | Intelligent inspection pointer type instrument recognition and reading method based on deep learning | |
CN110766016B (en) | Code-spraying character recognition method based on probabilistic neural network | |
CN108710862B (en) | High-resolution remote sensing image water body extraction method | |
CN114492619A (en) | Point cloud data set construction method and device based on statistics and concave-convex property | |
CN105405138A (en) | Water surface target tracking method based on saliency detection | |
CN116740528A (en) | Shadow feature-based side-scan sonar image target detection method and system | |
CN111695373A (en) | Zebra crossing positioning method, system, medium and device | |
CN113221881B (en) | Multi-level smart phone screen defect detection method | |
CN113421223B (en) | Industrial product surface defect detection method based on deep learning and Gaussian mixture | |
CN110070545B (en) | Method for automatically extracting urban built-up area by urban texture feature density | |
CN112784757B (en) | Marine SAR ship target significance detection and identification method | |
CN116503622A (en) | Data acquisition and reading method based on computer vision image | |
CN115082776A (en) | Electric energy meter automatic detection system and method based on image recognition | |
CN110516666B (en) | License plate positioning method based on combination of MSER and ISODATA | |
CN116311201A (en) | Substation equipment state identification method and system based on image identification technology | |
CN103065296B (en) | High-resolution remote sensing image residential area extraction method based on edge feature | |
CN111950357A (en) | Marine water surface garbage rapid identification method based on multi-feature YOLOV3 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |