Crab pond water grass proportion calculation method and system based on image processing technology and storage medium

By using K-means clustering and HSV color space in image processing technology, the proportion of aquatic plants in crab ponds is automatically calculated, which solves the problems of low efficiency, large error and high cost in the existing technology, and realizes fast and accurate monitoring of the proportion of aquatic plants, adapting to complex environmental changes.

CN123160884APending Publication Date: 2026-11-24SHANGHAI OCEAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611364819.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies are inefficient, prone to errors, costly, and lack adaptability when calculating the proportion of aquatic plants in crab ponds, and cannot meet the real-time monitoring needs of large-scale aquaculture scenarios.

Method used

The method employs image processing technology, automatically selecting the K value through K-means clustering and elbow rule, using HSV color space and Gaussian filtering for noise reduction, identifying aquatic plant clusters and calculating their proportions. The systematic process includes image acquisition, preprocessing, clustering and segmentation, and proportion calculation.

Benefits of technology

It achieves fast, accurate, and adaptive calculation of the proportion of aquatic plants, with a single image processing time of less than 30 seconds and an error of less than 5%. It adapts to changes in light and water quality, reduces labor and hardware costs, and is easy for small and medium-sized aquaculture enterprises to use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160884A_ABST
    Figure CN123160884A_ABST
Patent Text Reader

Abstract

This invention belongs to the technical field of calculating the proportion of aquatic plants in crab ponds, and discloses a method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology. The method includes: acquiring a top-down view image of the crab pond; preprocessing the image to obtain an image to be segmented; determining the optimal K value for K-means clustering using the elbow rule; performing K-means clustering on the image to be segmented according to the optimal K value to obtain K pixel clusters; calculating the HSV mean of each pixel cluster in the HSV color space, and labeling clusters that satisfy H component 30°~90°, S≥20%, and V≥10% as aquatic plant clusters; counting the number of pixels in the aquatic plant clusters and calculating their proportion in the total number of pixels in the image. This invention automatically selects K through K-means adaptive clustering and the elbow rule, eliminating the need for manual annotation and sample training. It can adapt to complex environments such as changes in light intensity and differences in aquatic plant species, and has the advantages of high processing efficiency, low error, low deployment cost, and convenient operation. It is suitable for rapid and automatic monitoring of the proportion of aquatic plants in large-scale crab ponds.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aquatic plant ratio calculation technology in crab ponds, and particularly to a method, system, and storage medium for calculating the aquatic plant ratio in crab ponds based on image processing technology. Background Technology

[0002] In aquaculture, especially in crab farming, the growth status of aquatic plants in crab ponds directly affects the crabs' habitat, foraging, and water quality regulation. Therefore, the percentage of aquatic plant coverage on the surface of crab pond water (hereinafter referred to as "aquatic plant percentage") is one of the core indicators for assessing the health of the crab pond's ecological environment. Accurately and efficiently obtaining this indicator is of great significance for guiding aquaculture production.

[0003] Currently, the main technical solutions used in the industry to calculate the proportion of aquatic plants in crab ponds are as follows:

[0004] The first method is manual monitoring and labeling. This method relies mainly on manual operation. One approach involves on-site visual estimation by aquaculture workers, or using simple tools such as measuring ropes and poles to divide the crab pond into areas and measure the area of ​​aquatic plants one by one, finally summarizing and calculating the proportion. Another improved method is to use drones to collect aerial images of the crab pond, and then manually use image labeling tools (such as LabelImg) to delineate "aquatic plant areas" and "non-aquatic plant areas" on the images frame by frame. Finally, a programming tool is used to count the number of pixels in the labeled aquatic plant areas and the total number of pixels in the image, thereby calculating the proportion of aquatic plants.

