A cyanobacteria water area intelligent identification method and system based on unmanned aerial vehicle vision

CN122090333BActive Publication Date: 2026-09-18NANCHANG HANGKONG UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610552510.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-24
Publication Date
2026-09-18
Estimated Expiration
2046-04-24

AI Technical Summary

Technical Problem

人工巡湖效率低下且存在视野盲区,而卫星遥感易受天气和重访周期限制,难以及时、精细地掌握局部水域的蓝藻分布情况

Benefits of technology

(1)通过构建局部灰度极差与邻域灰度共生矩阵熵值加权融合的蓝藻纹理凝聚指数,并配合迭代形态学驱动规则交替执行结构元素扩张与边缘收缩,能够精确拟合蓝藻絮体的无定形不规则边界,提升分割结果与真实蓝藻区域的重合度,避免了传统矩形框检测带来的面积估算误差。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122090333B_ABST
    Figure CN122090333B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of water ecological environment monitoring, and specifically discloses a cyanobacteria water area intelligent identification method and system based on unmanned aerial vehicle vision, which acquires an original monitoring image; the image is converted to YCbCr color space, the luminance component is sequentially subjected to wavelet transform denoising, limited contrast adaptive histogram equalization, bilateral filtering and median filtering processing, and the enhanced image is reconstructed with the chrominance component; the enhanced image is labeled, and the brightness disturbance of a weather feature vector is introduced to perform data augmentation; a weighted fusion quantity of a local gray scale range and a neighborhood gray scale co-occurrence matrix entropy value is calculated, defined as a cyanobacteria texture condensation index, an iterative morphological driving rule taking the index as an independent variable is constructed, and structural element expansion and edge shrinkage are alternately executed until the overlap rate converges, so that a stable space mapping rule is obtained; the rule is applied to segment the cyanobacteria area and convert the actual coverage area; the application accurately fits the amorphous boundary of cyanobacteria, adapts to complex light and weather changes, and improves the area calculation precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aquatic ecological environment monitoring technology, specifically to a method and system for intelligent identification of cyanobacteria-rich waters based on UAV vision. Background Technology

[0002] Cyanobacterial blooms are a common ecological pollution phenomenon in still water bodies such as inland lakes, reservoirs, and slow-flowing rivers. The explosive proliferation of cyanobacteria leads to a decrease in dissolved oxygen, water quality deterioration, and even the release of algal toxins, seriously threatening the ecological safety of drinking water. Currently, monitoring of cyanobacteria mainly relies on manual lake patrols or satellite remote sensing. Manual patrols are inefficient and have blind spots, while satellite remote sensing is easily limited by weather and revisit cycles, making it difficult to obtain timely and detailed information on the distribution of cyanobacteria in specific water areas.

[0003] In images of cyanobacteria taken by drones at low altitudes, the low grayscale contrast between the cyanobacteria flocs and the water background, the blurred edges, and the amorphous, irregular flocculent texture of the cyanobacteria make it difficult for existing rectangular box-based target detection methods to accurately fit their boundaries. At the same time, conventional image segmentation methods rely on a large amount of labeled data and pre-trained models, and cannot adaptively achieve pixel-level accurate segmentation based on local texture differences in images under conditions of lack of training samples or variable weather. This results in large errors in the estimation of cyanobacteria coverage area and poor environmental adaptability. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for intelligent identification of cyanobacteria-rich waters based on UAV vision, so as to solve the problems mentioned above.

[0005] The objective of this invention can be achieved through the following technical solutions: A method for intelligent identification of cyanobacteria-rich waters based on UAV vision includes the following steps: S1 uses an unmanned aerial vehicle platform equipped with a visible light camera to vertically photograph the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image; S2, convert the original monitoring image to the YCbCr color space, separate the luminance component and chrominance component, and perform wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the luminance component in sequence. Then, merge the processed luminance component and chrominance component to reconstruct the enhanced image. S3, pixel-level annotation of cyanobacteria regions in the enhanced image, generating mask labels, and introducing frame-by-frame images collected under different weather conditions for data augmentation to form a training image set; S4. Based on the training image set, calculate the weighted fusion amount of the local gray-level range of each pixel and the entropy of the neighborhood gray-level co-occurrence matrix, which is defined as the cyanobacteria texture aggregation index. Construct an iterative morphology-driven rule with the cyanobacteria texture aggregation index as the independent variable. The iterative morphology-driven rule alternately performs structuring element expansion and edge contraction. After each iteration, calculate the overlap rate of the two cyanobacteria regions. Stop the iteration when the overlap rate exceeds the preset convergence threshold to obtain a stable spatial mapping rule. S5 inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform.

[0006] As a further aspect of the present invention: S1 specifically includes: Extract two adjacent frames sequentially from a continuous video stream, calculate the local binary pattern histogram of each frame, and obtain their chi-square distance. The chi-square distance is compared with the preset frame extraction sensitivity threshold. If the chi-square distance is greater than the frame extraction sensitivity threshold, the current frame is determined to be a key frame of scene change and is retained. At the same time, the current frame replaces the previous frame as a new comparison benchmark. For continuously retained keyframes, the structural similarity between two adjacent keyframes is calculated. If the similarity is greater than the redundancy removal threshold, the next keyframe is deleted. Finally, the retained keyframes are output as the original monitoring images.

[0007] As a further aspect of the present invention: S2 specifically includes: The brightness component is decomposed into two-level discrete wavelet decomposition using the Dobes fourth-order wavelet basis. The high-frequency coefficients obtained are then subjected to soft thresholding by multiplying the mean of the absolute values ​​of the corresponding layer coefficients by 0.8 as the threshold. The denoised brightness component is then reconstructed by inverse wavelet transform. The luminance component of the noise reduction is subject to contrast amplitude limiting, the histogram clipping threshold is set to 2%, the grid is divided into 8 by 8 blocks, and histogram equalization is performed on each block. Bilateral filtering is applied to the equalization results, with both the standard deviation of spatial distance and the standard deviation of pixel difference set to 75, and the filter window diameter being 9. The bilateral filtering results are sorted by median using a 3x3 sliding window, and the median value is output to obtain the enhanced luminance component.

[0008] As a further aspect of the present invention: S3 specifically includes: Extract the mean brightness and local contrast variance of each frame-by-frame image to construct the weather feature vector of the frame-by-frame image. The weather feature vector is converted into control points of the brightness adjustment curve, and a brightness offset based on the brightness adjustment curve is applied to the enhanced image pixel by pixel to generate a brightness perturbation image; The brightness-perturbed image and the original enhanced image are linearly fused according to random weights, and Gaussian noise perturbation is added to the fusion result to obtain the augmented image; The augmented image, along with its corresponding mask label, is added to the training image set.

