Disease and pest identification method and system based on unmanned aerial vehicle inspection image
By using UAV image processing technology, the dark and bright areas of jujube tree leaves are extracted. Based on gradient values and directions, lesion indicators are defined, which solves the problem of poor pest and disease identification in existing technologies and achieves efficient and accurate pest and disease identification and control support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-12
- Publication Date
- 2026-03-27
AI Technical Summary
Existing methods for identifying jujube tree diseases and pests based on UAV images are inadequate for accurately capturing early signs of damage from bud-eating weevils, jujube loopers, and jujube rust, resulting in poor identification performance and an inability to provide timely and reliable support for disease and pest control.
By acquiring images of jujube leaves collected by drones, preprocessing them, and extracting leaf regions, the gradient values and directions of edge pixels are used to determine dark and bright areas. Based on the gradient values and directions of boundary pixels, lesion indicators are defined to achieve automated identification of pests and diseases.
It improves the accuracy and reliability of early pest and disease identification, enhances the early warning and precise control capabilities for pests and diseases, and improves the efficiency and coverage of large-scale jujube orchard inspections.
Smart Images

Figure CN121482661B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a jujube tree disease and pest identification method and system based on unmanned aerial vehicle inspection images. BACKGROUND
[0002] Jujube tree is an important economic fruit tree in China. As a characteristic and advantageous variety, Shanbei red jujube plays an important role in local agricultural economy. However, the red jujube planting in this region is often threatened by various diseases and pests. The food weevil in early spring from mid-April to the end of May and the jujube looper in the leaf expansion period from mid-May to June both cause harm by feeding on leaves. Jujube rust is prone to occur in autumn. If these diseases and pests cannot be timely prevented and controlled, they may cause the jujube tree to be bare and seriously affect the yield and quality of red jujube. Therefore, efficient monitoring of jujube tree diseases and pests is the key to guarantee the development of the red jujube industry.
[0003] With the popularization of large-scale jujube orchard planting mode, the traditional disease and pest monitoring method has been difficult to meet the demand. Unmanned aerial vehicles, with the core advantages of high-altitude scanning, high efficiency and flexibility, and wide coverage, can break through the terrain limitation and quickly obtain jujube orchard leaf images, gradually becoming an important technical means in the field of jujube tree disease and pest monitoring, and providing a new technical path for early identification of diseases and pests. However, the existing jujube tree disease and pest identification method based on unmanned aerial vehicle images is difficult to accurately capture the early characteristics of food weevil, jujube looper damage and jujube rust occurrence in actual application, and the overall identification effect is not good, which cannot provide timely and reliable support for disease and pest control, affecting the effectiveness of prevention and control work. SUMMARY
[0004] In order to solve the technical problem of poor jujube tree disease and pest identification effect, the purpose of the present application is to provide a jujube tree disease and pest identification method and system based on unmanned aerial vehicle inspection images, and the technical solution adopted is as follows:
[0005] In a first aspect, a jujube tree disease and pest identification method based on unmanned aerial vehicle inspection images is provided, which comprises: acquiring an original image containing a jujube leaf area collected by an unmanned aerial vehicle, and pre-processing the original image to obtain a gray-scale image; extracting at least one leaf area from the gray-scale image; for each leaf area, determining a dark band area related to leaf veins and a bright area region related to leaf flesh according to the gray-scale information of the leaf area; determining a disease spot index of the leaf area according to the gradient value and gradient direction of the boundary pixel points on the junction of the dark band area and the bright area region; and determining that the leaf area has been infected with diseases and pests in the case that the disease spot index of the leaf area is greater than a preset disease and pest threshold.
[0006] In a possible design, the at least one leaf region is extracted from the grayscale image, including: processing the grayscale image by using a preset region extraction algorithm, the preset region extraction algorithm being configured to separate a complete leaf region from a background region by identifying contour features and a grayscale distribution range of the leaf, and the leaf region being an image region that contains a complete form of the leaf and has no obvious background interference.
[0007] In a possible design, the dark band region and the bright region related to the leaf blade are determined according to the grayscale information of the leaf region, including: extracting a plurality of edge pixel points according to the grayscale information of each pixel point in the leaf region, and determining a gradient value and a transition band width of each edge pixel point, the gradient value being used to represent the grayscale change intensity at the edge pixel point, and the transition band width being used to represent the pixel span in the gradient direction of the edge pixel point, in which the grayscale transits from a relatively low value to a relatively high value; clustering the plurality of edge pixel points by using a preset clustering algorithm according to the gradient value and the transition band width of each edge pixel point; matching a cluster obtained by the clustering with a preset edge type template to determine an edge type corresponding to each cluster, to obtain a plurality of edge types existing in the leaf region, the edge types including a clear edge, a fuzzy edge, an intermittent edge, and a pseudo edge; determining a global attribution probability of each edge type in the leaf region; determining an edge segmentation algorithm corresponding to the leaf region according to the global attribution probability of each edge type; and determining the dark band region and the bright region in the leaf region based on the edge segmentation algorithm.
[0008] In a possible design, the global attribution probability of each edge type in the leaf region is determined, including: determining a principal axis direction of the leaf region image; for a target edge type, determining an initial probability that each target pixel point belongs to the target edge type based on the gradient value and the transition band width of each target pixel point, the target edge type being any one of the plurality of edge types existing in the leaf region, and the target pixel point being an edge pixel point included in a cluster corresponding to the target edge type; determining a basic attribution probability of the target edge type according to the initial probability corresponding to each target pixel point and a position weight of each target pixel point, the position weight being determined based on a vertical distance of the target pixel point to the principal axis direction; determining at least one interference edge type that has an interference relationship with the target edge type; and correcting the basic attribution probability based on the interference edge type to obtain the global attribution probability of the target edge type.
[0009] In a possible design, the base belonging probability is corrected based on the interference edge type, including: determining an interference weight of each interference edge type on a target edge type; determining an interference offset of the base belonging probability of the target edge type caused by the interference edge type according to the interference weight and an initial probability of each target pixel point belonging to the interference edge type; determining an interference redundancy according to a feature correlation degree between the interference edge types and the interference weight of each interference edge type; and correcting the base belonging probability according to the interference offset and the interference redundancy.
[0010] In a possible design, the interference weight of each interference edge type on the target edge type is determined, including: for each interference edge type, obtaining a feature mutual exclusion relationship between the target edge type and the interference edge type according to a preset feature mutual exclusion relationship mapping; obtaining vertical distance information of edge pixel points belonging to the interference edge type to a principal axis direction, and determining a pathological correlation coefficient of the interference edge type on the target edge type according to the vertical distance information; and determining the interference weight according to the feature mutual exclusion relationship and the pathological correlation coefficient.
[0011] In a possible design, the edge segmentation algorithm corresponding to the leaf region is determined according to the global belonging probability of each edge type, including: performing normalization processing on the global belonging probability of each edge type; determining, according to a sorting result of the normalized global belonging probability, an edge segmentation algorithm corresponding to an edge type with the highest global belonging probability as a dominant algorithm, and determining an edge segmentation algorithm corresponding to an edge type with the second highest global belonging probability as a secondary algorithm; determining a difference degree between the global belonging probability corresponding to the dominant algorithm and the global belonging probability corresponding to the secondary algorithm; in a case where the difference degree is greater than or equal to a preset difference threshold, determining that the edge segmentation algorithm corresponding to the leaf region is the dominant algorithm; and in a case where the difference degree is less than the preset difference threshold, determining that the edge segmentation algorithm corresponding to the leaf region includes the dominant algorithm and the secondary algorithm.
[0012] In a possible design, in a case where the edge segmentation algorithm corresponding to the leaf region includes the dominant algorithm and the secondary algorithm, the dark band region and the bright region in the leaf region are determined based on the edge segmentation algorithm, including: respectively running the dominant algorithm and the secondary algorithm to obtain a first segmentation result and a second segmentation result; and fusing the first segmentation result and the second segmentation result to determine the dark band region and the bright region in the leaf region.
[0013] In a possible design, the disease spot index of the leaf region is determined according to the gradient value and the gradient direction of a boundary pixel point at the junction of the dark band region and the bright region, and the disease spot index determination method comprises the following steps: excluding abnormal pixel points and boundary pixel points of a false edge type from a plurality of boundary pixel points to obtain a plurality of effective boundary pixel points; dividing the leaf region into a plurality of sub-regions; for each sub-region, determining the local leaf vein direction of the sub-region according to the gradient direction of all effective boundary pixel points located in the sub-region; determining an effective boundary pixel point as a disease pixel point if the gradient value of the effective boundary pixel point is greater than a preset gradient threshold value and the included angle between the gradient direction of the effective boundary pixel point and the local leaf vein direction of the sub-region to which the effective boundary pixel point belongs is within a preset angle range; and determining the disease spot index according to the number of disease pixel points and the number of effective boundary pixel points.
[0014] In a second aspect, a jujube tree disease and pest identification system based on unmanned aerial vehicle inspection images is provided, comprising: an image acquisition unit configured to acquire an original image containing a jujube leaf region collected by an unmanned aerial vehicle and to obtain a gray-scale image by preprocessing the original image. A leaf region extraction unit is configured to extract at least one leaf region from the gray-scale image. A region segmentation unit is configured to determine a dark band region related to a leaf vein and a bright region related to a leaf pulp for each leaf region according to the gray-scale information of the leaf region. A disease spot index determination unit is configured to determine a disease spot index of the leaf region according to the gradient value and the gradient direction of a boundary pixel point at the junction of the dark band region and the bright region. A disease and pest determination unit is configured to determine that the leaf region has been infected with a disease and pest if the disease spot index of the leaf region is greater than a preset disease and pest threshold value.
[0015] The present application has the following advantages:
[0016] In the jujube tree disease and pest identification method based on unmanned aerial vehicle inspection image provided by the application, taking the original crown layer image efficiently obtained by the unmanned aerial vehicle as the starting point, the complex field scene is first converted into independent, pure and target-specific analysis units through standardized preprocessing and leaf region extraction, laying a solid foundation for subsequent fine analysis. Instead of relying on easily disturbed conventional features such as color abnormalities or macroscopic morphological variations, the boundary texture characteristics of "dark bands" and "bright areas" related to the internal and vein structure of the leaf are further excavated and quantified, and the "disease spot index" is defined based on the gradient value and direction of the boundary pixel points. This method can sensitively capture early and subtle gray texture changes with pathological specificity such as jujube disease "mottled light transmission". Finally, by comparing the calculated objective quantitative index with the preset threshold, the automatic and standardized determination of the presence or absence of diseases and pests is realized. Therefore, not only the operation efficiency and range coverage capability of large-scale jujube orchard inspection are greatly improved, but more importantly, by focusing on more stable and essential pathological texture features and implementing quantitative analysis, the recognition accuracy and reliability of early diseases and diseases in complex scenes are significantly enhanced, thereby providing strong technical support for early warning and precise prevention and control of diseases and pests. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0018] Figure 1 The structure diagram of a jujube tree disease and pest identification system based on unmanned aerial vehicle inspection image provided by one embodiment of the present application;
[0019] Figure 2 The flowchart of a jujube tree disease and pest identification method based on unmanned aerial vehicle inspection image provided by one embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the jujube tree disease and pest identification method and system based on unmanned aerial vehicle inspection image according to the present application are described in detail as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0021] In the embodiments of the present application, the words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration, and should not be necessarily construed as a preference or a benefit. Rather, use of the words such as "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0022] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this document is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" and "multiple" mean two or more. "First", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0024] The specific scheme of the jujube tree disease and pest identification method and system based on unmanned aerial vehicle inspection images provided by the present application is described in detail below in combination with the drawings.
[0025] Please refer to Figure 1 , which shows the structure schematic diagram of the jujube tree disease and pest identification system based on unmanned aerial vehicle inspection images provided by an embodiment of the present application, as Figure 1 shown, the jujube tree disease and pest identification system based on unmanned aerial vehicle inspection images 10 includes an image acquisition unit 11, a leaf area extraction unit 12, a region segmentation unit 13, a disease spot index determination unit 14, and a disease and pest determination unit 15.
[0026] The image acquisition unit 11 is used to complete the acquisition and preprocessing of the original image, and to provide high-quality basic data for subsequent identification.
[0027] The image acquisition unit 11 includes an image acquisition module and a preprocessing module.
[0028] The image acquisition module is used to perform high-altitude scanning tasks by unmanned aerial vehicles, focus on the jujube leaf area, accurately capture the leaf image, and ensure that the collected original image is clear and has no obvious interference, for the planting scene of Shanbei jujube garden under suitable illumination and shooting angle.
[0029] The pre-processing module receives the RGB (red, green, blue) three-channel original image transmitted by the image acquisition module, converts it into a gray-scale image according to the sensitivity difference of the human eye to different colors by using a weighted average method (for example, the green weight is the highest, the red weight is the second, and the blue weight is the lowest), and the gray-scale image can completely represent the gray-scale distribution characteristics of different regions of the leaf; the median filter is used to eliminate isolated noise such as salt and pepper noise, and then the Gaussian filter is used to smooth the overall diffuse noise, and finally a high-quality gray-scale image is obtained.
[0030] The leaf region extraction unit 12 is used to extract at least one leaf region from the gray-scale image, and the leaf region is an image region containing the complete form of the leaf and no obvious background interference.
[0031] The leaf region extraction unit 12 includes a region separation module and a form verification module.
[0032] The region separation module is used to receive the high-quality gray-scale image output by the image acquisition unit 11, and uses a preset region extraction algorithm to separate the complete leaf region from the complex background region by identifying the contour features and gray-scale distribution range of the leaf, and the leaf region is an independent image region containing the complete form of the leaf and no obvious background interference.
[0033] The form verification module performs form verification on the suspected leaf region extracted by the region separation module, eliminates the non-leaf false region formed due to image interference, and ensures the accuracy of the leaf region.
[0034] The region segmentation unit 13 is used to accurately divide the dark band region and the bright region based on the gray-scale information of the leaf region.
[0035] The region segmentation unit 13 includes an edge feature extraction module, an edge clustering and type matching module, a global attribution probability calculation module, a segmentation algorithm matching module, and a dark and bright region determination module.
[0036] The edge feature extraction module is used to receive the leaf region output by the leaf region extraction unit 12, extract a plurality of edge pixel points from the gray-scale image of the region, calculate the gradient value and transition band width of each edge pixel point, wherein the gradient value is used to represent the gray-scale change intensity at the edge pixel point, and the transition band width is used to represent the pixel span of the gray-scale from the relatively low value state to the relatively high value state in the gradient direction of the edge pixel point.
[0037] The edge cluster and type matching module is configured to construct a feature matrix from the gradient values and the transition band widths calculated by the edge feature extraction module, normalize the feature matrix, cluster the edge pixel points by a preset clustering algorithm, and obtain a plurality of initial edge clusters. The initial edge clusters are matched with preset edge type templates to determine the edge type (including clear edge, fuzzy edge, intermittent edge, and pseudo edge) corresponding to each initial edge cluster. The average distance of each initial edge cluster to the leaf vein is quantified by a distance transform algorithm, and the pseudo edge cluster with an average distance exceeding a preset standard is removed, and the effective edge type related to the leaf vein is retained.
[0038] The global attribution probability calculation module is configured to determine the initial probability of each edge pixel point belonging to each effective edge type based on the gradient value and the transition band width of the edge pixel point, and calculate the basic attribution probability by combining the distance weight (the closer the distance, the greater the weight) of each edge pixel point to the leaf vein. The interference edge type that has an interference relationship with the type is determined, the interference weight, interference offset, and interference redundancy of each interference edge type are calculated, and the basic attribution probability is modified to obtain the global attribution probability.
[0039] The segmentation algorithm matching module is configured to normalize the global attribution probability of each effective edge type, determine the dominant algorithm and the secondary algorithm according to the sorting result, calculate the difference degree of the global attribution probability of the two algorithms, and select the dominant algorithm as the edge segmentation algorithm corresponding to the leaf region if the difference degree is greater than or equal to a preset difference threshold. If the difference degree is less than the preset difference threshold, the dominant algorithm and the secondary algorithm are used as the edge segmentation algorithm.
[0040] The dark and bright area determination module is configured to run the edge segmentation algorithm determined by the segmentation algorithm matching module. If it is a single dominant algorithm, the segmentation result is directly output. If it is a double algorithm, the first segmentation result and the second segmentation result are obtained by running the two algorithms respectively. The two types of results are logically fused (the region determined by the dominant and secondary algorithms as dark / bright area is directly retained) and verified for authenticity (only the region determined by the secondary algorithm is filtered for isolated pixels, and only the region determined by the dominant algorithm is filled for holes to verify the gray scale features).
[0041] The disease spot index determination unit 14 is used to first locate the junction line of the dark band and the bright area, extract all the boundary pixel points thereon, and filter out the pixels determined to be abnormal or false edges to obtain "effective boundary pixel points". Then, the unit uses the gradient direction of these effective points to confirm the vein direction again. Then, according to the preset gradient threshold and angle condition (such as the gradient direction needs to be approximately perpendicular to the vein direction), the "target pixel points" that meet the "mottled light transmission" pathological characteristics are screened out from the effective points. Finally, the proportion of the number of target pixel points to the total number of effective boundary pixel points is calculated, and the proportion value is taken as the key "disease spot index" output. This index objectively quantifies the proportion of the area on the leaf surface that meets the specific disease texture characteristics.
[0042] The disease and pest determination unit 15 is used to receive the disease spot index value from the disease spot index determination unit 14 and compare it with a preset disease and pest threshold (for example, 80%) set by a large number of sample analysis. If the disease spot index is greater than or equal to the preset disease and pest threshold, the unit 15 determines that the leaf area currently analyzed has been infected with the target disease and pest; otherwise, it is determined to be healthy.
[0043] Referring to Figure 2 , a flowchart of a jujube tree disease and pest identification method based on unmanned aerial vehicle inspection images is shown, which includes steps S201-S205.
[0044] S201, an original image containing a jujube tree leaf area collected by an unmanned aerial vehicle is obtained, and the original image is preprocessed to obtain a gray-scale image.
[0045] In some embodiments, during the high-incidence period of jujube tree diseases and pests (such as the spring activity period of food weevils and jujube geometrids or the autumn jujube rust prone period), the unmanned aerial vehicle carrying a visible light camera is controlled to fly over the jujube garden for inspection. The preset flight height (for example, it can be set to 2-5 meters from the jujube tree crown) and the shooting angle are set to ensure that the details of the jujube crown layer can be clearly captured. The unmanned aerial vehicle camera shoots under suitable natural light conditions to obtain a high-resolution original image containing the target jujube tree leaf area. The original image is a standard RGB three-channel color image.
[0046] Subsequently, the obtained original RGB image is preprocessed to obtain an image suitable for subsequent gray-scale texture analysis. The preprocessing process includes grayscale processing and two-stage noise filtering processing in sequence.
[0047] The grayscale processing includes weighted calculation based on the RGB data of each pixel point in each image (the weight is based on green being the highest, red being the second, and blue being the lowest), for example, the formula can be , The intensity values of a certain pixel point in the original image in the red (Red), green (Green), and blue (Blue) channels are represented by R, G, and B, respectively. Through this calculation, a gray-scale image is obtained, which can highlight the gray-scale difference between the diseased leaf area and the healthy area.
[0048] The two-stage noise filtering process includes: the first type of noise filtering process (suppressing isolated noise points), which first uses a median filter to process the initial gray-scale image. Median filtering is a nonlinear filtering technique, and its principle is to replace the gray-scale value of each pixel point in the image with the median value of the gray-scale values of all pixel points in a certain neighborhood window. This processing can effectively filter out isolated noise points in the image, such as salt and pepper noise, while better protecting the image edge information from being blurred. The second type of noise filtering process (smoothing overall noise): after completing the median filtering, the output image is used as input and further smoothed using a Gaussian filter. Gaussian filtering is a linear smoothing filter, which can gently smooth the overall random noise in the image by using a kernel function conforming to the Gaussian distribution for convolution operation, making the gray-scale transition more gentle, and providing a more stable basis for subsequent gradient calculation.
[0049] It can be understood that after the above-mentioned gray-scale processing and two-stage noise filtering processing, the final output is a high-quality gray-scale image to be analyzed. In this image, the local gray-scale abnormalities of the leaf caused by diseases and pests (such as the "mottled light transmission" effect caused by jujube disease) are highlighted, and most of the random noise has been suppressed, laying a clear and reliable data foundation for subsequent leaf area extraction, edge segmentation, and disease feature quantification.
[0050] S202、From the gray-scale image, at least one leaf area is extracted.
[0051] As a possible implementation, first, the gray-scale image obtained after preprocessing in the above step S201 is input into a preset region extraction algorithm, which is configured to specifically identify the visual features of jujube leaves. The model performs forward inference on the input gray-scale image and outputs one or more detection results. Each result contains a binary mask (Mask), and the white pixel (value 1) area in the mask accurately outlines the contour of an independent leaf, and the black pixel (value 0) area represents the background. At the same time, the model outputs a confidence score for each detected leaf area, and the value range of the confidence score is 0-1, which is used to represent the reliability of the detection result.
[0052] In some embodiments, the preset region extraction algorithm is constructed based on a deep convolutional neural network, for example, using a MaskR-CNN (Mask Region-Convolutional Neural Network) instance segmentation model. Through training on a large number of labeled jujube tree leaf image datasets, the model learns the typical features that distinguish leaves from the background (such as branches, soil, and sky) and from other leaves, including but not limited to: contour features: the common closed contours of leaf shapes such as ellipses, ovals, or lanceolate shapes, and the possible fine serration features of leaf edges; gray scale distribution range features: the gray scale values within a leaf region usually vary continuously within a certain range, contrasting with background, shadow, or highlight regions; texture consistency features: the texture (such as vein texture) on the surface of a single leaf has certain continuity and consistency.
[0053] Subsequently, the detection results are filtered according to a preset confidence threshold to ensure that the extracted leaf regions meet the requirements of subsequent analysis.
[0054] In some embodiments, a confidence threshold is set, and for each detection result, if its confidence score is higher than the confidence threshold, the detection is considered reliable and is retained, otherwise it is filtered out.
[0055] For each retained detection result, according to its binary mask, the smallest circumscribed rectangular region occupied by the leaf is located on the original gray scale image. Then, a cropping operation is performed to extract the image pixels within the rectangular region to form an independent sub-image. This sub-image is a "leaf region". In order to ensure the purity of the region as an independent analysis unit, the following processing is implemented: the gray scale values of the pixels outside the binary mask (i.e. the background) are uniformly set to a specific background value (such as 0) to maximize the elimination of background interference; the position coordinates of the leaf region in the original image are recorded for subsequent positioning mapping needs.
[0056] It can be understood that through the above processing, a number of "leaf regions" meeting the quality requirements can be automatically extracted from a single canopy gray scale image. Each extracted leaf region is an image block that contains the complete main body shape of a leaf and has been separated from obvious background interference.
[0057] S203, for each leaf region, according to the gray scale information of the leaf region, determine the dark band region related to the leaf vein and the bright region related to the leaf mesophyll.
[0058] As a possible implementation, to determine the dark band region related to the leaf vein and the bright region related to the leaf mesophyll, the following steps can be implemented:
[0059] The first step is to extract multiple edge pixels based on the grayscale information of each pixel in each blade region for each blade region, and determine the gradient value and transition band width of each edge pixel. The gradient value is used to characterize the intensity of grayscale change at the edge pixel, and the transition band width is used to characterize the pixel span from a relatively low value state to a relatively high value state in the gradient direction of the edge pixel.
[0060] In some embodiments, for any leaf region, all pixels in the image of that leaf region are traversed, and pixels with abrupt grayscale changes are identified using a preset edge detection algorithm (such as the Canny edge detection algorithm) to obtain multiple edge pixels, wherein the coordinates of each edge pixel are ( ). ), Index of edge pixels.
[0061] Then, the gradient value of each edge pixel is calculated. The Sobel operator is used to calculate the gradient components of each pixel in the horizontal and vertical directions, and the gradient value is obtained by summing the squares and taking the square root. .
[0062] Calculate the transition band width for each edge pixel. Traverse adjacent pixels along the gradient direction and record the number of consecutive pixels whose grayscale values transition from a relatively low state to a relatively high state. This number represents the transition band width of the edge pixel. .
[0063] After obtaining the gradient value and transition band width of each edge pixel, the gradient value and transition band width of each edge pixel are combined to form a two-dimensional feature vector. The feature vectors of all edge pixels constitute Feature matrix ( (The total number of edge pixels); the feature matrix is normalized using the maximum and minimum value normalization method. Each element in the matrix is mapped to the interval between 0 and 1, resulting in the normalized feature matrix. To avoid the impact of differences in the dimensions of different features on subsequent clustering results, the normalization formula is as follows: ,in, Characteristic matrix No. Line 1 Column elements, For the first The minimum value among the column elements. For the first The maximum value among the column elements. If , then it means If the values of all elements in a column are equal, i.e., the variance of the column data is zero, the column data has no distinguishing degree and contributes nothing to subsequent analysis based on data differences (such as clustering). At this time, the values of the column are uniformly set to a neutral constant. In the present embodiment, the constant can be set to 0.5 based on experience.
[0064] In the second step, a preset clustering algorithm (such as a K-means unsupervised clustering algorithm) is used to cluster the plurality of edge pixel points according to the gradient value and the transition band width of each edge pixel point, and the cluster obtained by clustering is matched with a preset edge type template to determine the edge type corresponding to each cluster, thereby obtaining a plurality of edge types existing in the leaf region, wherein the edge types include clear edges, fuzzy edges, intermittent edges, and pseudo edges.
[0065] In some embodiments, a sample library is constructed in advance, and image samples covering main jujube tree varieties, different light scenes (sunny day / overcast day), and healthy leaves, early disease leaves, medium disease leaves, and late disease leaves are collected, totaling 50-100, to construct an edge type clustering reference sample library. Then, based on sample library analysis, four types of edge type templates are preset, wherein the clear edge template corresponds to the characteristics of "high gradient value, small transition band width, and high mutation uniformity", the fuzzy edge template corresponds to the characteristics of "small gradient value, large transition band width, and low mutation uniformity", the intermittent edge template corresponds to the characteristics of "large gradient value fluctuation and uneven transition band width", and the pseudo edge template corresponds to the characteristics of "no association with leaf veins and irregular gradient characteristics".
[0066] Further, the above normalized feature matrix is clustered using a preset clustering algorithm, and the clustering center is iteratively optimized to obtain a plurality of initial edge clusters The number of clustering clusters), and for each initial edge cluster, the average gradient value , the average transition band width and the corresponding variance of all pixels in the cluster are calculated as the core features of the cluster. Then, based on the matching of the core features of each cluster with the preset edge type template, each cluster is assigned a specific edge type label, for example, a cluster with high average gradient and narrow transition band may be matched as "clear edge"; a cluster with low average gradient and wide transition band may be matched as "fuzzy edge". Pseudo edges are removed, wherein the distance of all pixels in each initial edge cluster to the leaf veins is quantified by a distance transform algorithm, the average distance of the cluster is calculated, a distance threshold is determined based on the sample library, and the cluster with an average distance exceeding the distance threshold is determined as a pseudo edge and removed.
[0067] In the third step, the global attribution probability of each edge type in the leaf region is determined.
[0068] In some embodiments, the principal axis direction of the leaf region image is determined first.
[0069] wherein the gray scale image of the leaf region to be analyzed is converted into a binary image by thresholding, so as to separate the leaf foreground from the background. Then, the geometric moments of the binary image, especially its second order central moments, are calculated. Finally, the minimum inertia axis direction of the leaf region is calculated using the second order central moments, and the direction angle is the principal axis direction of the leaf region image.
[0070] It should be noted that in most higher plants, especially dicotyledonous plants such as jujube trees, the main vein (midrib) of the leaf has a high consistency with the geometric major axis direction of the leaf. This is determined by the biological laws of leaf growth and vascular development. Therefore, the geometric principal axis of the leaf contour extracted from the image is a strong proxy variable for the orientation of the internal vein system of the leaf, with a solid botanical basis.
[0071] The initial probability of each edge pixel point belonging to the edge type is further determined.
[0072] Any one of the plurality of edge types existing in the leaf region is denoted as a target edge type, and the edge pixel points included in the cluster corresponding to the target edge type are denoted as target pixel points. Further, based on the gradient value and the transition band width of each target pixel point, the single feature fitness degree of each target pixel point is determined, and the initial probability of each target pixel point belonging to the target edge type is determined.
[0073] For each target pixel point, the gradient value fitness degree of each target pixel point belonging to the edge type is calculated and the transition band width fitness degree , which is expressed by the formula , wherein represents (the gradient value) or (the transition band width), and correspondingly, is denoted as the gradient value fitness degree or the transition band width fitness degree of the th target pixel point, is the th feature value of the target pixel point, is the feature mean value of the target edge type, is the feature standard deviation of the target edge type, is the feature mean value of the target edge type, is the feature standard deviation of the target edge type.This is a very small positive number, for example, an empirical value of 0.001, to prevent the denominator from being zero. The closer the eigenvalue is to the mean of its corresponding eigenvalue, the higher the fit. (Denominator) It is a normal distribution normalization factor, which can avoid excessive differences in the fit value caused by different standard deviations of features of different edge types.
[0074] Further, the gradient value of each target pixel is obtained to determine the fit. and the fit of the transition zone width The two types of feature fit are weighted and fused. Since the gradient value is more visually apparent than the transition band width, a larger weight is assigned to the gradient value (e.g., gradient value weight is 0.6, transition band width weight is 0.4). The formula is expressed as follows: In the formula, For the first Target pixels and target edge types The degree of integration and compatibility, For the first Gradient value fit of each target pixel For the first The width matching of the transition band of each target pixel.
[0075] Based on this, the first The initial probability of a target pixel belonging to the target edge type is expressed by the formula: In the formula, For the first Each target pixel belongs to the target edge type. The initial probability, For the first Target pixels and target edge types The degree of integration and compatibility, For the first Each target pixel belongs to one of the multiple edge types corresponding to the leaf region, excluding the target edge type. The outside The degree of fusion fit of each edge type Among the multiple edge types belonging to the blade region, excluding the target edge type The number of edge types outside, for The calculation can be based on the calculation mentioned above. Target pixels and target edge types The same calculation method is used for the fusion compatibility, which will not be elaborated here. It is a very small positive number, for example, an empirical value of 0.001 can be taken to avoid the denominator being 0.
[0076] Secondly, calculate the basic attribution probability of the edge type.
[0077] According to the initial probability corresponding to each target pixel point and the position weight of each target pixel point, a basic attribution probability of the target edge type is determined; wherein the position weight is determined based on the vertical distance of the target pixel point to the main axis direction.
[0078] The calculation formula of the basic attribution probability of the target edge type is as follows:
[0079]
[0080] In the formula, is the basic attribution probability of the target edge type , is the initial probability corresponding to the i-th target pixel point included in the target edge type , is the position weight of the i-th target pixel point, , is the ratio of the distance of the i-th target pixel point to the main axis direction of the leaf region image to the maximum inscribed circle radius of the leaf region, taking a value in the interval of 0 to 1, , is used to represent the association weight of the pixel point and the leaf vein, the distance is closer, the value of the position weight is larger, is a very small positive number, for example, the empirical value can be 0.001, which is used to avoid the denominator being 0. It can be understood that, compared with directly accumulating the initial probabilities of multiple pixels, the basic attribution probability of the edge type is calculated based on the position weight and the attribution probability determined by the distance of the pixel to the leaf vein, which can make the real pathological pixels close to the leaf vein dominate in the calculation of the attribution of multiple pixels to the edge type.
[0081] Subsequently, the basic attribution probability of the edge type is corrected for interference to obtain the global attribution probability corresponding to the edge type.
[0082] At least one interference edge type existing interference relationship with the target edge type is determined; and based on the interference edge type, the basic attribution probability is corrected to obtain the global attribution probability of the target edge type.
[0083] For each interference edge type, according to a preset characteristic mutual exclusion relationship mapping, a characteristic mutual exclusion relationship between the target edge type and the interference edge type is obtained.
[0084] For each interference edge type, according to a preset characteristic mutual exclusion relationship mapping, a characteristic mutual exclusion relationship between the target edge type and the interference edge type is obtained.
[0085] In some embodiments, 15-20 labeled samples are used in advance, in which the edge type to which each edge pixel belongs, the gradient value, the transition band width, and the distance from the leaf vein are labeled, the mutual exclusion strength / correlation strength of each pair of edge types on each feature is obtained using a preset correlation analysis tool, the gradient value mutual exclusion strength is given a high weight, the transition band width mutual exclusion strength and the leaf vein distance mutual exclusion strength are given a low weight, the comprehensive mutual exclusion strength of each pair of edge types is obtained by weighted summation, and is standardized and mapped to the interval of 0 to 1 to obtain the interference weight corresponding to each pair of edge types, denoted as , The value of tends to 1, indicating that the mutual exclusion strength between the two is higher. The value of tends to 0, indicating that the mutual exclusion strength between the two is lower.
[0086] Further, the vertical distance information of the edge pixel belonging to the interference edge type to the main axis direction is obtained, and the pathological correlation coefficient of the interference edge type to the target edge type is determined according to the vertical distance information. The formula is expressed as wherein, is the mean value of the vertical distance (normalized, for example, the maximum and minimum normalization method can be used) of the edge pixel in to the main axis direction, is the maximum value of of all edge types, is a very small positive number, for example, the empirical value is 0.001, which is used to avoid the denominator being 0. Further, according to the feature mutual exclusion relationship and the pathological correlation coefficient, the interference weight is determined and standardized to the interval of 0 to 1, is the feature mutual exclusion relationship corresponding to the th interference edge type.
[0087] After obtaining the interference weight of the interference edge type, the interference cancellation amount of the basic belonging probability of the target edge type caused by the interference edge type is determined according to the interference weight and the belonging probability of each target pixel belonging to the interference edge type, and the formula is expressed as , is the interference cancellation amount of the basic belonging probability of the target edge type caused by the th interference edge type, is the initial probability of the th target pixel belonging to the th interference edge type, is the initial probability of the Interference weights for each interference edge type. After calculating the interference cancellation amount, it is normalized to a range of 0 to 1. Specifically, this can be done using a maximum-minimum normalization method based on historical maximum and minimum values. The larger the value, the greater the reduction in the base attribution probability of the target edge type.
[0088] Furthermore, based on the feature correlation between interference edge types and the interference weight of each interference edge type, the interference redundancy is determined, and its formula is expressed as follows: In the formula, To reduce interference redundancy, Interference edge type Interference weights, Interference edge type Interference weights, Interference edge type With interference edge type The degree of correlation between the features (obtained through a preset correlation analysis algorithm, such as calculating the Pearson correlation coefficient between the two and performing linear normalization to map it to the interval between 0 and 1).
[0089] It should be noted that this only applies to interference edge types. and interference edge types When the interference of target edge types is strong and the feature correlation is high, repeated cancellation will be more severe. Therefore, the interference redundancy is quantified by multiplying the three factors. The above formula is an example with two edge types interfering with the target edge type. The specific formula can be adjusted according to the actual number of interfering edges. For example, if there is only one interfering edge type, there is no feature overlap between multiple interfering edge types. Therefore, in this case, it can be set to... When there are three types of interference edges, the formula for calculating interference redundancy can be set as follows: , Interference edge type Interference weights, Interference edge type With interference edge type The degree of correlation between the features, Interference edge type With interference edge type The degree of correlation between the features.
[0090] After obtaining the interference cancellation amount and interference redundancy amount, the basic assignment probability is corrected based on these amounts. The corrected global assignment probability for the target edge type is then obtained as follows: , For target edge type global attribution probability of the target edge type, base attribution probability of the target edge type, base attribution probability of the target edge type, interference cancellation amount of the base attribution probability of the target edge type caused by the jth interference edge type, number of interference edge types, interference redundancy, extremely small positive number, for example, the empirical value can be 0.001, used to avoid the denominator being 0.
[0091] It should be noted that due to the complexity of the image scene, in the extreme interference case, the correction value calculated by the above formula may exceed the conventional interval defined by the probability. In order to ensure the physical meaning of the probability index, the embodiment of the present application introduces a boundary constraint mechanism.
[0092] Specifically, after calculating the value of , the following judgment is performed: if , then is forced to be; if , then is forced to be. In addition, for the interference redundancy , in order to prevent the value from diverging due to the denominator being too small, the upper threshold (for example, 0.95) of is set, that is, when the calculated , take .
[0093] It should be noted that since the core relationship between the interference edge type and the target edge type is "mutually exclusive", for a certain pixel point, the higher the attribution probability of the target edge type, the lower the attribution probability of the interference edge type (because the pixel cannot belong to both types of mutually exclusive edges with high probability). Therefore, in most cases, the value of calculated by weighting the base attribution probability of each pixel point, and the value of obtained by weighting and superimposing the interference effect, satisfy , which embodies the "probability distribution of mutually exclusive features" idea, that is, the main part of the probability allocated to the target edge type is usually greater than the sum of the interference part that can be reduced. However, in actual calculation, due to and are aggregated through different feature weight paths (the former mainly depends on the spatial position weight, and the latter depends on the mutual exclusion relationship and pathological correlation coefficient), in a small number of data distributions, the numerical calculation may result in slightly greater than , in order to ensure the rigor of the mathematical model and the absolute robustness of the algorithm, the above formula adopts The operation ensures that when the numerical estimation of the interference cancellation amount exceeds the basic attribution probability, the global attribution probability of the target is reasonably set to zero, thereby ensuring that the result always has a meaningful non-negative probability interpretation. In addition, represents the reduction of the attribution probability of the interference edge type to the target edge type, is used to correct part of the reduction of the attribution probability of the target edge type in the presence of multiple interference edge types.
[0094] In the fourth step, the edge segmentation algorithm corresponding to the leaf region is determined according to the global attribution probability of each edge type.
[0095] In some embodiments, the global attribution probability of each edge type is normalized, for example, a maximum and minimum value normalization method can be used for normalization based on the historical maximum value and the historical minimum value of the global attribution probability, and then the edge segmentation algorithm corresponding to the edge type with the highest global attribution probability is determined as the dominant algorithm according to the sorting result of the normalized global attribution probability, and the edge segmentation algorithm corresponding to the edge type with the second highest global attribution probability is determined as the secondary algorithm. The correspondence between the edge type and the segmentation algorithm is set in advance, for example, the clear edge corresponds to “Canny edge detection + Sobel operator”, the fuzzy edge corresponds to “adaptive threshold Canny edge detection + Log operator”, and the intermittent edge corresponds to “morphological dilation connection + edge detection algorithm”.
[0096] Then, the difference degree between the global attribution probability corresponding to the dominant algorithm and the global attribution probability corresponding to the secondary algorithm is determined, wherein the difference degree can be determined by the difference between the global attribution probability corresponding to the dominant algorithm and the global attribution probability corresponding to the secondary algorithm, or by the ratio between the global attribution probability corresponding to the secondary algorithm and the global attribution probability corresponding to the dominant algorithm, which is not limited in the embodiments of the present application.
[0097] After obtaining the difference degree, if the difference degree is greater than or equal to a preset difference threshold (for example, the experience value can be 0.3), it is determined that the edge segmentation algorithm corresponding to the leaf region is the dominant algorithm; if the difference degree is less than the preset difference threshold, it is determined that the edge segmentation algorithm corresponding to the leaf region includes the dominant algorithm and the secondary algorithm.
[0098] In the fifth step, the dark band region and the bright region in the leaf region are determined based on the edge segmentation algorithm.
[0099] In some embodiments, if the edge segmentation algorithm only includes the dominant algorithm, the dominant algorithm is directly run to perform edge segmentation on the leaf region to obtain a segmentation result, wherein the pixel region marked as 1 is a suspected dark band region or a bright region, and the pixel region marked as 0 is a background or an interference region.
[0100] If the edge segmentation algorithm includes a primary algorithm and a secondary algorithm, the primary algorithm and the secondary algorithm are respectively run to obtain a first segmentation result and a second segmentation result; and the first segmentation result and the second segmentation result are fused to determine the dark band region and the bright region in the leaf region.
[0101] The fusion of the first segmentation result and the second segmentation result includes logical AND operation on the first segmentation result and the second segmentation result, and regions marked as 1 by both are directly reserved as the suspected dark band region or the suspected bright region. For regions marked as 1 only by the second segmentation result, isolated elements are filtered through morphological opening operation (using a 3*3 structure element), and then a gray threshold is calculated by Otsu algorithm, and regions with pixel gray values less than or greater than the gray threshold in the region are reserved as the suspected dark band region or the suspected bright region. For regions marked as 1 only by the first segmentation result, small holes are filled through morphological closing operation (using a 3*3 structure element), and then a gray threshold is calculated by Otsu algorithm, and regions with pixel gray values less than or greater than the gray threshold in the region are reserved as the suspected dark band region or the suspected bright region. Further, in the reserved suspected dark band region or suspected bright region, regions with gray values lower than the above-mentioned gray threshold are determined as the dark band region related to the leaf vein, and regions with gray values higher than the above-mentioned gray threshold are determined as the bright region related to the leaf mesophyll.
[0102] It can be understood that, in the embodiments of the present application, by extracting the gradient value and transition band width characteristics of the edge pixels in the leaf area, combining the preset clustering algorithm to cluster the edge pixels and match with the edge type template, determining the global attribution probability of each type of edge, and then adapting the corresponding edge segmentation algorithm, the dark band area related to the leaf vein and the bright area related to the leaf pulp are finally accurately divided, and the overall beneficial effects are that the accuracy, adaptability and reliability of the dark band and bright area division are significantly improved. The technical scheme can effectively distinguish clear edges, fuzzy edges, intermittent edges and pseudo edges by quantifying the core characteristics of the edge pixels and clustering and classifying, and can eliminate the pseudo edge interference irrelevant to the leaf vein, thereby avoiding the segmentation deviation caused by the inability to distinguish edge types in the traditional segmentation method; through the calculation and correction of the global attribution probability, the interference and redundancy between different edge types are fully considered, so that the matching of the edge segmentation algorithm is more suitable for the actual edge characteristics of the leaf area, which is suitable for leaf images under different light scenes such as sunny and cloudy days, and can also cope with the edge characteristic differences of healthy leaves and leaves in different disease stages; finally, through the adaptive edge segmentation algorithm and the result verification, the core area of the dark band and the bright area is accurately retained and the meaningless gray transition area is filtered, so that the boundary characteristics of the dark band and the bright area are clearer, which provides high-quality data support for the extraction of the gradient value and gradient direction of the boundary pixel points in the subsequent disease spot index calculation, and thus ensures the recognition accuracy of the whole jujube tree disease and pest identification method, and improves the accuracy and reliability of the disease and pest identification.
[0103] S204, determining a disease spot index of the leaf area according to the gradient value and gradient direction of the boundary pixel points on the junction of the dark band area and the bright area region.
[0104] As a possible implementation manner, first, the abnormal pixel points and the boundary pixel points of the pseudo edge type are excluded from the plurality of boundary pixel points, to obtain a plurality of effective boundary pixel points.
[0105] In some embodiments, based on the dark band area and bright area region binary mask determined in the above step S203, all pixel points located on the adjacent junction line of the two regions are accurately extracted through morphological dilation and logical exclusive or operation to constitute an initial boundary pixel point set, and then the pixel points in the set are screened, including excluding the pixel points determined as the "pseudo edge" type in the previous step, and using simple gray or connectivity analysis to eliminate obvious isolated noise points or small fragmented boundary segments, which are regarded as "abnormal pixel points", so as to obtain effective boundary pixel points.
[0106] It should be noted that after obtaining the set of effective boundary pixel points, target pixel points conforming to the pathological characteristics of "mottled light transmission" need to be screened out. The characteristics are that there is a significant gray level gradient mutation at the junction of the leaf vein (dark band) and the leaf mesophyll (bright area), and the mutation gradient direction should be approximately perpendicular to the leaf vein direction of the local region.
[0107] Further, since the jujube tree leaves have reticular or pinnate venation, the leaf vein direction varies significantly at different positions of the leaf, and using a globally uniform leaf vein direction for determination will lead to misjudgment. Therefore, the embodiment adopts the following local determination method based on sub-region division to divide the leaf region into multiple sub-regions, and for each sub-region, the local leaf vein direction of the sub-region is determined according to the gradient direction of all effective boundary pixel points located in the sub-region.
[0108] In some embodiments, the current analyzed leaf region image is divided into several rectangular sub-regions of the same size without overlapping. For example, the image can be uniformly divided into N parts in the width and height directions respectively to form a regular grid of N x N (such as 4 x 4, a total of 16 sub-regions). The size of the sub-region should be sufficient to contain a certain number of effective boundary pixel points for statistical analysis, and at the same time, it should be small enough to reflect the local change of the leaf vein direction. Further, for each sub-region divided, the Sobel operator is used to recalculate the gradient value and gradient direction of each effective boundary pixel point in a sub-region on the gray level image at that position. The gradient direction has a value range of [-180°, 180°], the [-180°, 180°] direction range is divided into multiple intervals (such as 36 intervals, each interval is 10°), the number of gradient directions of all pixel points falling in each interval is counted to form a gradient direction histogram, and the average direction represented by the interval with the highest frequency in the gradient direction histogram (such as the center direction of the interval) is determined as the local leaf vein direction of the sub-region.
[0109] Further screening of pest and disease pixels conforming to the characteristics of pests and diseases, pest and disease pixels are boundary pixels that exhibit "mottled light transmission" specific symptoms. The symptoms are that there is a significant gray level mutation at the junction of the leaf vein (dark band) and the leaf mesophyll (bright area), and the mutation gradient direction is approximately perpendicular to the leaf vein direction.
[0110] In some embodiments, the effective boundary pixel points with a gradient value greater than a preset gradient threshold and an included angle between the gradient direction and the local leaf vein direction of the sub-region within a preset angle range are determined as pest and disease pixels.
[0111] The preset gradient threshold value can be based on Otsu to process gradient values of the plurality of effective boundary pixel points, and the preset gradient threshold value is automatically found by calculating the inter-class variance, for example, in the analysis of a typical jujube tree leaf image, the threshold value is usually distributed in the gray scale gradient range of [20, 60], and then can be used for comparison with the gradient value of each effective boundary pixel point. The preset angle range is [90°-a, 90°+a] and [-90°-a, -90°+a], and a can be an empirical value of 5°, 10°, etc. If the gradient value of the effective boundary pixel point is greater than the preset gradient threshold value, and the included angle between the gradient direction and the local vein direction of the sub-region is within the preset angle range, it is determined that it is a disease and pest feature point.
[0112] It can be understood that by dividing the leaf area into a plurality of sub-regions, a reasonable local geometric reference (local vein direction) is adaptively provided for different parts of the leaf, thereby accurately capturing the disease gradient features perpendicular to the local vein structure, and significantly improving the accuracy and robustness of identification on complex netted vein sequence leaves.
[0113] Further, the disease spot index is determined according to the number of disease and pest pixel points and the number of effective boundary pixel points.
[0114] In some embodiments, the ratio of the number of disease and pest pixel points to the number of effective boundary pixel points multiplied by 100% to obtain a value, and the disease spot index is determined. The value of the disease spot index ranges from 0% to 100%, and the higher the value of the disease spot index, the more the part of the leaf area with disease and pest characteristics, and the more serious the disease degree.
[0115] It can be understood that in the embodiments of the present application, by first excluding abnormal pixel points and pseudo-edge pixel points from the boundary pixel points at the junction of the dark band and the bright area, then determining the vein direction based on the gradient direction of the effective boundary pixel points, and then screening out the disease and pest pixel points with gradient value meeting the standard and gradient direction approximately perpendicular to the vein direction, finally determining the disease spot index according to the number of disease and pest pixel points and the number of effective boundary pixel points, the accuracy, reliability and relevance to disease and pest pathological characteristics of the disease spot index are significantly improved, providing a high-quality quantitative basis for subsequent disease and pest determination.
[0116] S205, in the case that the disease spot index of the leaf area is greater than the preset disease and pest threshold value, it is determined that the leaf area has been infected with disease and pests.
[0117] In some embodiments, the preset disease and pest threshold value is set in advance according to a large number of sample analysis. The setting steps are as follows:
[0118] Sample construction: A large-scale, representative image sample library of jujube leaves is collected. The library contains images of healthy leaves, early disease leaves, medium and late disease leaves taken under various environmental conditions (different light, weather, season), and accurate labeling is performed.
[0119] Feature extraction and index calculation: The method described in steps S201-S204 of the embodiment of the application is used to process each leaf area in the sample library and calculate the corresponding disease spot index value.
[0120] Statistical analysis: According to the labeled true value (whether or not diseased), all sample calculated disease spot index values are divided into "diseased group" and "healthy group". By analyzing the distribution of disease spot index values of the two groups (such as drawing a distribution histogram), an optimal threshold is found, so that the determination based on the threshold can maximize the distinction between the two groups of samples, that is, high recognition rate (high recall rate) and low false positive rate (high precision rate) are achieved at the same time. Common determination methods include maximizing Youden's index or setting an acceptable minimum recall rate / precision rate target.
[0121] Threshold solidification: The optimal threshold obtained by statistical analysis is solidified as the preset disease threshold used by the system during operation. Once the threshold is set, it is consistently used in all subsequent online identification tasks, ensuring the consistency, objectivity and repeatability of the determination standard. For example, through analysis of historical data of jujube trees of a certain variety in a certain area, the threshold is usually set between 60% and 85%, for example, a commonly used initial reference value is 75%.
[0122] In some embodiments, according to the determination result of each leaf area, labeling is performed on the original image for visual display. Multiple labeled images can also be combined for visualization of disease occurrence and spatial diffusion in the entire jujube garden.
[0123] It can be understood that, in the jujube tree disease and pest identification method based on unmanned aerial vehicle inspection image provided by the embodiment of the application, taking the crown layer original image efficiently obtained by the unmanned aerial vehicle as the starting point, the complex field scene is first converted into independent, pure and target-specific analysis units through standardized preprocessing and leaf region extraction, thereby laying a solid foundation for subsequent fine analysis. The conventional features relying only on color abnormalities or macroscopic morphological variations, which are easily disturbed, are abandoned, and the boundary texture characteristics of "dark bands" and "bright areas" related to the internal and vein structure of the leaf are excavated and quantified, and the "disease spot index" is defined based on the gradient value and direction of the boundary pixel points. This method can sensitively capture early and subtle gray texture changes such as jujube disease "mottling and light transmission". Finally, by comparing the calculated objective quantitative index with the preset threshold, the automatic and standardized determination of the presence or absence of diseases and pests is realized. Therefore, not only the operation efficiency and range coverage capability of large-scale jujube orchard inspection are greatly improved, but more importantly, it focuses on more stable and essential pathological texture features and implements quantitative analysis, thereby significantly enhancing the recognition accuracy and reliability of early diseases and diseases in complex scenes, thereby providing strong technical support for early warning and precise prevention and control of diseases and pests.
[0124] It should be noted that the above-mentioned sequence of the embodiments of the application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0125] Each of the embodiments in the specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments.
Claims
1. A method for identifying diseases and pests of jujube trees based on images from unmanned aerial vehicle (UAV) inspection, characterized in that, The method comprises: acquiring an original image containing a jujube tree leaf area collected by a UAV, and preprocessing the original image to obtain a gray image; extracting at least one leaf area from the gray image; for each leaf area, extracting a plurality of edge pixel points according to the gray information of each pixel point in the leaf area, and determining the gradient value and transition band width of each edge pixel point, the gradient value being used to represent the gray change intensity at the edge pixel point, and the transition band width being used to represent the pixel span in the gradient direction of the edge pixel point, in which the gray value transitions from a relatively low value state to a relatively high value state; using a preset clustering algorithm to cluster the plurality of edge pixel points according to the gradient value and transition band width of each edge pixel point; matching the clusters obtained by clustering with a preset edge type template to determine the edge type corresponding to each cluster, and obtaining a plurality of edge types existing in the leaf area, the edge types including clear edges, fuzzy edges, intermittent edges and pseudo edges; determining the global attribution probability of each edge type in the leaf area; determining the edge segmentation algorithm corresponding to the leaf area according to the global attribution probability of each edge type; determining the dark band area and the bright area in the leaf area based on the edge segmentation algorithm; determining the lesion index of the leaf area according to the gradient value and gradient direction of the boundary pixel points on the junction of the dark band area and the bright area; in the case that the lesion index of the leaf area is greater than a preset disease and pest threshold, determining that the leaf area has been infected by diseases and pests. 2.The jujube tree disease and pest identification method based on UAV inspection images of claim 1, characterized in that, extracting at least one leaf area from the gray image, comprising: processing the gray image by using a preset region extraction algorithm, the preset region extraction algorithm being used to separate a complete leaf area from a background area by identifying the contour features and gray distribution range of the leaf, the leaf area being an image area containing the complete form of the leaf without obvious background interference. 3.The jujube tree disease and pest recognition method based on UAV inspection images of claim 1, characterized in that, determining the global attribution probability of each edge type in the leaf area, comprising: determining the principal axis direction of the leaf area image; for a target edge type, determining the initial probability of each target pixel point belonging to the target edge type based on the gradient value and transition band width of each target pixel point, the target edge type being any one of the plurality of edge types existing in the leaf area, and the target pixel point being an edge pixel point included in the cluster corresponding to the target edge type; determining the basic attribution probability of the target edge type according to the initial probability corresponding to each target pixel point and the position weight of each target pixel point, the position weight being determined based on the vertical distance of the target pixel point to the principal axis direction; determining at least one interference edge type having an interference relationship with the target edge type; correcting the basic attribution probability based on the interference edge type to obtain the global attribution probability of the target edge type.
4. The jujube tree disease and pest identification method based on UAV inspection images according to claim 3, characterized in that, correcting the basic attribution probability based on the interference edge type, comprising: determining the interference weight of each interference edge type to the target edge type; According to the interference weight and the initial probability of each target pixel point belonging to the interference edge type, a disturbance offset of a basic belonging probability of the target edge type caused by the interference edge type is determined; According to the feature correlation degree between the interference edge types and the interference weight of each interference edge type, a disturbance redundancy is determined; According to the disturbance offset and the disturbance redundancy, the basic belonging probability is corrected.
5. The jujube tree disease and pest identification method based on UAV inspection images according to claim 4, characterized in that, The determination of the interference weight of each interference edge type to the target edge type comprises: For each interference edge type, a feature mutual exclusion relationship between the target edge type and the interference edge type is obtained according to a preset feature mutual exclusion relationship mapping; The vertical distance information of the edge pixel points belonging to the interference edge type to the main axis direction is obtained, and the pathological correlation coefficient of the interference edge type to the target edge type is determined according to the vertical distance information; The interference weight is determined according to the feature mutual exclusion relationship and the pathological correlation coefficient. 6.The method of claim 1, wherein, According to the global belonging probability of each edge type, the edge segmentation algorithm corresponding to the leaf region is determined, comprising: The global belonging probability of each edge type is normalized; According to the sorting result of the normalized global belonging probability, the edge segmentation algorithm corresponding to the edge type with the highest global belonging probability is determined as the dominant algorithm, and the edge segmentation algorithm corresponding to the edge type with the second highest global belonging probability is determined as the secondary algorithm; The difference degree between the global belonging probability corresponding to the dominant algorithm and the global belonging probability corresponding to the secondary algorithm is determined; In the case where the difference degree is greater than or equal to a preset difference threshold, the edge segmentation algorithm corresponding to the leaf region is determined as the dominant algorithm; In the case where the difference degree is less than the preset difference threshold, the edge segmentation algorithm corresponding to the leaf region comprises the dominant algorithm and the secondary algorithm.
7. The method of claim 6, wherein the method further comprises: In the case where the edge segmentation algorithm corresponding to the leaf region comprises the dominant algorithm and the secondary algorithm, the dark band region and the bright region in the leaf region are determined based on the edge segmentation algorithm, comprising: The dominant algorithm and the secondary algorithm are run respectively to obtain the first segmentation result and the second segmentation result; The dark band region and the bright region in the leaf region are determined by fusing the first segmentation result and the second segmentation result. 8.The method of claim 1, wherein, According to the gradient value and gradient direction of the boundary pixel points on the boundary between the dark band region and the bright region, the lesion index of the leaf region is determined, comprising: Excluding abnormal pixels and boundary pixels with pseudo edges from a plurality of boundary pixels to obtain a plurality of effective boundary pixels; The leaf region is divided into a plurality of sub-regions; For each sub-region, the local vein direction of the sub-region is determined according to the gradient direction of all effective boundary pixels located in the sub-region; The effective boundary pixel point is determined as a pest pixel point when the gradient value is greater than a preset gradient threshold and an angle between the gradient direction and the local vein direction of the sub-region is within a preset angle range; The disease spot index is determined according to the number of the pest pixel points and the number of the effective boundary pixel points.
9. A jujube tree disease and pest identification system based on unmanned aerial vehicle inspection images, characterized in that, The method comprises the following steps: An image acquisition unit is configured to acquire an original image containing a jujube tree leaf region collected by a UAV and to obtain a grayscale image by preprocessing the original image; A leaf region extraction unit is configured to extract at least one leaf region from the grayscale image; A region segmentation unit is configured to, for each leaf region, extract a plurality of edge pixel points according to grayscale information of each pixel point in the leaf region, and determine a gradient value and a transition band width of each edge pixel point, wherein the gradient value is used to represent the grayscale change intensity at the edge pixel point, and the transition band width is used to represent a pixel span in the gradient direction of the edge pixel point, in which the grayscale transitions from a relatively low value state to a relatively high value state; A preset clustering algorithm is used to cluster the plurality of edge pixel points according to the gradient value and the transition band width of each edge pixel point; Each cluster obtained by clustering is matched with a preset edge type template to determine an edge type corresponding to each cluster, and a plurality of edge types existing in the leaf region are obtained, wherein the edge types include a clear edge, a fuzzy edge, an intermittent edge, and a pseudo edge; A global attribution probability of each edge type in the leaf region is determined; An edge segmentation algorithm corresponding to the leaf region is determined according to the global attribution probability of each edge type; A dark band region and a bright region in the leaf region are determined based on the edge segmentation algorithm; A disease spot index determination unit is configured to determine a disease spot index of the leaf region according to a gradient value and a gradient direction of a boundary pixel point on a boundary between the dark band region and the bright region; A pest determination unit is configured to determine that the leaf region has been infected by pests when the disease spot index of the leaf region is greater than a preset pest threshold.
Citation Information
Patent Citations
Jujube tree disease and insect pest identification method and system combined with visual technology
CN120318698A
Agricultural pest early warning method and system based on big data
CN120339853A