[0005] The second method is the fixed threshold segmentation method. This approach first uses drone aerial photography to obtain an aerial view of the crab pond, and then preprocesses the image, including noise reduction and color space conversion (e.g., converting RGB to HSV color space). Subsequently, based on experience or small-sample testing, a fixed color threshold is manually set (e.g., setting a specific range of values ​​for the H, S, and V components). During image segmentation, all pixels that meet this fixed threshold are classified as "aquatic plant pixels," and the rest are classified as "non-aquatic plant pixels." Finally, the proportion is calculated by counting the number of aquatic plant pixels.

[0006] The third approach is a classification method based on traditional machine learning. This method first requires collecting a large number of "aquatic plant pixel samples" and "non-aquatic plant pixel samples" under different crab ponds and lighting conditions, and extracting their color features to construct a dataset. Next, machine learning algorithms such as Support Vector Machines (SVM) are used to train this dataset, resulting in a classification model capable of distinguishing between aquatic plant and non-aquatic plant pixels. In application, each pixel in the crab pond image to be processed is input into this model for classification, and finally, the number of pixels identified as "aquatic plant pixels" is counted and their proportion is calculated.

[0007] However, the aforementioned existing technologies all have obvious drawbacks in practical applications:

[0008] The first method of manual monitoring and labeling suffers from problems such as extremely low efficiency, strong subjectivity leading to large errors in results, and high labor costs, and cannot meet the real-time monitoring needs of large-scale breeding scenarios.

[0009] The second fixed threshold segmentation method has poor adaptability. Its fixed segmentation threshold is easily affected by environmental factors such as changes in light intensity, differences in aquatic plant species, and fluctuations in water quality, resulting in unstable segmentation accuracy. Furthermore, the threshold needs to be manually readjusted after each environmental change, making the operation complex.

[0010] The third type of classification method based on traditional machine learning has problems such as high sample dependence, huge preparation costs, high threshold for model deployment, and poor real-time performance, making it difficult for small and medium-sized aquaculture entities to apply and unable to meet the real-time requirements of dynamic monitoring.

[0011] Therefore, how to provide a technical solution that can quickly, accurately, and adaptively calculate the proportion of aquatic plants in crab ponds, and is convenient to deploy and low in cost, is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0012] This invention provides a method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology. It aims to solve the problems of low efficiency of manual annotation, poor adaptability of fixed thresholds, and the difficulty of deployment of traditional machine learning due to its reliance on samples, thereby achieving efficient, accurate, and adaptive automatic calculation of the proportion of aquatic plants.

[0013] To achieve the above objectives, the present invention adopts the following technical solution:

[0014] In a first aspect, the present invention provides a method for calculating the proportion of aquatic plants in crab ponds based on image processing technology, comprising the following steps:

[0015] Step S1: Collect an overhead view image of the crab pond;

[0016] Step S2: Preprocess the top view image to obtain the image to be segmented;

[0017] Step S3: Use the elbow rule to determine the optimal K value for K-means clustering segmentation;

[0018] Step S4: Based on the optimal K value, perform K-means clustering on the image to be segmented to obtain K pixel clusters;

[0019] Step S5: Identify and mark the aquatic plant clusters from the K pixel clusters. The identification method is as follows: In the HSV color space, calculate the HSV mean value of each pixel cluster, and mark the pixel clusters that satisfy the following conditions: H component is in the range of 30° to 90°, S component ≥ 20%, and V component ≥ 10% as aquatic plant clusters.

[0020] Step S6: Count the number of pixels of the aquatic plant cluster and calculate its proportion in the total number of pixels in the image, as the aquatic plant proportion.

[0021] As a further description of the above technical solution, the preprocessing in step S2 includes: performing Gaussian filtering noise reduction on the top view image, with a filter size of 5×5 and a standard deviation σ=1.5; converting the noise-reduced image from the RGB color space to the HSV color space to obtain an image to be segmented in which pixels are represented by HSV vectors.

[0022] As a further description of the above technical solution, step S3 uses the elbow rule to determine the optimal K value, specifically including:

[0023] The candidate range for the K value is set to 2 to 8;

[0024] For each candidate K value, perform K-means clustering and compute its in-cluster sum of squares (WCSS).

[0025] Plot the K-value WCSS curve, and determine the K-value at the point where the WCSS rate of decrease in the curve drops sharply as the optimal K-value.

[0026] If the curve does not show a significant sudden decrease, then K=3 is assumed.

[0027] As a further description of the above technical solution, the K-means clustering segmentation in step S4 specifically includes:

[0028] Each pixel in the image to be segmented is represented as an HSV 3D vector as a data point;

[0029] Initialize K cluster centers;

[0030] Iteratively execute the following steps until the convergence condition is met:

[0031] ①Assignment steps: Calculate the Euclidean distance from the HSV vector of each pixel to each cluster center, and assign it to the cluster to which the nearest cluster center belongs;

[0032] ②Update steps: Recalculate the HSV mean of all pixels within each cluster as the new cluster center;

[0033] ③ The convergence condition is: the cluster center moves a distance of less than 1e3, or the maximum number of iterations of 100 is reached.

[0034] As a further description of the above technical solution, the step S1 of acquiring a top-down view image of the crab pond specifically includes:

[0035] Use a drone to take vertical overhead photos of the crab ponds at a height of 50 meters, with each image covering an area of ​​≤5 acres.

[0036] If the crab pond area is greater than 5 mu, multiple photos should be taken under the condition of fixed height accuracy ≤ ±0.5 meters, and then combined into a complete aerial view of the crab pond using an image stitching tool.

[0037] As a further description of the above technical solution, the method also includes a manual verification step:

[0038] ① Save the binary image corresponding to each pixel cluster and the calculated proportion of aquatic plants;

[0039] ② Receive manual selection instructions to determine the final aquatic plant cluster from multiple pixel clusters, or receive manually input K value to repeat steps S4 to S6.

[0040] Secondly, the present invention also provides a rapid calculation system for the proportion of aquatic plants in crab ponds based on image processing technology, used to implement the method described in any of the above-mentioned embodiments, comprising:

[0041] Image acquisition module, used to acquire top-view images of the crab pond;

[0042] The image preprocessing module is used to preprocess the top view image to obtain the image to be segmented;

[0043] The K-value optimization module is used to determine the optimal K-value for K-means clustering splits using the elbow rule.

[0044] The clustering and segmentation module is used to perform K-means clustering on the image to be segmented based on the optimal K value, to obtain K pixel clusters;

[0045] The aquatic plant identification module is used to calculate the HSV mean value of each pixel cluster in the HSV color space, and to mark the pixel clusters that meet the requirements of H component in the range of 30° to 90°, S component ≥20%, and V component ≥10% as aquatic plant clusters;

[0046] The percentage calculation module is used to count the number of pixels of the aquatic plant clusters and calculate their percentage in the total number of pixels in the image, which is the percentage of aquatic plants.

[0047] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for calculating the proportion of aquatic plants in crab ponds based on image processing technology as described in any of the above claims.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] The aforementioned method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology automatically selects K through K-means segmentation combined with the elbow rule, eliminating the need for manual annotation and parameter adjustment. The processing time for a single image is ≤30 seconds, which is 20-30 times faster than manual annotation methods, and can meet the real-time monitoring needs of large-scale crab ponds.

[0050] The aforementioned method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology employs HSV color space conversion to reduce light interference and Kmeans adaptive clustering to dynamically segment the image based on its own features. This effectively addresses complex scenarios such as differences in aquatic plant species and changes in water quality, with a proportion error of ≤5%, which is superior to fixed threshold methods and traditional machine learning methods.

[0051] The aforementioned method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology require no sample training or professional knowledge and can be run on ordinary drones and home computers. This avoids the high sample collection costs and hardware expenses of traditional machine learning methods, making it easy for small and medium-sized aquaculture entities to promote and apply it.