[0009] As a further aspect of the present invention: the generation of the brightness perturbation image specifically includes: The three components of brightness mean, contrast variance and skewness are extracted from the weather feature vector and used as the ordinates of the starting point, middle point and ending point of the brightness adjustment curve, respectively. The abscissas of each point are evenly distributed according to 0, 0.5 and 1. A piecewise linear curve is defined by three control points. The horizontal axis of the piecewise linear curve represents the original pixel value, and the vertical axis represents the brightness offset. Iterate through each pixel of the enhanced image, read the normalized brightness value of the pixel, obtain the corresponding offset through linear interpolation on the piecewise linear curve, and add the offset to the original pixel value. The accumulated pixel values ​​are cropped to keep them within the range of 0 to 1, resulting in a brightness perturbation image.

[0010] As a further aspect of the present invention: the calculation process of the cyanobacteria texture aggregation index is as follows: Take a 3x3 window centered on the current pixel, calculate the difference between the maximum and minimum gray values ​​within the window, and obtain the local gray range. Within the same window, the gray-level co-occurrence matrix with zero-degree direction and pixel spacing of one is counted, and the entropy value is calculated based on the gray-level co-occurrence matrix to obtain the entropy value of the neighborhood gray-level co-occurrence matrix; The local gray-level range is multiplied by a weight of 0.6, and the entropy value of the neighborhood gray-level co-occurrence matrix is ​​multiplied by a weight of 0.4. The summation yields the cyanobacteria texture aggregation index.

[0011] As a further aspect of the present invention: the process of obtaining the spatial mapping rules is as follows: Taking the current cyanobacteria region as the processing object, a morphological expansion operation is performed using a disk-shaped structural element with a radius of three, and the expanded region is used as a temporary region. A morphological erosion operation is performed on the temporary region using a disk-shaped structuring element with a radius of two to obtain the updated region after edge shrinkage; Calculate the number of pixels that overlap between the updated region and the original cyanobacteria region, and divide it by the total number of pixels in the updated region to obtain the overlap rate. The overlap rate is compared with a preset 95% convergence threshold. If it is less than the convergence threshold, the morphological dilation operation is repeated until the overlap rate calculation process is completed. Otherwise, the iteration is stopped and the current updated region is output as the output result of the stable spatial mapping rule.

[0012] As a further aspect of the present invention: the binary segmentation result specifically includes: The cohesion index of the blue algae texture of each pixel is compared with the exponential threshold at the time of iterative convergence. If the cohesion index of the blue algae texture is greater than or equal to the exponential threshold, the corresponding pixel is marked as a candidate blue algae pixel; otherwise, it is marked as a background pixel. Perform four-connected component labeling on all candidate cyanobacteria pixels and count the number of pixels contained in each connected component; Connected regions with fewer pixels than a preset minimum area threshold are identified as noise regions and removed, while pixels in the remaining connected regions are retained as the final blue-green algae pixels. The final cyanobacteria pixels are assigned a value of 1, and the background pixels are assigned a value of 0, generating a binary segmentation result.

[0013] As a further aspect of the present invention: the step of counting the number of pixels in the cyanobacteria region and converting it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the unmanned aerial vehicle platform specifically includes: Read the relative flight altitude and camera focal length values ​​from the flight log of the unmanned aerial vehicle platform; Based on the relative flight altitude, camera focal length, and the physical size of a single pixel in the image sensor, the actual side length of a single pixel on the ground is determined, and thus the actual area corresponding to a single pixel is obtained. The total number of pixels contained in the cyanobacteria region with a pixel value of one in the binary segmentation result is counted. The total number of pixels is multiplied by the actual area corresponding to a single pixel to obtain the initial coverage area. The initial coverage area is corrected based on the distortion coefficients of the central and edge regions of the camera lens's vertical projection, and the corrected actual cyanobacteria coverage area in the water is output.

[0014] A smart identification system for cyanobacteria-rich waters based on UAV vision includes: The image acquisition and frame extraction module uses a visible light camera mounted on an unmanned aerial vehicle platform to vertically capture images of the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image. The brightness enhancement and reconstruction module converts the original monitoring image to the YCbCr color space, separates the brightness component and the chromaticity component, and performs wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the brightness component in sequence. The processed brightness component and chromaticity component are then merged and reconstructed into an enhanced image. The annotation and augmentation module performs pixel-level annotation on the cyanobacteria region in the enhanced image, generates mask labels, and introduces frame-by-frame images collected under different weather conditions for data augmentation to form a training image set. The spatial mapping rule generation module, based on the training image set, calculates the weighted fusion amount of the local gray-level range of each pixel and the entropy of the neighborhood gray-level co-occurrence matrix, which is defined as the cyanobacteria texture aggregation index. It constructs an iterative morphology-driven rule with the cyanobacteria texture aggregation index as the independent variable. The iterative morphology-driven rule alternately performs structuring element expansion and edge contraction. After each iteration, the overlap rate of the two cyanobacteria regions is calculated. When the overlap rate exceeds the preset convergence threshold, the iteration stops, and a stable spatial mapping rule is obtained. The segmentation and area conversion module inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform.

[0015] The beneficial effects of this invention are: (1) By constructing a cyanobacterial texture aggregation index that is weighted by the local gray-level difference and the entropy value of the neighborhood gray-level co-occurrence matrix, and by alternating the expansion of structural elements and the contraction of edges with iterative morphology-driven rules, the amorphous irregular boundary of cyanobacterial flocs can be accurately fitted, improving the overlap between the segmentation results and the real cyanobacterial region, and avoiding the area estimation error caused by traditional rectangular box detection.

[0016] (2) By performing wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering and median filtering on the brightness component in sequence, and introducing brightness perturbation and linear fusion data augmentation based on weather feature vectors, the interference of water surface reflection and texture under different lighting conditions is effectively suppressed, and the recognition stability and accuracy under various weather scenarios such as sunny, foggy and cloudy days are enhanced. Attached Figure Description

[0017] The invention will now be further described with reference to the accompanying drawings.

