Crop disease and insect pest leaf segmentation method and system based on image processing
By performing superpixel segmentation and convex hull repair in the CIELAB color space, the problem of similar soil background and lesion color in field environments was solved, enabling the restoration of leaf morphology caused by pests, accurately distinguishing pest and disease areas, and improving the accuracy of crop pest and disease assessment.
Patent Information
- Application Number
- CN202511778510.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
In field environments, the soil background and lesion colors are similar and easily confused, making it difficult for existing segmentation methods to distinguish them accurately. Furthermore, pests cause leaf morphological defects, making it impossible for existing methods to accurately quantify the degree of damage, leading to distorted pest and disease assessments.
The crop canopy image was converted to the CIELAB color space for superpixel segmentation. Superpixel color feature vectors were constructed, and background saliency was calculated using minimum cumulative path cost. Leaf morphology was restored using convex hull and concavity index, and insect-infested areas and lesion areas were separated by combining brightness threshold.
Accurately separating lesions from the soil background in complex environments, repairing leaf defects caused by pests, and achieving dual monitoring of diseases and pests improves the anti-interference ability of crop image segmentation and the accuracy of disease and pest assessment.
Smart Images

Figure CN121582286A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing. More particularly, the present application relates to a crop disease and pest leaf segmentation method and system based on image processing. BACKGROUND
[0002] Accurate monitoring and quantitative evaluation of crop diseases and pests are the core links of modern smart agriculture and precision plant protection. In the growth cycle of crops, leaves are the main organs for photosynthesis and the first parts to show diseases and pests. Timely and accurate segmentation of crop leaves from the field background and quantitative analysis of disease area and pest degree are of great guiding significance for formulating reasonable pesticide application schemes, evaluating crop health status, and ensuring grain yield.
[0003] In related technologies, for example, a threshold segmentation or clustering algorithm based on color space is usually used to extract the leaf area. The leaf is separated from the background by taking advantage of the difference in color channel between green plants and soil background, and then the number of foreground pixels is counted to estimate the disease degree.
[0004] However, the field background is complex, and the color of the dry and yellow disease spot is extremely similar to that of the exposed soil background. Relying only on color features is easy to cause serious confusion, resulting in misjudgment of the background as a disease spot or missing detection of the disease spot. In addition, the uncertain natural light conditions in the field environment are easy to produce shadows or reflections on the leaf surface, causing nonlinear drift of the color features, making it difficult for conventional segmentation models based on fixed parameters to maintain stable accuracy under different weather conditions; at the same time, the existing segmentation methods focus on extracting existing leaf areas, ignoring the leaf edge notching and internal holes caused by pests. When the leaf is eroded by pests, the related technology cannot restore the original outline of the leaf before damage, so that the determination result of the disease and pest level is distorted, which cannot meet the demand of precision agriculture for quantitative analysis of the disaster degree. SUMMARY
[0005] To solve the above technical problems that the soil background and the disease spot color are similar and easy to confuse in the field environment, and the leaf shape is damaged by pests and cannot accurately quantify the disaster degree, the present application provides solutions in the following aspects.
[0006] In a first aspect, the present application provides a crop disease and pest leaf segmentation method based on image processing, comprising: converting a crop canopy image to a CIELAB color space, performing superpixel segmentation on the converted image to obtain a plurality of superpixels, calculating the pixel mean value of each superpixel in the L, A and B channels, and constructing a color feature vector of the superpixel; selecting superpixels located at the edge of the image as background nodes, calculating the minimum cumulative path cost of any superpixel to all background nodes, and obtaining the background saliency of the superpixel according to the minimum cumulative path cost; determining a segmentation threshold according to the mean and standard deviation of the background saliency of all superpixels, taking the superpixels with a background saliency greater than the segmentation threshold as the foreground region, and generating an initial segmentation mask; extracting the contour of the initial segmentation mask and constructing a convex hull, determining the concave region formed by the adjacent vertices of the convex hull and the contour points, calculating the concave index according to the depth, width and fitting radius of the concave region, filling the concave region with a concave index greater than a preset repair threshold into the initial segmentation mask to obtain a complete leaf segmentation mask; performing an exclusive OR operation on the complete leaf segmentation mask and the initial segmentation mask to obtain a pest area, taking the area with an L channel value less than a preset lesion threshold within the initial segmentation mask as a lesion area, and judging the disease and pest according to the pixel number of the pest area and the lesion area.
[0007] The present application converts the image to CIELAB space and performs superpixel segmentation, aggregates pixel points using superpixels, effectively reduces the computational complexity, and suppresses the interference of soil particles, light reflection and other high-frequency noise; by constructing a background saliency model based on color feature vectors and spatial position relationships, using the physical space characteristic that the soil background extends to the boundary and the leaf is located in the center, the problem of false segmentation caused by the extremely similar color of the soil background and the yellowing lesion in the field environment is solved; by using an adaptive segmentation threshold determined based on statistical characteristics, the influence of light fluctuation on the saliency value distribution is eliminated, and the robustness of the algorithm in different environments is enhanced; by constructing a convex hull and calculating a concave index, the natural concave of the leaf and the damage caused by pests can be accurately distinguished, and the damaged part caused by pests can be repaired, so that the true physical form of the leaf is restored, and the calculation error of the disease proportion caused by the damage of the leaf is avoided; finally, the pest area and the lesion area are separated by exclusive OR operation and brightness threshold, and double monitoring of disease and pest is realized.
[0008] Preferably, the calculation of the pixel mean value of each superpixel in the L, A and B channels and the construction of the color feature vector of the superpixel comprise: calculating the mean value of all pixel points in the L channel, the mean value in the A channel and the mean value in the B channel of each superpixel, and taking the vector composed of the three mean values as the color feature vector of the superpixel.
[0009] Preferably, the calculating the minimum accumulated path cost from any superpixel to all background nodes comprises: taking each superpixel as a node, establishing an edge connection between two nodes if the two superpixels are spatially adjacent in the image, and the weight of the edge between the two nodes is the Euclidean distance between the color feature vectors of the two superpixels corresponding to the two nodes, to obtain a superpixel correlation graph; and using the Dijkstra shortest path algorithm to calculate the minimum accumulated path cost from any superpixel node to each background node in the superpixel correlation graph, and the minimum value in the minimum accumulated path cost is the minimum accumulated path cost from the superpixel to all background nodes.
[0010] The present application converts the image segmentation problem into a shortest path search problem in graph theory by establishing a superpixel correlation graph based on the Euclidean distance weight and using the Dijkstra algorithm to calculate the minimum accumulated path cost, can strengthen the isolation effect of the large color difference and spatial discontinuous region, so that the lesion region located in the center of the image can obtain a higher accumulated cost by crossing the large color difference leaf region to reach the background node, thereby effectively ensuring the accurate separation of the lesion and the soil background.
[0011] Preferably, the background saliency satisfies the relationship: ; in the formula, is the background saliency of the i-th superpixel, is the background saliency of the i-th superpixel, is the minimum accumulated path cost from the i-th superpixel to all background nodes, is a preset constant for controlling the saliency decay rate, is an exponential function with a natural constant as the base.
[0012] The present application stretches the saliency difference between the foreground and the background by using a nonlinear mapping, so that the saliency of the superpixels belonging to the background quickly approaches 0, and the saliency of the superpixels belonging to the leaves approaches 1, thereby improving the contrast and accuracy of the subsequent threshold segmentation.
[0013] Preferably, the determining the segmentation threshold according to the mean and standard deviation of the background saliency of all superpixels comprises: taking the sum of the mean and standard deviation of the background saliency of all superpixels as the segmentation threshold.
[0014] Preferably, the step of extracting the contour of the initial segmentation mask and constructing a convex hull, and determining the concave region formed by adjacent vertices of the convex hull and contour points, includes: extracting the contour of the initial segmentation mask and constructing a convex hull of the initial segmentation mask contour using the Graham scan method; for each pair of adjacent vertices on the convex hull, extracting all contour points with index values between the two vertices to form the corresponding leaf contour segment; taking the point with the largest vertical distance from the line connecting the two adjacent vertices on the contour segment as the farthest contour point; and the triangular region formed by the two adjacent vertices and the farthest contour point as the concave region.
[0015] This invention determines the fitting radius using the three-point circle method and, combined with depth and width, extracts multidimensional features of the concave region, which can objectively reflect the shape attributes of the concave region. This transforms visual shape differences into numerical indicators that can be processed by computers, providing accurate data support for subsequent region type identification.
[0016] Preferably, the step of calculating the depression index based on the depth, width, and fitting radius of the depression region includes: taking the perpendicular distance between the farthest contour point and the line connecting two adjacent vertices as the depth of the depression region, and the length of the line connecting the two adjacent vertices as the width of the depression region; determining a fitting circle using the three-point circle method with two adjacent vertices and the farthest contour point, and taking the radius of the fitting circle as the fitting radius of the depression region; and obtaining the depression index of the depression region based on the depth, width, and fitting radius of the depression region.
[0017] Preferably, the indentation index satisfies the following relationship: In the formula, For the first The depression index of a depression region For the first The depth of the recessed area For the first The width of the recessed area For the first The fitted radius of each concave region It is an S-shaped curve function. To prevent extremely small constants with a denominator of zero, To adjust the hyperparameters of sensitivity, This is the baseline value for the fitted radius.
[0018] This invention can significantly distinguish between the area corresponding to insect-damaged notches (usually deep and narrow with sharp edges) and the area corresponding to natural leaf lobes (usually wide and shallow with smooth edges) by using the indentation index. This enhances the identification of insect-damaged features, improves the accuracy of leaf repair, prevents erroneous repair of natural leaf shapes, and thus allows for better subsequent disease and pest assessment.
[0019] Preferably, the judging of the disease and insect damage according to the pixel number of the insect damage area and the lesion area comprises: when the ratio between the sum of the pixel number of the insect damage area and the lesion area and the total pixel number is greater than a threshold value, the disease and insect damage exist.
[0020] In a second aspect, the present application provides an image processing-based crop disease and insect damage leaf segmentation system, comprising a processor and a memory, wherein the memory stores computer program instructions which, when executed by the processor, implement the image processing-based crop disease and insect damage leaf segmentation method described above.
[0021] By adopting the above technical solution, the image processing-based crop disease and insect damage leaf segmentation method described above is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor, and use is facilitated.
[0022] The present application has the following beneficial effects: the present application effectively distinguishes the segmentation targets with similar colors by fusing the superpixel color features and the spatial topological constraints, and constructs a background saliency sensitive to the spatial position, so that the disease area located inside the leaf can be accurately stripped according to the spatial distribution characteristics of the target in the image in the case that the soil background and the lesion color are extremely confused, and the anti-interference ability of the crop image segmentation under a complex background is improved; the present application analyzes the depth-width ratio and the edge curvature characteristics of the concave part of the contour in view of the physical defects of the leaf caused by the insect damage, realizes the identification and targeted repair of the insect damage notching and natural leaf splitting, effectively restores the original form of the damaged leaf, solves the problem of distortion of the disease area proportion calculation benchmark caused by the incomplete leaf contour in the prior art, and ensures the authenticity and reliability of the crop condition statistical data; the present application realizes double-dimensional monitoring of the disease and the insect damage, converts the single image segmentation result into independent disease proportion and insect damage proportion indexes by comparing the difference before and after the leaf form repair and analyzing the brightness characteristics inside the leaf, provides a technical leap from qualitative judgment to quantitative analysis for agricultural production, and is helpful to realize fine management of the crop growth state and precise pesticide application decision. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 is a flowchart schematically showing the image processing-based crop disease and insect damage leaf segmentation method in the present application; Figure 2 is a distribution diagram schematically showing the background saliency in the present application; Figure 3 is a convex hull detection result schematically showing the present application; Figure 4 is a distribution diagram schematically showing the insect damage area and the lesion area in the present application. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.
[0025] The specific implementation of the present application will be described in detail below with reference to the drawings.
[0026] The embodiments of the present application disclose a crop disease and pest leaf segmentation method based on image processing, referring to Figure 1 , comprising steps S1-S5: S1, acquiring a crop canopy image, performing superpixel segmentation on the crop canopy image to obtain superpixels and constructing a color feature vector of the superpixels.
[0027] It should be noted that the segmentation of the leaf is easily disturbed by high-frequency noise such as soil particles and water droplet reflection, resulting in a jagged segmentation edge. In order to reduce the computational complexity and suppress the high-frequency noise, pixels that are similar in perception need to be aggregated into a tile with statistical significance. Therefore, the present application obtains superpixels through superpixel segmentation, and constructs a color feature vector of the superpixels using the color features inside the superpixels.
[0028] Specifically, a high-resolution industrial camera is used to collect a crop canopy image, and the image is converted from an RGB color space to a CIELAB color space, and the pixel values of the R, G and B channels are converted into the pixel values of the L, A and B channels. The converted image is subjected to superpixel segmentation processing to obtain a plurality of non-overlapping superpixels. The mean value of all pixel points in each superpixel on the L channel, the mean value on the A channel, and the mean value on the B channel are calculated, and the vector formed by the three mean values is taken as the color feature vector of the superpixel.
[0029] S2, selecting a background node, and obtaining a background saliency of the superpixel according to the spatial position relationship of the superpixel and the distance between the color feature vectors of the superpixel and the background node.
[0030] It should be noted that in the disease detection scene, the color of the soil background is extremely similar to that of the yellowing disease spot, and the traditional color clustering-based method is difficult to distinguish between the two. However, in terms of physical spatial distribution, the soil background usually extends to the four boundaries of the image, while the crop leaves are usually located in the center region of the image and are not connected to the image boundaries. In order to solve the color confusion problem by using this spatial distribution characteristic, the present application selects a background node, and obtains a background saliency of the superpixel according to the spatial position relationship of the superpixel and the distance between the color feature vectors of the superpixel and the background node.
[0031] Specifically, superpixels located at the four edges of the image are selected as background nodes. The shortest path algorithm is used to calculate the minimum cumulative path cost from any superpixel to all background nodes. The background saliency of each superpixel is then obtained based on the minimum cumulative path cost.
[0032] In one embodiment, calculating the minimum cumulative path cost from any superpixel to all background nodes using the shortest path algorithm includes: treating each superpixel as a node, if two superpixels are spatially adjacent in the image, establishing an edge connection between the two nodes, where the weight of the edge between the two nodes is the Euclidean distance between the color feature vectors of the two corresponding superpixels, thus obtaining a superpixel association graph. Using Dijkstra's shortest path algorithm, the minimum cumulative path cost from any superpixel node in the superpixel association graph to each background node is calculated, where the minimum of the minimum cumulative path costs is the minimum cumulative path cost from the superpixel to all background nodes.
[0033] ; In the formula, For the first Background saliency of each superpixel For the first The minimum cumulative path cost from each superpixel to all background nodes. To control the preset constant of the significance decay rate, In this embodiment, it is an exponential function with the natural constant as the base. The implementers can adjust according to the actual situation. The value of .
[0034] in, This metric integrates the dual attributes of color features and spatial topology. On the one hand, for soil background regions, because they extend continuously to the image boundary in space and have gentle internal color changes, the lower the minimum cumulative path cost, the more likely superpixels are to be in the background region, thus increasing background saliency. The closer the value is to 0; on the other hand, for lesion areas, although their color may be similar to that of the soil, because they are surrounded by healthy leaves with huge color differences in spatial topology, any spatial path to the background node must cross the region with the corresponding high edge weight, resulting in a surge in cumulative paths. Therefore, superpixels are more likely to be in the leaf region. Approaching 1; further, through The nonlinear mapping enhances the saliency difference caused by spatial enclosing relationship, effectively solving the problem that color clustering alone cannot distinguish similar lesions from soil.
[0035] For example, Figure 2The distribution of the background saliency in the application can be seen from the figure. Although the color of the lesion area is similar to the soil background, the application uses the spatial distribution characteristics that the leaf is located in the center and the background extends to the boundary to identify the entire leaf area as a high saliency foreground and the soil background as a low saliency area, effectively overcoming the defect that the background and the leaf are difficult to distinguish, and realizing accurate foreground positioning in a complex background.
[0036] S3, generating an initial segmentation mask according to the background saliency statistical characteristics.
[0037] It should be noted that the high and low of the background saliency represents the possibility of a pixel belonging to a leaf, but its essence is still a continuous probability distribution, which lacks a clear physical contour to define the boundary between the leaf and the background. In the field operation scene, the lighting condition has high uncertainty. This change in ambient light will cause the overall distribution interval of the saliency value to shift, making it difficult to have a unified division standard between different images. Therefore, the application dynamically constructs an adaptive segmentation limit through the distribution characteristics of the image background saliency, eliminates the influence of lighting fluctuations on the numerical distribution, and ensures that a complete and closed leaf mask can be generated under different weather conditions.
[0038] Specifically, the mean and standard deviation of the background saliency of all superpixels are counted. The sum of the mean and standard deviation is used as the segmentation threshold. The superpixels with a background saliency greater than the segmentation threshold are the foreground region, and the remaining superpixels are the background region, generating an initial segmentation mask.
[0039] In one embodiment, the sum of the mean and twice the standard deviation is used as the segmentation threshold.
[0040] S4, correcting the initial mask based on the concave index to obtain a complete leaf segmentation mask.
[0041] It should be noted that after the crop leaf is eroded by pests, the originally smooth and closed physical edge will form irregular notches or holes. Existing segmentation algorithms can only extract the remaining leaf part, which affects the accuracy of disease classification when calculating the disease area ratio. In order to restore the true physical form of the leaf, it is necessary to distinguish between natural leaf concave and pest notched concave. Therefore, the application constructs a concave index to identify and fill the abnormal concave area caused by pests.
[0042] Specifically, contour extraction is performed on the initial segmentation mask to obtain a set of leaf contour points arranged in sequence. A convex hull is constructed for the set of leaf contour points using a convex hull algorithm. For each pair of adjacent vertices on the convex hull, all contour points with index values between the two vertices are extracted to form a corresponding leaf contour segment. The perpendicular distance of each point on the contour segment to the line connecting the two adjacent vertices is calculated, where the point with the maximum perpendicular distance is the farthest contour point. The triangular region formed by the two adjacent vertices and the farthest contour point is the concave region, the perpendicular distance of the farthest contour point to the line connecting the two adjacent vertices is the depth of the concave region, and the length of the line connecting the two adjacent vertices is the width of the concave region. A fitting circle is determined using the two adjacent vertices and the farthest contour point by the three-point circle fitting method, and the radius of the fitting circle is the fitting radius of the concave region. The concave region corresponding to each pair of adjacent vertices on the convex hull is obtained. For each concave region, the concave index of the concave region is obtained according to the depth, width and fitting radius of the concave region.
[0043] In one embodiment, the convex hull algorithm is the Graham scan method.
[0044] Further, the concave region with a concave index greater than a preset repair threshold is determined as a pest defect region, and the pest defect region is filled into the initial segmentation mask to obtain a complete leaf segmentation mask.
[0045] Illustratively, the repair threshold is 0.6.
[0046] Specifically, the concave index satisfies the relationship: ; In the formula, is the concave index of the i-th concave region, is the depth of the i-th concave region, is the width of the i-th concave region, is the fitting radius of the i-th concave region, is a very small constant to prevent the denominator from being zero, is a hyperparameter for adjusting sensitivity, is a fitting radius reference value, is an S-shaped curve function, in the present embodiment , and may be determined by the implementer according to actual conditions. , , and .
[0047] wherein, The indentation index represents the depth-to-width ratio of the depressed area. A larger value indicates a deeper depression and a narrower opening, consistent with the geometric characteristics of deep insect bite holes or damage from piercing-sucking mouthparts. The larger the value, the more likely the blade will be segmented and masked for repair; the smaller the value, the more likely the blade will not be segmented and masked for repair, as it may be a natural, wide leaf slit. use The function corrects for the sharpness of the depressions when the fitted radius of the depression region is... The smaller the size, the sharper the edges of the recessed area, which better matches the characteristics of sharp edges left by insect bites. The closer it is to 1, the more it enhances the repair weight; when The larger the area, the smoother the edges of the concave region, and the more likely the leaf will resemble its natural shape. Approaching 0, thus different areas can be distinguished, enabling accurate identification and targeted repair of insect-damaged notches and natural leaf shapes.
[0048] For example, Figure 3 The figure shows the convex hull detection results of this invention. As can be seen from the figure, this invention can accurately identify sharp notches caused by insect bites by constructing the leaf convex hull and analyzing the geometric features of the contour depression, and determine the area that needs to be filled and repaired. It can virtually restore the original physical morphology of the damaged leaf, thereby solving the problem of the failure of disease and pest assessment caused by leaf defects in the existing technology.
[0049] S5. Obtain the pest-infested area and the lesion area based on the segmentation mask, and determine the pest and disease based on the number of pixels in the pest-infested area and the lesion area.
[0050] Specifically, the complete leaf segmentation mask and the initial segmentation mask are XORed to obtain the pest-affected areas. Within the initial segmentation mask, areas with an L channel value less than a preset lesion threshold are designated as lesion areas. The number of pixels in both the pest-affected and lesion areas is calculated. Pest and disease status is determined based on the number of pixels in both areas.
[0051] In one embodiment, if the ratio of the number of pixels in the insect-damaged area to the total number of pixels in the complete leaf segmentation mask is greater than 0.05, the crop leaf is determined to be at risk of insect damage; if the ratio of the number of pixels in the lesion area to the total number of pixels in the complete leaf segmentation mask is greater than 0.1, the crop leaf is determined to be at risk of disease.
[0052] In another embodiment, a severe pest and disease warning signal is issued in response to the sum of the number of pixels in the pest-infested area and the lesion area accounting for more than 0.3 of the total number of pixels.
[0053] For example, Figure 4For the pest area and the disease spot area distribution map in the application, it can be seen from the figure that the leaf tissue is divided into healthy leaf tissue area (green), disease spot area (red) and pest area (blue), and then the degree of disease and insect pests is judged according to the area of the disease spot area and the pest area.
[0054] The embodiment of the application further discloses a crop disease and insect pest leaf segmentation system based on image processing, comprising a processor and a memory, and the memory stores computer program instructions.
[0055] The above system further comprises a communication bus and a communication interface and other components well known to those skilled in the art, the setting and functions of which are known in the art, and thus will not be described here.
Claims
1. A method for segmenting crop leaves for pests and diseases based on image processing, characterized in that, include: The crop canopy image is converted to the CIELAB color space. The converted image is then segmented into several superpixels. The pixel mean of each superpixel in the L, A, and B channels is calculated, and the color feature vector of the superpixel is constructed. Superpixels located at the image edge are selected as background nodes. The minimum cumulative path cost from any superpixel to all background nodes is calculated. The background saliency of the superpixel is obtained based on the minimum cumulative path cost. The segmentation threshold is determined based on the mean and standard deviation of the background saliency of all superpixels. The superpixels with a background saliency greater than the segmentation threshold are selected as the foreground region to generate the initial segmentation mask. Extract the contour of the initial segmentation mask and construct the convex hull. Determine the concave region formed by the adjacent vertices of the convex hull and the contour points. Calculate the concave index based on the depth, width and fitting radius of the concave region. Fill the concave region with the concave index greater than the preset repair threshold into the initial segmentation mask to obtain the complete leaf segmentation mask. The pest-affected area is obtained by performing an XOR operation between the complete leaf segmentation mask and the initial segmentation mask. The area with an L channel value less than the preset lesion threshold inside the initial segmentation mask is the lesion area. The pest and disease are determined based on the number of pixels in the pest-affected area and the lesion area.
2. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The step of calculating the pixel mean of each superpixel in the three channels L, A, and B, and constructing the color feature vector of the superpixel, includes: calculating the mean of all pixels in each superpixel in the L channel, the mean in the A channel, and the mean in the B channel, and using the vector formed by the three means as the color feature vector of the superpixel.
3. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The calculation of the minimum cumulative path cost from any superpixel to all background nodes includes: taking each superpixel as a node, if two superpixels are spatially adjacent in the image, then establishing an edge connection between the two nodes, the weight of the edge between the two nodes is the Euclidean distance between the color feature vectors of the two superpixels corresponding to the two nodes, thus obtaining a superpixel association graph; using Dijkstra's shortest path algorithm, calculating the minimum cumulative path cost from any superpixel node in the superpixel association graph to each background node, the minimum of the minimum cumulative path costs is the minimum cumulative path cost from the superpixel to all background nodes.
4. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The background saliency satisfies the following relationship: ; In the formula, For the first Background saliency of each superpixel For the first The minimum cumulative path cost from each superpixel to all background nodes. To control the preset constant of the significance decay rate, It is an exponential function with the natural constant as the base.
5. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The step of determining the segmentation threshold based on the mean and standard deviation of the background saliency of all superpixels includes: using the sum of the mean and standard deviation of the background saliency of all superpixels as the segmentation threshold.
6. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The step of extracting the contour of the initial segmentation mask and constructing the convex hull, and determining the concave region formed by adjacent vertices of the convex hull and contour points, includes: extracting the contour of the initial segmentation mask and constructing the convex hull of the initial segmentation mask contour using the Graham scan method; for each pair of adjacent vertices on the convex hull, extracting all contour points with index values between the two vertices to form the corresponding leaf contour segment; taking the point with the largest vertical distance from the line connecting the two adjacent vertices on the contour segment as the farthest contour point; and taking the triangular region formed by the two adjacent vertices and the farthest contour point as the concave region.
7. The crop leaf segmentation method based on image processing according to claim 6, characterized in that, The calculation of the depression index based on the depth, width, and fitting radius of the depression region includes: taking the perpendicular distance between the farthest contour point and the line connecting two adjacent vertices as the depth of the depression region, and the length of the line connecting the two adjacent vertices as the width of the depression region; using the three-point circle method to determine the fitting circle with two adjacent vertices and the farthest contour point, and taking the radius of the fitting circle as the fitting radius of the depression region; and obtaining the depression index of the depression region based on the depth, width, and fitting radius of the depression region.
8. The method for segmenting crop leaves based on image processing according to claim 1, characterized in that, The indentation index satisfies the following relationship: ; In the formula, For the first The depression index of a depression region For the first The depth of the recessed area For the first The width of the recessed area For the first The fitted radius of each concave region It is an S-shaped curve function. To prevent extremely small constants with a denominator of zero, To adjust the hyperparameters of sensitivity, This is the baseline value for the fitted radius.
9. The crop leaf segmentation method based on image processing according to claim 1, characterized in that, The method of determining pests and diseases based on the number of pixels in the pest-affected area and the lesion area includes: when the ratio between the sum of the number of pixels in the pest-affected area and the lesion area and the total number of pixels is greater than a threshold, pests and diseases exist.
10. A crop disease and pest leaf segmentation system based on image processing, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the image processing-based crop disease and pest leaf segmentation method according to any one of claims 1-9.