[0052] The method, system, and storage medium for calculating the proportion of aquatic plants in crab ponds based on image processing technology are automated, requiring only final manual confirmation. The elbow rule replaces manual trial and error for finding the K value, and no intervention is needed in the post-processing steps. It also supports manual verification, which improves the fault tolerance and practicality of the method. Attached Figure Description

[0053] Figure 1 This is a flowchart illustrating the method for calculating the proportion of aquatic plants in crab ponds based on image processing technology as described in this invention.

[0054] Figure 2 Aerial view of the crab farming pond;

[0055] Figure 3 This is a graph showing the performance of the k-means algorithm. Detailed Implementation

[0056] 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.

[0057] Example 1

[0058] This embodiment provides a method for calculating the proportion of aquatic plants in crab ponds based on image processing technology. The method flow is as follows: Figure 1 As shown, the specific steps include:

[0059] Step S1: Collect an overhead image of the crab pond.

[0060] A drone was used to take vertical overhead photos of the crab pond to obtain a bird's-eye view covering the entire surface of the pond. To ensure image quality and accuracy in subsequent processing, the following requirements must be met:

[0061] Drone model: Civilian light drone with vertical overhead shooting function, no less than 48 million pixels, and flight time of no less than 20 minutes.

[0062] Shooting height: 50 meters, ensuring that the coverage area of ​​a single image does not exceed 5 mu (approximately 0.33 hectares). If the crab pond area is larger than 5 mu, multiple shots should be taken while maintaining a fixed height accuracy error of ≤ ±0.5 meters, and then combined into a complete aerial view image of the crab pond using an image stitching tool (such as Pix4Dmapper).

[0063] Shooting requirements: Choose a time of day with clear weather and even lighting, and avoid strong reflections or shadows.

[0064] Step S2: Image Preprocessing

[0065] The acquired top-view images are preprocessed to improve the accuracy of subsequent clustering and segmentation. Specifically, this includes:

[0066] Noise reduction: Gaussian filtering algorithm is used to remove noise from the image. The filter size is 5×5 and the standard deviation σ=1.5. In the Python environment, this can be achieved using the `cv2.GaussianBlur(src,(5,5),1.5)` function of the OpenCV library to smooth high-frequency noise caused by drone shaking or water reflection.

[0067] Color space conversion: The denoised image is converted from the RGB color space to the HSV color space to reduce the impact of lighting variations on color features. The HSV space decomposes color into hue (H), saturation (S), and lightness (V), which is more consistent with human color perception. The conversion can be achieved using the function `cv2.cvtColor(src,cv2.COLOR_BGR2HSV)` (OpenCV reads images with BGR as the default channel). After conversion, each pixel is represented by a three-dimensional vector [H,S,V], which serves as the data basis for the image to be segmented.

[0068] Step S3: Determine the optimal K value using the elbow rule.

[0069] The K-means clustering algorithm requires the number of clusters K to be specified in advance. To adaptively determine the optimal value of K, this step introduces the Elbow Method, as follows:

[0070] The candidate range for K value is set to 2 to 8 (covering common crab pond scenarios such as "aquatic plants + water surface" and "aquatic plants + water surface + debris").

[0071] For each candidate K value, perform K-means clustering and calculate its in-cluster sum of squares (WCSS). WCSS is defined as the sum of the squared Euclidean distances from all pixels within a cluster to its cluster center, calculated using the following formula:

[0072]

[0073] Among them, C k For the k-th cluster, μ k x is the center of the k-th cluster. i is the HSV vector of the pixels within the cluster.

[0074] Plot the K-WCSS curve. The K value corresponding to the point where the rate of WCSS decreases sharply (i.e., the "elbow") is the optimal K value. For example, if WCSS decreases by 15% when K increases from 2 to 3, but only by 3% when K increases from 3 to 4, then the optimal K value is 3.