[0018] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a system block diagram of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figure 1 As shown, this invention is an intelligent identification method for cyanobacteria-rich waters based on UAV vision, comprising the following steps: S1 uses an unmanned aerial vehicle platform equipped with a visible light camera to vertically photograph the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image; S2, convert the original monitoring image to the YCbCr color space, separate the luminance component and chrominance component, and perform wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the luminance component in sequence. Then, merge the processed luminance component and chrominance component to reconstruct the enhanced image. S3, pixel-level annotation of cyanobacteria regions in the enhanced image, generating mask labels, and introducing frame-by-frame images collected under different weather conditions for data augmentation to form a training image set; S4. Based on the training image set, calculate the weighted fusion amount of the local gray-level range of each pixel and the entropy of the neighborhood gray-level co-occurrence matrix, which is defined as the cyanobacteria texture aggregation index. Construct an iterative morphology-driven rule with the cyanobacteria texture aggregation index as the independent variable. The iterative morphology-driven rule alternately performs structuring element expansion and edge contraction. After each iteration, calculate the overlap rate of the two cyanobacteria regions. Stop the iteration when the overlap rate exceeds the preset convergence threshold to obtain a stable spatial mapping rule. S5 inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform.

[0021] In S1, a visible light camera mounted on an unmanned aerial vehicle (UAV) vertically captures images of the target water area. The acquired continuous video stream is then processed by frame extraction to obtain the original monitoring images, specifically including: First, from the continuous video stream recorded by the visible light camera on the unmanned aerial platform, two adjacent frames are sequentially extracted and labeled as the previous frame and the current frame. The local binary pattern histograms (LANs) for these two frames are then calculated. The LAN calculation method is as follows: for each pixel in the image, a 3-pixel multiplied neighborhood window is taken centered on that pixel. The gray values ​​of the eight neighboring pixels within this window are compared with the gray value of the center pixel. If the gray value of a neighboring pixel is greater than or equal to the gray value of the center pixel, it is marked as 1; otherwise, it is marked as 0. This yields an 8-bit binary number, which is then converted to a decimal number between 0 and 255 as the LAN encoding value for that pixel. The frequency of each encoding value in the entire image is counted and normalized to obtain the LAN histogram. Then, the chi-square distance between the LAN histograms of the previous frame and the current frame is calculated. The chi-square distance is calculated as follows: For each possible encoded value index in the histogram, take the square of the difference between the value at that index in the previous frame histogram and the value at the same index in the current frame histogram, divide it by the sum of the values ​​in the previous frame histogram and the current frame histogram, and sum the results corresponding to all indices to obtain the chi-square distance.

[0022] Next, the calculated chi-square distance is compared with a preset frame extraction sensitivity threshold. The frame extraction sensitivity threshold is set to 0.3, an empirical value determined through statistical analysis of typical water videos containing different levels of lighting, wind speed, and water surface undulation. If the chi-square distance is greater than this threshold, it is determined that the current frame has undergone a significant scene change compared to the previous frame, and it is retained as a key frame of scene change; simultaneously, the current frame replaces the previous frame as the new benchmark for subsequent comparisons. If the chi-square distance is less than or equal to the threshold, the current frame is discarded, and the next frame is extracted and compared with the previous frame.

[0023] Finally, redundancy removal is performed on the continuously retained keyframes. Adjacent keyframes are read sequentially, and their structural similarity is calculated. The structural similarity is calculated as follows: the mean luminance, variance luminance, and covariance luminance of the two keyframes are calculated separately. The product of the mean luminance is multiplied by 2, then a constant is added, and this product is divided by the sum of the squares of the two mean luminances plus the same constant to obtain the luminance comparison term. The product of the variance luminance is multiplied by 2, then another constant is added, and this product is divided by the sum of the two variance luminances plus the same constant to obtain the contrast comparison term. The luminance covariance is added to a third constant, and this product is divided by the product of the two standard deviations of luminance plus the third constant to obtain the structural comparison term. The luminance comparison term, contrast comparison term, and structural comparison term are multiplied together to obtain the structural similarity. All three constants are set to 0.0001. The calculated structural similarity is compared with a preset redundancy removal threshold, which is set to 0.95. If the structural similarity is greater than 0.95, the subsequent keyframe is considered highly redundant with the previous keyframe, and the subsequent keyframe is deleted; if the structural similarity is less than or equal to 0.95, the subsequent keyframe is retained. After traversing all consecutively retained keyframes, all the final retained keyframes are output as the original monitoring image.

[0024] In S2, the original monitoring image is converted to the YCbCr color space, and the luminance and chrominance components are separated. The luminance component is then subjected to wavelet transform denoising, contrast-limited adaptive histogram equalization, bilateral filtering smoothing, and median filtering. The processed luminance and chrominance components are then merged to reconstruct an enhanced image, specifically including: First, the original monitoring image is converted from the red-green-blue color space to the luminance-chrominance color space, separating the luminance component and two chrominance components. The conversion formula adopts the high-definition television standard established by the International Telecommunication Union (ITU), specifically: the luminance component equals the sum of the red component multiplied by 0.2126, the green component multiplied by 0.7152, and the blue component multiplied by 0.0722; the first chrominance component equals the blue component minus the luminance component divided by 1.5748; the second chrominance component equals the red component minus the luminance component divided by 1.8556. After conversion, only the luminance component undergoes further processing; the two chrominance components remain unchanged.

[0025] Secondly, wavelet transform denoising is performed on the luminance component. A two-level discrete wavelet decomposition of the luminance component is performed using a Dobessi fourth-order wavelet basis to obtain the low-frequency approximation coefficients and high-frequency detail coefficients of the first and second levels. For each level's high-frequency detail coefficients, the mean of the absolute values ​​of all high-frequency coefficients in that level is calculated, and this mean is multiplied by 0.8 to serve as the soft threshold for that level. For each high-frequency coefficient, if its absolute value is greater than or equal to the corresponding threshold, it is shrunk towards zero by the threshold length, i.e., the coefficient is subtracted from the threshold (if the coefficient is positive) or added to the threshold (if the coefficient is negative); if its absolute value is less than the threshold, the coefficient is set to zero. After thresholding all high-frequency coefficients, an inverse wavelet transform is performed using the Dobessi fourth-order wavelet basis to reconstruct the denoised luminance component from the processed high-frequency coefficients and the unchanged low-frequency approximation coefficients.

[0026] Next, contrast-constrained adaptive histogram equalization is performed on the denoised luminance component. The denoised luminance component is divided into an 8x8 rectangular grid, with each grid representing a local block. For each local block, its gray-level histogram is calculated, and the frequency corresponding to each gray level in the histogram is clipped to no more than 2% of the total number of pixels. The clipped pixels are then evenly redistributed across all gray levels to obtain the constrained histogram. Based on the constrained histogram, the cumulative distribution function of each local block is calculated, and the gray-level mapping value of each pixel is obtained through bilinear interpolation, outputting the equalized luminance component.

[0027] Then, bilateral filtering is performed on the equalized luminance component. The filter window diameter is set to 9, the spatial distance standard deviation to 75, and the pixel difference standard deviation to 75. For the center pixel of the window, each neighboring pixel within the window is traversed, and the spatial distance and pixel difference between the neighboring pixel and the center pixel are calculated respectively. The square of the spatial distance is divided by twice the square of the spatial distance standard deviation, and the result is taken with a negative exponent to obtain the spatial weight. The square of the pixel difference is divided by twice the square of the pixel difference standard deviation, and the result is taken with a negative exponent to obtain the pixel weight. The spatial weight and pixel weight are multiplied together to obtain the overall weight. The pixel values ​​of all neighboring pixels are multiplied by their respective overall weights, summed, and then divided by the sum of the overall weights to obtain the filtered output value of the center pixel. This process is repeated for all pixels to obtain the bilateral filtering result.

[0028] Finally, median filtering is performed on the bilateral filtering result. A 3x3 sliding window is used to traverse the entire image. For each window, the grayscale values ​​of the nine pixels within the window are collected, sorted in ascending order, and the fifth value (the median) is taken as the output value of the center pixel of the window. After traversal, the enhanced luminance component is obtained. The enhanced luminance component is then merged with the two chrominance components that remained unchanged in step S2, and the image is reconstructed back to the red-green-blue color space following the reverse process of the aforementioned conversion formula, resulting in the final enhanced image.

[0029] In S3, pixel-level annotations are performed on the cyanobacteria regions in the enhanced image to generate mask labels. Frame-by-frame images collected under different weather conditions are then used for data augmentation to form a training image set, specifically including: First, for each frame-by-frame image captured under different weather conditions, the mean brightness of the entire image and the variance of local contrast are extracted to construct a weather feature vector for that frame-by-frame image. The mean brightness of the entire image is calculated as follows: the frame-by-frame image is converted to a luminance-chrominance color space, the luminance component is extracted, the luminance values ​​of all pixels are summed, and then divided by the total number of pixels to obtain the mean brightness of the entire image. The variance of local contrast is calculated as follows: the frame-by-frame image is divided into multiple non-overlapping 16-pixel multi-pixel local blocks. For each local block, the variance of the grayscale values ​​of all pixels within the block is calculated, and then the average of the variances of all local blocks is taken to obtain the local contrast variance. The mean brightness of the entire image, the variance of local contrast, and the skewness of the grayscale distribution of the frame-by-frame image are arranged in order to form a three-dimensional weather feature vector. The skewness is calculated as follows: the sum of the cubes of the differences between the grayscale values ​​of all pixels and the mean brightness of the entire image is calculated, divided by the total number of pixels, and then divided by the cube of the standard deviation of the grayscale values.

[0030] Next, the weather feature vector is converted into control points for a brightness adjustment curve, used to apply brightness offset pixel-by-pixel to the enhanced image. The specific conversion process is as follows: the average brightness of the entire image is extracted from the weather feature vector as the ordinate of the starting point; the local contrast variance is extracted as the ordinate of the intermediate point; and the skewness is extracted as the ordinate of the ending point. The x-coordinates of the starting point, intermediate point, and ending point are set to 0, 0.5, and 1, respectively. A piecewise linear curve is determined using these three control points. The horizontal axis of this curve represents the normalized brightness value of the original pixels in the enhanced image, ranging from 0 to 1, while the vertical axis represents the amount of brightness offset to be applied. The piecewise linear curve is determined as follows: within the x-coordinate interval of 0 to 0.5, the starting point and intermediate point are connected by a straight line segment; within the x-coordinate interval of 0.5 to 1, the intermediate point and ending point are connected by another straight line segment.

[0031] Next, each pixel in the enhanced image is traversed, and the values ​​of its three channels in the red, green, and blue color space are read. The brightness value is calculated by weighted summation, where the weights for the red, green, and blue channels are 0.2126, 0.7152, and 0.0722, respectively, to obtain a normalized brightness value between 0 and 1. This normalized brightness value is then used as the x-axis input to the piecewise linear curve to determine whether it belongs to the 0-0.5 or 0.5-1 interval. The y-axis value is calculated using the linear interpolation formula for the corresponding line segment. The linear interpolation method is as follows: the difference between the x-coordinates of the two endpoints of the interval is divided by the interval length to obtain a ratio. This ratio is then added to the y-coordinate of the left endpoint and multiplied by the difference between the y-coordinates of the left and right endpoints to obtain an offset. This offset is accumulated and added to the pixel's original brightness value to obtain a temporary brightness value. The temporary brightness value is clipped at the boundary. If it is less than 0, it is set to 0; if it is greater than 1, it is set to 1. The clipped brightness value is used as the new brightness value of the pixel, and the values ​​of each channel are redistributed according to the original ratio of the red, green and blue channels to obtain a brightness perturbation image.

[0032] Then, the brightness perturbation image and the original augmented image are linearly fused using random weights. The random weights are uniformly random numbers between 0 and 1. The fusion method is as follows: for each pixel, the pixel value of the brightness perturbation image is multiplied by the random weight, and then the pixel value of the original augmented image is multiplied by (1 minus the random weight) to obtain the fused pixel value. Gaussian noise perturbation is added to the fusion result. The mean of the Gaussian noise is 0, and the standard deviation is 0.02. The randomly generated Gaussian noise value is superimposed on each channel of each pixel, and then boundary cropping is performed to keep the pixel value within the range of 0 to 1, finally obtaining the augmented image.

[0033] Finally, the augmented images, along with their corresponding mask labels, are added to the training image set. The mask labels are binary images generated by pixel-level annotation on the augmented images, where pixel values ​​in the cyanobacteria region are labeled as 1, and pixel values ​​in the background region are labeled as 0. Each generated augmented image retains the same mask label as the original augmented image, forming a pair of training samples. This process is repeated for all frame-by-frame images under different weather conditions, and all generated augmented images and their mask labels are merged with the original augmented images and labels to form the final training image set.