[0075] If the curve has no obvious elbow, then K=3 is used by default to adapt to the scenario of "aquatic plants + water surface + debris" in most crab ponds.

[0076] Step S4: K-means clustering segmentation

[0077] Based on the optimal K value (or the manually adjusted K value) determined in step S3, K-means clustering is performed on the image to be segmented, dividing the pixels in the image into K clusters with similar color features. The specific implementation is as follows:

[0078] Data point set construction: Each pixel's HSV vector in the image is regarded as a three-dimensional data point, and the entire image constitutes a set containing N (total number of pixels) data points.

[0079] Initialize cluster centers: Randomly select K HSV vectors as initial cluster centers.

[0080] Iterative process: Alternately execute the allocation and update steps until the convergence condition is met.

[0081] Assignment steps: For each pixel, calculate the Euclidean distance (or Manhattan distance, as a less computationally intensive variant) from its HSV vector to each cluster center, and assign the pixel to the cluster to which the nearest cluster center belongs.

[0082] Update steps: For each cluster, recalculate the mean of the HSV vectors of all pixels within that cluster, and use it as the new cluster center.

[0083] Convergence condition: The iteration terminates when the distance the cluster center moves is less than the preset threshold (1e3) or when the maximum number of iterations (100) is reached.

[0084] After clustering, K pixel clusters are obtained, each cluster representing a region in the image with similar colors.

[0085] Step S5: Identify and tag aquatic plant clusters

[0086] In the HSV color space, aquatic plants typically appear greenish. Based on prior knowledge, the color characteristic range of aquatic plants is defined as follows: the H component is between 30° and 90°, the S component is no less than 20%, and the V component is no less than 10%. For each pixel cluster obtained in step S4, its HSV mean is calculated. If the mean falls within the above range, the cluster is marked as an "aquatic plant cluster." If multiple clusters meet the conditions, they can be merged into the same aquatic plant region; if no clusters meet the conditions, it may indicate that there are no aquatic plants in the image or that the proportion of aquatic plants is extremely low. In this case, manual intervention is required for judgment.

[0087] Step S6: Calculate the proportion of aquatic plants

[0088] Count the total number of pixels labeled as aquatic plant clusters. grass ), combined with the total number of pixels in the image (count) total ), calculate the ratio of aquatic plants:

[0089]

[0090] The result should be rounded to two decimal places and output.

[0091] To further improve the reliability of the results, this embodiment also provides a manual verification step:

[0092] Save the binary image corresponding to each pixel cluster and the calculated proportion of aquatic plants to the specified folder.

[0093] Receive manual selection instructions to determine the final aquatic plant cluster from multiple pixel clusters; or receive manually input K value to repeat steps S4 to S6 to achieve iterative optimization.

[0094] Example 2

[0095] This embodiment provides a rapid calculation system for the proportion of aquatic plants in crab ponds based on image processing technology, used to implement the image processing technology-based method for calculating the proportion of aquatic plants in crab ponds described in Embodiment 1. The system includes:

[0096] Image acquisition module: Used to perform step S1, acquiring an overhead view of the crab pond. This module can integrate UAV control functions or directly receive externally input image data.

[0097] Image preprocessing module: used to perform step S2, to reduce noise and convert the color space of the top view image, and output the image to be segmented.

[0098] K-value optimization module: used to execute step S3, calculate and output the optimal K value using the elbow rule.

[0099] Clustering and segmentation module: used to execute step S4, perform K-means clustering segmentation on the image to be segmented according to the optimal K value, and output K pixel clusters.

[0100] Aquatic plant recognition module: used to perform step S5, calculate the HSV mean value of each pixel cluster in the HSV color space, and mark the aquatic plant clusters according to the preset green range.

[0101] Percentage Calculation Module: Used to execute step S6, count the number of pixels in the aquatic plant clusters and calculate the percentage of aquatic plants.

[0102] Each module can be deployed as software on a general-purpose computer.