[0034] In S4, based on the training image set, the weighted fusion amount of the local gray-level range and the entropy of the neighborhood gray-level co-occurrence matrix of each pixel is calculated and defined as the cyanobacteria texture aggregation index. An iterative morphological driving rule with the cyanobacteria texture aggregation index as the independent variable is constructed. The iterative morphological driving rule alternately performs structuring element expansion and edge contraction. After each iteration, the overlap rate of the cyanobacteria regions in the previous and subsequent iterations is calculated. The iteration stops when the overlap rate exceeds a preset convergence threshold, resulting in a stable spatial mapping rule, which specifically includes: For each enhanced image in the training image set, the cyanobacteria texture aggregation index is calculated pixel by pixel. A 3-pixel multiplied neighborhood window is taken centered on the current pixel. First, the local grayscale range within this window is calculated: traverse the grayscale values ​​of the 9 pixels within the window, find the maximum and minimum values, and calculate the difference between them; this difference is the local grayscale range.

[0035] Secondly, the gray-level co-occurrence matrix is ​​calculated within the same window. The direction is set to 0 degrees (i.e., horizontal to the right), and the pixel spacing is 1. The specific calculation method is as follows: traverse each pair of pixels within the window that meets the spacing condition, setting the gray value of the left pixel to be the first gray value and the gray value of the right pixel to be the second gray value. Increment the elements in the corresponding row and column of the gray-level co-occurrence matrix by 1. Since the gray value range within a 3x3 window is 0 to 255, to reduce computation, the gray values ​​are compressed to 16 levels. That is, the gray value of each pixel is divided by 16 and rounded down, making the gray level range 0 to 15. Therefore, the size of the gray-level co-occurrence matrix is ​​16x16. After the calculation is complete, each element in the matrix is ​​divided by the sum of all elements to obtain the normalized gray-level co-occurrence matrix. The entropy value is calculated based on this normalized matrix, and the mathematical formula is as follows: ; in, This represents the entropy value of the neighborhood gray-level co-occurrence matrix. and These represent the normalized row and column gray levels, respectively, and their values ​​are integers ranging from 0 to 15. Represents the th element in the normalized gray-level co-occurrence matrix. line, number The element values ​​of the column, i.e., gray level pairs The probability of occurrence. When When it is 0, it is stipulated that The value is 0. During calculation, for each pair... Find Logarithm to base 2, multiplied by Then take the negative value, and finally sum all the 16 x 16 results to get the entropy value. .

[0036] Then, the local gray-level range and the entropy value of the neighborhood gray-level co-occurrence matrix are weighted and fused. The weight of the local gray-level range is set to 0.6, and the weight of the entropy value is set to 0.4. The mathematical formula for calculating the cyanobacteria texture aggregation index is as follows: ; in, Indicates the cohesion index of cyanobacteria texture. Indicates local grayscale extreme difference. This represents the entropy value of the neighborhood gray-level co-occurrence matrix. The higher the index, the greater the probability that the pixel belongs to the cyanobacteria region. The cyanobacteria texture aggregation index is obtained by traversing all pixels in the entire image.

[0037] Based on the cyanobacteria texture aggregation index of all pixels in the training image set, the image is first binarized using an initial threshold to obtain the initial cyanobacteria region. The initial threshold is calculated using Otsu's method: iterating through all possible grayscale thresholds from 0 to 255, the inter-class variance between the foreground and background is calculated for each threshold, and the threshold corresponding to the largest inter-class variance is taken as the initial threshold. Pixels with a cyanobacteria texture aggregation index greater than or equal to this threshold are marked as foreground, and pixels with a value less than this threshold are marked as background, thus forming the initial cyanobacteria region.

[0038] Then, an iterative morphologically driven rule is constructed to alternately perform structuring element expansion and edge contraction. The first iteration uses the initial cyanobacteria region as the current cyanobacteria region. A morphological dilation operation is performed: a disk-shaped structuring element with a radius of 3 is used. This structuring element is a circular mask with a diameter of 7 pixels, where the center pixel and pixels within 3 pixels of the center are set to 1, and the rest to 0. The structuring element is slid across the image. Whenever at least one pixel within the area covered by the structuring element belongs to the current cyanobacteria region, the output pixel corresponding to the center of the structuring element is marked as the expanded cyanobacteria pixel. After traversing all pixels, the expanded temporary region is obtained.

[0039] Next, a morphological erosion operation is performed: a disk-shaped structuring element with a radius of 2 (i.e., a circular mask with a diameter of 5 pixels) is used. The structuring element is slid across the image, and the output pixel corresponding to the center of the structuring element is marked as the eroded cyanobacteria pixel only when all pixels covered by the structuring element belong to the temporary region. After traversing all pixels, the updated region after edge shrinkage is obtained.

[0040] Calculate the overlap rate between the updated region and the original cyanobacteria region: count the number of pixels in the updated region that belong to the original cyanobacteria region, divide this number by the total number of pixels in the updated region to obtain the overlap rate. The overlap rate is expressed as a percentage.

[0041] The calculated overlap rate is compared with a preset convergence threshold, which is set to 95%. If the overlap rate is less than 95%, the updated region is taken as the new current cyanobacteria region, and the above morphological dilation, erosion, and overlap rate calculation process is repeated. If the overlap rate is greater than or equal to 95%, the iteration stops, and the current updated region is taken as the output of the stable spatial mapping rule. This output is essentially a binary mask, where a pixel value of 1 represents the cyanobacteria region, and a pixel value of 0 represents the background region. This stable spatial mapping rule is a spatial mapping relationship from the input image to the output binary mask, and this rule can be directly applied to process the image to be recognized in subsequent step S5.

[0042] In S5, the real-time monitoring image of the drone to be identified is input into a stable spatial mapping rule. The cyanobacteria texture aggregation index of each pixel is calculated. The pixel's affiliation is determined based on the index threshold at the time of iterative convergence. The binary segmentation result of the cyanobacteria region is output. Then, the number of pixels in the cyanobacteria region is counted and converted into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the drone platform. Specifically, this includes: First, for each pixel in the real-time monitoring image of the drone to be identified, its cyanobacteria texture aggregation index is calculated according to the method described in step S4. Specifically, a 3-pixel multiplied window is taken with the current pixel as the center, and the difference between the maximum and minimum gray values ​​within the window is calculated to obtain the local gray-level range; within the same window, the gray-level co-occurrence matrix with a zero-degree direction and a pixel spacing of 1 is statistically analyzed and the entropy value is calculated to obtain the neighborhood gray-level co-occurrence matrix entropy value; the local gray-level range is multiplied by a weight of 0.6, the entropy value is multiplied by a weight of 0.4, and the sum is obtained to obtain the cyanobacteria texture aggregation index of the pixel.

[0043] Then, the calculated cyanobacteria texture aggregation index is compared with the exponential threshold at the time of iterative convergence. This exponential threshold is statistically obtained from the finally stable cyanobacteria region during the convergence of the iterative morphology-driven rule in step S4: the minimum value of the cyanobacteria texture aggregation index of all pixels in the final cyanobacteria region is taken as the exponential threshold. If the cyanobacteria texture aggregation index of the current pixel is greater than or equal to the exponential threshold, the pixel is marked as a candidate cyanobacteria pixel; if it is less than the exponential threshold, it is marked as a background pixel.

[0044] Secondly, four-connected component labeling is performed on all candidate cyanobacteria pixels. The specific process of four-connected component labeling is as follows: traverse the image from top to bottom and from left to right. When an unlabeled candidate cyanobacteria pixel is encountered, it is assigned a new connected component number. Then, check the two neighboring pixels above and to the left of this pixel (directions already scanned in the four-connected direction). If a candidate cyanobacteria pixel exists, merge the current pixel's number with the neighboring pixel's number into the same number; simultaneously, a disjoint-set data structure algorithm is used to record the equivalence relationships between the numbers. After scanning is complete, equivalent numbers are merged to ensure that each connected component has a unique number. The number of pixels contained in each connected component is counted.

[0045] Next, the number of pixels in each connected component is compared with a preset minimum area threshold. The minimum area threshold is set to 50 pixels, which is determined empirically based on the minimum number of pixels a single cyanobacterial flocculent occupies in an image when the drone is flying at an altitude of 120 meters and the image resolution is 1920 pixels by 1080 pixels. If the number of pixels in a connected component is less than 50, the connected component is determined to be a noise region and is removed; if the number of pixels in a connected component is greater than or equal to 50, all pixels in the connected component are retained as the final cyanobacterial pixels.

[0046] Finally, the values ​​of the final cyanobacteria pixels are assigned to 1, and the values ​​of the background pixels are assigned to 0, generating a binary segmentation image with the same resolution as the original image. The regions with values ​​of 1 in this image are the precisely segmented cyanobacteria-covered areas.

[0047] First, two key parameters are read from the flight log of the unmanned aerial vehicle platform: relative flight altitude and camera focal length. Relative flight altitude refers to the vertical distance between the drone and the surface of the target water area at the time of shooting, which is set to 120 meters in this embodiment; camera focal length refers to the actual focal length of the visible light camera lens, and the DJI Matrice 4TD drone used in this embodiment has a camera focal length of 8.25 mm.

[0048] Secondly, based on the relative flight altitude, camera focal length, and the physical size of a single pixel on the image sensor, the actual side length corresponding to a single pixel on the ground is determined. The physical size of a single pixel on the image sensor refers to the physical length of each photosensitive unit on the sensor; in this embodiment, this value is 0.00345 mm. The ground sampling distance is calculated as follows: divide the relative flight altitude by the camera focal length to obtain the optical magnification; multiply this magnification by the physical size of the single pixel to obtain the actual side length corresponding to a single pixel on the ground, in millimeters; then convert the millimeters to centimeters by dividing by 10. Specifically, the relative flight altitude of 120 meters is first converted to 120,000 millimeters, divided by the focal length of 8.25 millimeters to obtain approximately 14,545.45 times; this magnification is multiplied by the physical size of the single pixel of 0.00345 millimeters to obtain approximately 50.18 millimeters, or approximately 5.018 centimeters. Therefore, the actual area corresponding to a single pixel is equal to the square of the actual side length, approximately 25.18 square centimeters.

[0049] Next, count the total number of pixels contained in the cyanobacteria region with a pixel value of 1 in the binary segmentation result image. Iterate through every pixel in the entire image, accumulating the number of pixels with a pixel value of 1 to obtain the total number of cyanobacteria pixels. Multiply this total number of pixels by the actual area corresponding to a single pixel to obtain the initial coverage area. For example, if the total number of cyanobacteria pixels is 10,000, then the initial coverage area is 10,000 multiplied by 25.18 square centimeters, which is 251,800 square centimeters. To convert this to square meters, divide by 10,000 to obtain 25.18 square meters.

[0050] Finally, the initial coverage area is corrected based on the distortion coefficients of the central and edge regions of the camera lens's vertical projection. The distortion coefficients are obtained beforehand through camera calibration; in this embodiment, a checkerboard calibration method is used to obtain a radial distortion coefficient of -0.15. The correction method is as follows: The normalized radius of each pixel's distance from the image center point in the binary segmentation result is calculated, and the average distortion weight of all cyanobacteria pixels is calculated, where the distortion weight of each pixel is equal to 1 plus the distortion coefficient multiplied by the square of the normalized radius. The initial coverage area is divided by this average distortion weight to obtain the corrected actual cyanobacteria coverage area in the water. The corrected area value is output in square meters, rounded to two decimal places.

[0051] Please see Figure 2 As shown, a smart identification system for cyanobacteria-rich waters based on UAV vision includes: The image acquisition and frame extraction module uses a visible light camera mounted on an unmanned aerial vehicle platform to vertically capture images of the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image. The brightness enhancement and reconstruction module converts the original monitoring image to the YCbCr color space, separates the brightness component and the chromaticity component, and performs wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the brightness component in sequence. The processed brightness component and chromaticity component are then merged and reconstructed into an enhanced image. The annotation and augmentation module performs pixel-level annotation on the cyanobacteria region in the enhanced image, generates mask labels, and introduces frame-by-frame images collected under different weather conditions for data augmentation to form a training image set. The spatial mapping rule generation module, based on the training image set, calculates the weighted fusion amount of the local gray-level range of each pixel and the entropy of the neighborhood gray-level co-occurrence matrix, which is defined as the cyanobacteria texture aggregation index. It constructs an iterative morphology-driven rule with the cyanobacteria texture aggregation index as the independent variable. The iterative morphology-driven rule alternately performs structuring element expansion and edge contraction. After each iteration, the overlap rate of the two cyanobacteria regions is calculated. When the overlap rate exceeds the preset convergence threshold, the iteration stops, and a stable spatial mapping rule is obtained. The segmentation and area conversion module inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform.