[0103] Example 3

[0104] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the crab pond aquatic plant ratio calculation method based on image processing technology described in Embodiment 1. The storage medium can be any non-transitory readable medium such as ROM, RAM, magnetic disk, or optical disk.

[0105] Example 4

[0106] In addition to the embodiments described in Examples 1 to 3 above, the present invention can also employ the following alternative solutions, which can also achieve the objectives of the present invention:

[0107] Clustering Algorithm Alternative: The Fuzzy C-means (FCM) algorithm can be used instead of the K-means algorithm. By assigning the cluster to which a pixel belongs by probability, the robustness of segmentation is improved, which is especially suitable for scenarios where the boundary between aquatic plants and the water surface is blurred.

[0108] Color space alternative: The Lab color space can be used instead of the HSV color space. The Lab space has a wider color gamut and is device-independent, which can further reduce the impact of lighting on color characteristics and is suitable for extreme lighting scenarios (such as strong direct light and weak light at dusk).

[0109] Post-processing operation alternatives: Closing operations can be used instead of opening operations, which is suitable for scenarios where there are small holes in the aquatic plant area; or morphological gradient operations can be combined to optimize the detection accuracy of aquatic plant boundaries.

[0110] Example 5

[0111] To verify the superiority of the present invention, three crab ponds in different scenarios were selected.

[0112] Scene 1: Sunny daytime hygrophyte pond;

[0113] Scene 2: Cloudy day at the bitter grass pond;

[0114] Scene 3: Turbid water mixed with aquatic plants in a pond;

[0115] Comparative experiments were conducted using the method of this invention, the fixed threshold method, and the SVM method, respectively.

[0116] The experimental results are shown in the table below:

[0117] Comparison indicators This proposal Fixed threshold method SVM method Single image processing time 28 seconds (minimum configuration) 15 seconds 3 minutes and 42 seconds Scenario 1 Proportion Error 2.3% (actual percentage 45.2%) 1.8% (actual percentage 45.2%) 2.1% (actual percentage 45.2%) Scenario 2 Proportion Error 3.1% (actual percentage 38.7%) 12.5% ​​(actual percentage 38.7%) 4.8% (actual percentage 38.7%) Scenario 3 Proportion Error 4.2% (actual percentage 52.1%) 18.3% (actual percentage 52.1%) 9.5% (actual percentage 52.1%) Sample proportion error No (no sample labeling required) No (no sample required) 30 person-days (collection + annotation) Deployment threshold Low (no professional knowledge required) Medium (threshold adjustment required) Advanced (requires machine learning knowledge) Environmental adaptability Strong (adaptable to changes in light / water quality) Weak (only compatible with a single scenario) (Model needs to be retrained)

[0118] in:

[0119] The true proportion was obtained through precise calculation using a combination of manual net surveying and GPS positioning.

[0120] All experimental images are composite images taken by drones at a resolution of 1920×1080 pixels;

[0121] The SVM method uses the RBF kernel function, with a penalty coefficient C=10, gamma=0.1, and 1000 training samples.

[0122] The fixed threshold method uses the industry-standard HSV thresholds (H∈[35,77], S∈[30%,100%], V∈[20%,100%]).

[0123] Experimental results show that the present invention can achieve low error under different environmental conditions while maintaining high efficiency, and requires no sample preparation or professional knowledge, which represents a significant technological advancement.

[0124] Finally, it should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for calculating the proportion of aquatic plants in a crab pond based on image processing technology, characterized in that, Includes the following steps: Step S1: Collect an overhead view image of the crab pond; Step S2: Preprocess the top view image to obtain the image to be segmented; Step S3: Use the elbow rule to determine the optimal K value for K-means clustering segmentation; Step S4: Based on the optimal K value, perform K-means clustering on the image to be segmented to obtain K pixel clusters; Step S5: Identify and mark the aquatic plant clusters from the K pixel clusters. The identification method is as follows: In the HSV color space, calculate the HSV mean value of each pixel cluster, and mark the pixel clusters that satisfy the following conditions: H component is in the range of 30° to 90°, S component ≥ 20%, and V component ≥ 10% as aquatic plant clusters. Step S6: Count the number of pixels of the aquatic plant cluster and calculate its proportion in the total number of pixels in the image, as the aquatic plant proportion.