[0052] The working principle of this invention is as follows: A visible light camera mounted on an unmanned aerial vehicle (UAV) vertically captures images of the target water area, and the continuous video stream is processed by frame extraction to obtain the original monitoring image. The original monitoring image is converted to the YCbCr color space, and its luminance component is sequentially processed by wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing, and median filtering before being merged with the chrominance component to reconstruct an enhanced image. Pixel-level annotations are applied to the cyanobacteria regions in the enhanced image to generate mask labels, and frame-extracted images under different weather conditions are introduced for data augmentation to form a training image set. Based on the training image set, local distortion of each pixel is calculated. The weighted fusion of grayscale range and neighborhood grayscale co-occurrence matrix entropy is used as the cyanobacteria texture aggregation index. An iterative morphology-driven rule with this index as the independent variable is constructed. Structural element expansion and edge contraction are performed alternately, and the overlap rate is calculated until the overlap rate exceeds the preset convergence threshold, at which point the iteration stops, resulting in a stable spatial mapping rule. Finally, the real-time monitoring image of the UAV to be identified is input into the spatial mapping rule, the cyanobacteria texture aggregation index of each pixel is calculated and compared with the index threshold at the time of iteration convergence, and the binary segmentation result of the cyanobacteria region is output after connected component denoising. Then, the cyanobacteria coverage area in the actual water area is converted by combining flight parameters.

[0053] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A method for intelligent identification of cyanobacteria water area based on unmanned aerial vehicle vision, characterized in that, Includes the following steps: S1 uses an unmanned aerial vehicle platform equipped with a visible light camera to vertically photograph the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image; S2, convert the original monitoring image to the YCbCr color space, separate the luminance component and chrominance component, and perform wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the luminance component in sequence. Then, merge the processed luminance component and chrominance component to reconstruct the enhanced image. S3, pixel-level annotation of the cyanobacteria region in the enhanced image, generating mask labels, and introducing frame-by-frame images collected under different weather conditions for data augmentation to form a training image set, specifically including: extracting the mean brightness of the whole image and the local contrast variance of each frame-by-frame image, and constructing the weather feature vector of the frame-by-frame image. The weather feature vector is converted into control points of the brightness adjustment curve, and a brightness offset based on the brightness adjustment curve is applied to the enhanced image pixel by pixel to generate a brightness perturbation image; The brightness-perturbed image and the original enhanced image are linearly fused according to random weights, and Gaussian noise perturbation is added to the fusion result to obtain the augmented image; The augmented image, along with its corresponding mask label, is added to the training image set. S4, based on the training image set, calculates the weighted fusion amount of the local gray-level range and the entropy of the neighborhood gray-level co-occurrence matrix of each pixel, defined as the cyanobacteria texture cohesion index. An iterative morphological driving rule is constructed with the cyanobacteria texture cohesion index as the independent variable. The iterative morphological driving rule alternately performs structuring element expansion and edge contraction. After each iteration, the overlap rate of the two cyanobacteria regions is calculated. When the overlap rate exceeds a preset convergence threshold, the iteration stops, resulting in a stable spatial mapping rule. Specifically, S4 includes: based on the cyanobacteria texture cohesion index of all pixels in the training image set, firstly, the image is binarized using an initial threshold to obtain the initial cyanobacteria region. The initial threshold is calculated using Otsu's method: traversing all possible gray-level thresholds from 0 to 255, calculating the inter-class variance between the foreground and background at each threshold, and taking the threshold corresponding to the maximum inter-class variance as the initial threshold. Pixels with a cyanobacteria texture cohesion index greater than or equal to this threshold are marked as foreground, and pixels less than this threshold are marked as background, forming the initial cyanobacteria region; then, an iterative morphological driving rule is constructed, alternately performing structuring element expansion and edge contraction; the first iteration uses the initial cyanobacteria region as the current cyanobacteria region. S5 inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform. The index threshold is obtained from the final stable cyanobacteria region when the morphology-driven rule converges in S4: the minimum value of the cyanobacteria texture aggregation index of all pixels in the final cyanobacteria region is taken as the index threshold.

2. The cyanobacteria water area intelligent identification method based on unmanned aerial vehicle vision according to claim 1, characterized in that, S1 specifically includes: Extract two adjacent frames sequentially from a continuous video stream, calculate the local binary pattern histogram of each frame, and obtain their chi-square distance. The chi-square distance is compared with the preset frame extraction sensitivity threshold. If the chi-square distance is greater than the frame extraction sensitivity threshold, the current frame is determined to be a key frame of scene change and is retained. At the same time, the current frame replaces the previous frame as a new comparison benchmark. For continuously retained keyframes, the structural similarity between two adjacent keyframes is calculated. If the similarity is greater than the redundancy removal threshold, the next keyframe is deleted. Finally, the retained keyframes are output as the original monitoring images.

3. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, S2 specifically includes: The brightness component is decomposed into two-level discrete wavelet decomposition using the Dobes fourth-order wavelet basis. The high-frequency coefficients obtained are then subjected to soft thresholding by multiplying the mean of the absolute values ​​of the corresponding layer coefficients by 0.8 as the threshold. The denoised brightness component is then reconstructed by inverse wavelet transform. The luminance component of the noise reduction is subject to contrast amplitude limiting, the histogram clipping threshold is set to 2%, the grid is divided into 8 by 8 blocks, and histogram equalization is performed on each block. Bilateral filtering is applied to the equalization results, with both the standard deviation of spatial distance and the standard deviation of pixel difference set to 75, and the filter window diameter being 9. The bilateral filtering results are sorted by median using a 3x3 sliding window, and the median value is output to obtain the enhanced luminance component.

4. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, The generation of the brightness perturbation image specifically includes: The three components of brightness mean, contrast variance and skewness are extracted from the weather feature vector and used as the ordinates of the starting point, middle point and ending point of the brightness adjustment curve, respectively. The abscissas of each point are evenly distributed according to 0, 0.5 and 1. A piecewise linear curve is defined by three control points. The horizontal axis of the piecewise linear curve represents the original pixel value, and the vertical axis represents the brightness offset. Iterate through each pixel of the enhanced image, read the normalized brightness value of the pixel, obtain the corresponding offset through linear interpolation on the piecewise linear curve, and add the offset to the original pixel value. The accumulated pixel values ​​are cropped to keep them within the range of 0 to 1, resulting in a brightness perturbation image.

5. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, The calculation process for the cyanobacteria texture aggregation index is as follows: Take a 3x3 window centered on the current pixel, calculate the difference between the maximum and minimum gray values ​​within the window, and obtain the local gray range. Within the same window, the gray-level co-occurrence matrix with zero-degree direction and pixel spacing of one is counted, and the entropy value is calculated based on the gray-level co-occurrence matrix to obtain the entropy value of the neighborhood gray-level co-occurrence matrix; The local gray-level range is multiplied by a weight of 0.6, and the entropy value of the neighborhood gray-level co-occurrence matrix is ​​multiplied by a weight of 0.

4. The summation yields the cyanobacteria texture aggregation index.

6. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, The process of obtaining the spatial mapping rules is as follows: Taking the current cyanobacteria region as the processing object, a morphological expansion operation is performed using a disk-shaped structural element with a radius of three, and the expanded region is used as a temporary region. A morphological erosion operation is performed on the temporary region using a disk-shaped structuring element with a radius of two to obtain the updated region after edge shrinkage; Calculate the number of pixels that overlap between the updated region and the original cyanobacteria region, and divide it by the total number of pixels in the updated region to obtain the overlap rate. The overlap rate is compared with a preset 95% convergence threshold. If it is less than the convergence threshold, the morphological dilation operation is repeated until the overlap rate calculation process is completed. Otherwise, the iteration is stopped and the current updated region is output as the output result of the stable spatial mapping rule.

7. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, The binary segmentation result specifically includes: The cohesion index of the blue algae texture of each pixel is compared with the exponential threshold at the time of iterative convergence. If the cohesion index of the blue algae texture is greater than or equal to the exponential threshold, the corresponding pixel is marked as a candidate blue algae pixel; otherwise, it is marked as a background pixel. Perform four-connected component labeling on all candidate cyanobacteria pixels and count the number of pixels contained in each connected component; Connected regions with fewer pixels than a preset minimum area threshold are identified as noise regions and removed, while pixels in the remaining connected regions are retained as the final blue-green algae pixels. The final cyanobacteria pixels are assigned a value of 1, and the background pixels are assigned a value of 0, generating a binary segmentation result.

8. The intelligent identification method for cyanobacteria-rich waters based on UAV vision according to claim 1, characterized in that, The method of counting the number of pixels in the cyanobacteria region and converting it into the actual cyanobacteria coverage area in the water by combining the flight parameters of the unmanned aerial vehicle platform specifically includes: Read the relative flight altitude and camera focal length values ​​from the flight log of the unmanned aerial vehicle platform; Based on the relative flight altitude, camera focal length, and the physical size of a single pixel in the image sensor, the actual side length of a single pixel on the ground is determined, and thus the actual area corresponding to a single pixel is obtained. The total number of pixels contained in the cyanobacteria region with a pixel value of one in the binary segmentation result is counted. The total number of pixels is multiplied by the actual area corresponding to a single pixel to obtain the initial coverage area. The initial coverage area is corrected based on the distortion coefficients of the central and edge regions of the camera lens's vertical projection, and the corrected actual cyanobacteria coverage area in the water is output.

9. A smart identification system for cyanobacteria-rich waters based on UAV vision, characterized in that, A method for intelligent identification of cyanobacteria-rich waters based on UAV vision, as described in any one of claims 1-8, includes: The image acquisition and frame extraction module uses a visible light camera mounted on an unmanned aerial vehicle platform to vertically capture images of the target water area and performs frame extraction processing on the acquired continuous video stream to obtain the original monitoring image. The brightness enhancement and reconstruction module converts the original monitoring image to the YCbCr color space, separates the brightness component and the chromaticity component, and performs wavelet transform noise reduction, contrast-limited adaptive histogram equalization, bilateral filtering smoothing and median filtering on the brightness component in sequence. The processed brightness component and chromaticity component are then merged and reconstructed into an enhanced image. The annotation and augmentation module performs pixel-level annotation on the cyanobacteria region in the enhanced image, generates mask labels, and introduces frame-by-frame images collected under different weather conditions for data augmentation to form a training image set. Specifically, it includes: extracting the mean brightness of the whole image and the local contrast variance of each frame-by-frame image, and constructing the weather feature vector of the frame-by-frame image. The weather feature vector is converted into control points of the brightness adjustment curve, and a brightness offset based on the brightness adjustment curve is applied to the enhanced image pixel by pixel to generate a brightness perturbation image; The brightness-perturbed image and the original enhanced image are linearly fused according to random weights, and Gaussian noise perturbation is added to the fusion result to obtain the augmented image; The augmented image, along with its corresponding mask label, is added to the training image set. The spatial mapping rule generation module, based on the training image set, calculates the weighted fusion amount of the local gray-level range and the entropy of the neighborhood gray-level co-occurrence matrix of each pixel, defined as the cyanobacteria texture cohesion index. Iterative morphological driving rules are constructed with the cyanobacteria texture cohesion index as the independent variable. These rules alternately perform structuring element expansion and edge contraction. After each iteration, the overlap rate between the two cyanobacteria regions is calculated. Iteration stops when the overlap rate exceeds a preset convergence threshold, resulting in a stable spatial mapping rule. Specifically, based on the cyanobacteria texture cohesion index of all pixels in the training image set, the image is first binarized using an initial threshold to obtain the initial cyanobacteria region. The initial threshold is calculated using Otsu's method: traversing all possible gray-level thresholds from 0 to 255, the inter-class variance between the foreground and background is calculated for each threshold. The threshold corresponding to the maximum inter-class variance is taken as the initial threshold. Pixels with a cyanobacteria texture cohesion index greater than or equal to this threshold are marked as foreground, and pixels with an index less than this threshold are marked as background, forming the initial cyanobacteria region. Then, iterative morphological driving rules are constructed, alternately performing structuring element expansion and edge contraction. The first iteration uses the initial cyanobacteria region as the current cyanobacteria region. The segmentation and area conversion module inputs the real-time monitoring image of the UAV to be identified into a stable spatial mapping rule, calculates the cyanobacteria texture aggregation index of each pixel, determines the pixel's affiliation based on the index threshold at the time of iterative convergence, outputs the binary segmentation result of the cyanobacteria region, and then counts the number of pixels in the cyanobacteria region and converts it into the actual cyanobacteria coverage area in the water area by combining the flight parameters of the UAV platform. The index threshold is obtained from the final stable cyanobacteria region when the iterative morphology-driven rule converges in the spatial mapping rule generation module: the minimum value of the cyanobacteria texture aggregation index of all pixels in the final cyanobacteria region is taken as the index threshold.

Citation Information

Patent Citations

  • Underwater image enhancement method based on brightness and chrominance separation

    CN105205792A

  • Micro-operation-based object segmentation method based on improved Otsu and edge operators

    US20260100018A1