2. The crab pond water grass proportion calculation method based on image processing technology according to claim 1, characterized in that, The preprocessing in step S2 includes: The top-view image is subjected to Gaussian filtering for noise reduction. The filter size is 5×5 and the standard deviation σ=1.

5. The denoised image is converted from the RGB color space to the HSV color space to obtain the image to be segmented, which represents pixels as HSV vectors.

3. The crab pond water grass proportion calculation method based on image processing technology according to claim 1, characterized in that, Step S3 uses the elbow rule to determine the optimal K value, specifically including: The candidate range for the K value is set to 2 to 8; For each candidate K value, perform K-means clustering and compute its in-cluster sum of squares (WCSS). Plot the K-WCSS curve and determine the optimal K value as the point where the rate of decrease of WCSS in the curve suddenly drops. If the curve does not decrease significantly, then K=3 is assumed.

4. The crab pond water grass proportion calculation method based on image processing technology according to claim 1, characterized in that, The K-means clustering segmentation in step S4 specifically includes: Each pixel in the image to be segmented is represented as an HSV 3D vector as a data point; Initialize K cluster centers; Iteratively execute the following steps until the convergence condition is met: ①Assignment steps: Calculate the Euclidean distance from the HSV vector of each pixel to each cluster center, and assign it to the cluster to which the nearest cluster center belongs; ②Update steps: Recalculate the HSV mean of all pixels within each cluster as the new cluster center; ③ The convergence condition is: the cluster center moves a distance of less than 1e-3, or the maximum number of iterations of 100 is reached.

5. The crab pond water grass proportion calculation method based on image processing technology according to claim 1, characterized in that, The step S1, which involves acquiring an overhead view image of the crab pond, specifically includes: Use a drone to take vertical overhead photos of the crab ponds at a height of 50 meters, with each image covering an area of ​​≤5 acres. If the crab pond area is greater than 5 mu, multiple photos should be taken under the condition of fixed height accuracy ≤ ±0.5 meters, and then combined into a complete aerial view of the crab pond using an image stitching tool.

6. The crab pond water grass proportion calculation method based on image processing technology according to claim 1, characterized in that, It also includes a manual verification step: ① Save the binary image corresponding to each pixel cluster and the calculated proportion of aquatic plants; ② Receive manual selection instructions to determine the final aquatic plant cluster from multiple pixel clusters, or receive manually input K value to repeat steps S4 to S6.

7. A crab pond water grass proportion rapid calculation system based on an image processing technology, used for implementing the crab pond water grass proportion calculation method based on the image processing technology in any one of claims 1 to 6, characterized in that, include: Image acquisition module, used to acquire top-view images of the crab pond; The image preprocessing module is used to preprocess the top view image to obtain the image to be segmented; The K-value optimization module is used to determine the optimal K-value for K-means clustering segmentation using the elbow rule. The clustering and segmentation module is used to perform K-means clustering on the image to be segmented according to the optimal K value, to obtain K pixel clusters; The aquatic plant identification module is used to calculate the HSV mean value of each pixel cluster in the HSV color space, and to mark the pixel clusters that meet the requirements of H component in the range of 30° to 90°, S component ≥20%, and V component ≥10% as aquatic plant clusters; The percentage calculation module is used to count the number of pixels of the aquatic plant clusters and calculate their percentage in the total number of pixels in the image, which is the percentage of aquatic plants.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for calculating the proportion of aquatic plants in crab ponds based on image processing technology as described in any one of claims 1 to 6.