A method for identifying and predicting crop leaf spots

By obtaining the three-channel value differences of crop leaf RGB images and the change characteristics of historical images, the real lesion area is identified and the diffusion speed is predicted. This solves the problems of unstable accuracy and environmental influence in crop leaf lesion identification, and achieves accurate lesion identification and timely prediction.

CN120526318BActive Publication Date: 2025-09-19XIAN ZHUOCHEN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511023724.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-09-19
Estimated Expiration
2045-07-24

AI Technical Summary

Technical Problem

Existing technologies have unstable accuracy when identifying and predicting foliar lesions on crops, are prone to misidentification and omission, and ignore the impact of environmental factors on the spread of lesions, resulting in poor prediction results.

Method used

By acquiring RGB images of crop leaf areas, the difference in three-channel values ​​is used to determine suspected lesion areas. The real lesion areas are identified by combining historical image change characteristics. The spread rate is predicted based on the severity of the lesions. DBSCAN clustering and edge rule degree analysis are used to distinguish lesions from leaf veins.

Benefits of technology

It improves the accuracy of identifying lesions on crop leaves, reduces the interference of environmental changes on identification, and can timely predict the spread rate of lesions to ensure the healthy growth of crops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120526318B_ABST
    Figure CN120526318B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a method for identifying and predicting lesions on crop leaves. The method obtains an RGB image of any monitoring image, records it as a target image, and obtains a leaf surface area in the target image; judges whether there is a suspected lesion area in the leaf surface area based on the difference in three-channel values ​​of each pixel point in the leaf surface area; if there is a suspected lesion area in the leaf surface area of ​​the target image, obtains the suspected lesion area in a historical target image that belongs to the same shooting position as the target image, and judges whether there is a real lesion area in the target image based on the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image; if there is a real lesion area in the target image, obtains the severity of the lesion in the target image based on the difference between the target image and the real lesion area in each historical target image, predicts the spread rate of the lesion, and takes preventive and control measures in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for identifying and predicting crop leaf spots. Background Art

[0002] Crop leaf lesions are primarily caused by infection by pathogenic microorganisms such as fungi and bacteria. These lesions not only damage crops, impacting yield and quality, but, if not promptly addressed, can spread and affect crop health across the entire region. Therefore, timely identification and prediction of foliar lesions and the implementation of appropriate control measures are crucial for ensuring healthy crop growth, yield, and quality. Because crops are typically cultivated over large areas, manual detection of foliar lesions is costly and inefficient. Existing technologies typically identify foliar lesions by regularly capturing images of crops and using image processing methods.

[0003] Existing methods for identifying and predicting crop leaf lesions often achieve automatic identification of lesions in images by annotating a large number of leaf lesion images. However, the leaf surface characteristics of different crops are different, and the spread of lesions will be restricted by leaf veins. Between crops with large differences in leaf surface characteristics, the same lesions may have large differences in morphology, resulting in unstable recognition accuracy of existing crop leaf lesion recognition methods for different crop leaf lesions, and prone to misidentification and missed recognition problems; and the spread rate of crop leaf lesions is not only related to the current severity of the lesions, but also closely related to the current environment, climate, etc. Existing lesion prediction methods often ignore the impact of the environment on the spread of lesions, resulting in poor prediction results when predicting the spread of crop leaf lesions in different environments.

[0004] Therefore, how to accurately identify leaf lesions on crops and accurately predict the spread rate of lesions has become an urgent problem that needs to be solved. Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides a method for identifying and predicting foliar lesions on crops to solve the problem of how to accurately identify foliar lesions on crops and accurately predict the spread rate of the lesions.

[0006] An embodiment of the present invention provides a method for identifying and predicting foliar lesions on crops, the method comprising the following steps:

[0007] For any monitoring image, obtain an RGB image of the monitoring image, record it as a target image, and obtain a leaf surface area in the target image;

[0008] Recording the intensity values ​​of the RGB color channels of each pixel in the target image as three-channel values, and judging whether there is a suspected diseased spot area in the leaf surface area of ​​the target image based on the difference in the three-channel values ​​of each pixel in the leaf surface area of ​​the target image;

[0009] If there is at least one suspected diseased spot area in the leaf surface area of ​​the target image, a preset number of historical target images that are taken at the same location as the target image are obtained, the suspected diseased spot area in each historical target image is obtained, and based on the change characteristics of the suspected diseased spot area in each historical target image and the suspected diseased spot area in the target image, it is determined whether there is a real diseased spot area in the target image;

[0010] If there is at least one real lesion area in the target image, the severity of the lesion in the target image is obtained based on the difference between the target image and the real lesion area in each historical target image, which is used to predict the lesion diffusion speed.

[0011] Preferably, judging whether there is a suspected diseased spot area in the leaf surface area in the target image based on the difference in three-channel values ​​of each pixel point in the leaf surface area in the target image includes:

[0012] The pixel points in the leaf area of ​​the target image are recorded as leaf pixels, and the color similarity between each two leaf pixels is obtained based on the difference in the three-channel values ​​between each two leaf pixels;

[0013] Dividing the leaf surface area in the target image into at least one connected domain according to the color similarity between every two leaf surface pixels;

[0014] For any connected domain, obtaining edge pixel points of the connected domain, and obtaining the degree of edge regularity of the connected domain according to the distribution characteristics of the edge pixel points of the connected domain;

[0015] According to the edge regularity degree of any connected domain, the lesion degree of any connected domain is obtained, and a lesion degree threshold is set. If the lesion degree of any connected domain is greater than the lesion degree threshold, the connected domain is confirmed as a suspected lesion area;

[0016] Merge two suspected lesion areas with the same pixel points into one suspected lesion area, obtain the number of suspected lesion areas in the target image, and if the number of suspected lesion areas in the target image is greater than or equal to 1, confirm that there is a suspected lesion area in the leaf surface area in the target image.

[0017] Preferably, obtaining the color similarity between every two leaf surface pixels according to the difference in the three-channel values ​​between every two leaf surface pixels includes:

[0018] For any two adjacent leaf pixels, the channel values ​​of the two leaf pixels in the same color channel are combined into a channel value combination. For any channel value combination, the absolute value of the difference between the channel values ​​of the two leaf pixels in the channel value combination is obtained, which is recorded as the channel value difference. The reciprocal of the sum of the channel value difference and a preset constant is obtained, which is recorded as the channel value similarity of the channel value combination.

[0019] Obtain the standard deviation of the channel values ​​of all leaf pixel points in different color channels respectively, obtain the product of the channel value similarity of any channel value combination and the channel value standard deviation of the same color channel, and obtain the channel color similarity of any channel value combination;

[0020] The channel color similarity of each channel value combination is obtained, and a corresponding channel color similarity cumulative value is obtained. The channel color similarity cumulative value is normalized to obtain the color similarity between the arbitrary two leaf surface pixels.

[0021] Preferably, the dividing of the leaf surface area in the target image into at least one connected domain according to the color similarity between every two leaf surface pixels comprises:

[0022] Sort the color similarities between every two leaf pixels in descending order to form a color similarity sequence, obtain the absolute value of the difference between each color similarity except the first color similarity and its previous color similarity in the color similarity sequence, record the degree of change of each color similarity, and record the color similarity with the largest degree of change as the color similarity threshold;

[0023] Two leaf surface pixels whose color similarity is greater than the color similarity threshold are divided into the same connected domain to obtain at least one connected domain.

[0024] Preferably, obtaining the edge regularity degree of any connected domain according to the distribution characteristics of the edge pixels of any connected domain includes:

[0025] Establishing a two-dimensional rectangular coordinate system with the lower left corner of the target image as the origin, the horizontal direction as the abscissa, and the vertical direction as the ordinate, and connecting the edge pixels of any connected region in the two-dimensional rectangular coordinate system to obtain a closed curve;

[0026] In the two-dimensional rectangular coordinate system, the slope of each edge pixel point on the closed curve is obtained, and the absolute value of the difference between the slopes of every two adjacent edge pixel points on the closed curve is obtained respectively, and the corresponding mean of the absolute values ​​of the differences is obtained. The reciprocal of the mean of the absolute values ​​of the differences is obtained as the edge regularity degree of any connected domain.

[0027] Preferably, obtaining the degree of lesions of any connected domain according to the degree of edge regularity of any connected domain includes:

[0028] Obtain the edge regularity degree of each connected domain, cluster the edge regularity degree of each connected domain using DBSCAN, obtain at least one cluster, and obtain the cluster with the largest edge regularity degree, which is recorded as the largest cluster;

[0029] The average value of the edge regularity of the largest cluster is obtained, and the difference between the average value of the edge regularity and the edge regularity of any connected domain is normalized to obtain the lesion degree of any connected domain.

[0030] Preferably, judging whether there is a real lesion area in the target image based on the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image includes:

[0031] Recording any suspected lesion area in the target image as a target lesion area; for any historical target image, mapping the suspected lesion area in the historical target image to the two-dimensional rectangular coordinate system; obtaining, in the historical target image, a suspected lesion area that overlaps with the target lesion area, and recording it as the historical target lesion area;

[0032] Obtaining the number of pixels in the overlapping area between each historical target lesion area and the target lesion area, recorded as the overlap number, obtaining the ratio of the overlap number to the number of pixels in each historical target lesion area, and obtaining the overlap degree of the target lesion area in any of the historical target images;

[0033] Obtaining the degree of overlap of the target lesion area in each historical target image, obtaining a corresponding cumulative value of the overlap, and normalizing the cumulative value of the overlap to obtain a true degree of the lesion in the target lesion area;

[0034] The true lesion degree of each target lesion area in the target image is obtained, and according to the true lesion degree of each target lesion area in the target image, it is determined whether there is a true lesion area in the target image.

[0035] Preferably, judging whether there is a real lesion area in the target image according to the real lesion degree of each target lesion area in the target image includes:

[0036] Setting a true lesion degree threshold, for any target lesion area, if the true lesion degree of any target lesion area is greater than the true lesion degree threshold, then confirming the target lesion area as a true lesion area;

[0037] The number of real lesion areas in the target image is obtained. If the number of real lesion areas in the target image is greater than or equal to 1, it is confirmed that there are real lesion areas in the target image.

[0038] Preferably, obtaining the severity of the lesion in the target image based on the difference between the target image and the actual lesion area in each historical target image includes:

[0039] Mapping the suspected lesion area in each historical target image to the two-dimensional rectangular coordinate system, and for any real lesion area in the target image, obtaining in each historical target image a suspected lesion area that overlaps with the real lesion area, and recording it as the historical real lesion area;

[0040] Sort the historical target images by shooting time, and obtain the growth degree of any real lesion area in each historical target image except the first historical target image based on the number of pixels in the historical real lesion area in each historical target image, to form a growth degree sequence;

[0041] Performing linear fitting on the growth degree sequence to obtain a linear fitting curve, obtaining the slope of the linear fitting curve and recording it as the growth trend value of any real lesion area, obtaining the growth trend value of each real lesion area in the target image, and correspondingly obtaining a mean of the growth trend values;

[0042] The number of real lesion areas in the target image is obtained, and the product of the number of real lesion areas in the target image and the mean value of the growth trend value is normalized to obtain the severity of the lesions in the target image.

[0043] Preferably, obtaining the growth degree of any real lesion area in each historical target image except the first historical target image based on the number of pixels of the historical real lesion area in each historical target image includes:

[0044] For any historical target image other than the first historical target image, obtain the difference in the number of pixels in the historical real lesion area between any historical target image and its previous historical target image, which is recorded as the number of increased pixels. Obtain the ratio of the number of increased pixels to the number of pixels in the historical real lesion area of ​​the previous historical target image of any historical target image to obtain the degree of growth of any real lesion area in any historical target image.

[0045] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0046] The present invention targets any monitoring image, obtains an RGB image of the any monitoring image, records it as a target image, and obtains a leaf surface area in the target image; records the intensity values ​​of each pixel point in the target image in the three RGB color channels as three-channel values, and judges whether there is a suspected diseased spot area in the leaf surface area of ​​the target image based on the difference in the three-channel values ​​of each pixel point in the leaf surface area in the target image; if there is at least one suspected diseased spot area in the leaf surface area of ​​the target image, obtains a preset number of historical target images belonging to the same shooting position as the target image, obtains the suspected diseased spot area in each historical target image, and judges whether there is a real diseased spot area in the target image based on the change characteristics of the suspected diseased spot area in each historical target image and the suspected diseased spot area in the target image; if there is at least one real diseased spot area in the target image, obtains the severity of the diseased spot in the target image based on the difference between the target image and the real diseased spot area in each historical target image, so as to predict the spread rate of the diseased spot. Among them, according to the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image, the real lesion area is identified, which can not only effectively solve the problem that the veins and lesions on the leaf surface of crops may have similar grayscale values ​​and are difficult to distinguish, but also avoid the interference of accidental factors such as dew on the accuracy of leaf lesion identification; at the same time, according to the difference between the target image and the real lesion area in each historical target image, the severity of the lesions in the target image is obtained, the spread rate of the lesions is predicted, and the impact of environmental changes on the analysis results of the spread rate of lesions is reduced, so that effective prevention and control measures can be taken in time. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 This is a flow chart of a method for identifying and predicting crop leaf lesions provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0049] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to be used to explain the present disclosure, but should not be understood as limiting the present disclosure.

[0050] It should be noted that the terms "first," "second," and the like in the specification of the present disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.

[0051] In order to illustrate the technical solution of the present invention, specific embodiments are provided below.

[0052] See also Figure 1 , is a flow chart of a method for identifying and predicting crop leaf lesions provided in the first embodiment of the present invention. Figure 1 As shown, the method may include:

[0053] Step S101 : for any monitoring image, obtain an RGB image of the monitoring image, record it as a target image, and obtain a leaf surface area in the target image.

[0054] Crop leaf lesions are primarily caused by infection by pathogenic microorganisms such as fungi and bacteria. These lesions not only damage crops, impacting yield and quality, but, if not promptly addressed, can spread and affect crop health across the entire region. Therefore, timely identification and prediction of foliar lesions and the implementation of appropriate control measures are crucial for ensuring healthy crop growth, yield, and quality. Because crops are typically cultivated over large areas, manual detection of foliar lesions is costly and inefficient. Existing technologies typically identify foliar lesions by regularly capturing images of crops and using image processing methods.

[0055] In this embodiment, multiple cameras are evenly installed around the crop growing area. The number of cameras is determined by the specific size of the crop growing area. The images captured by the cameras must be able to cover the current crop growing area. The cameras capture a crop image once a day. In order to reduce the impact of changes in lighting and other factors on the captured images, this embodiment stipulates that the cameras capture a fixed crop image at 9 a.m. every day, which is recorded as a monitoring image. There is no restriction here and it can be set according to the specific implementation scenario. Since the recognition method for each monitoring image is the same, this embodiment takes any monitoring image as an example to identify and predict the leaf spots of crops in any monitoring image.

[0056] Existing methods for identifying and predicting crop leaf lesions often achieve automatic identification of lesions in images by annotating a large number of leaf lesion images. However, the leaf surface characteristics of different crops are different, and the spread of lesions will be restricted by leaf veins. Between crops with large differences in leaf surface characteristics, the same lesions may have large differences in morphology, resulting in unstable recognition accuracy of existing crop leaf lesion recognition methods for different crop leaf lesions, and prone to misidentification and missed recognition problems; and the spread rate of crop leaf lesions is not only related to the current severity of the lesions, but also closely related to the current environment, climate, etc. Existing lesion prediction methods often ignore the impact of the environment on the spread of lesions, resulting in poor prediction results when predicting the spread of crop leaf lesions in different environments.

[0057] Therefore, in this embodiment, an RGB image of any monitoring image is obtained and recorded as a target image. First, the leaf area of ​​the crop in the target image is obtained to avoid interference of other areas in the image on the identification of leaf lesions. Then, the suspected lesion area is obtained. According to the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image, it is detected whether there is a real lesion area in the target image. Finally, when there is a real lesion area in the target image, the severity of the lesion in the target image is obtained, the spread speed of the lesion is predicted, and prevention and control measures are taken in time.

[0058] Since the shape, color and other features of different leaves of the same crop are highly similar, in this embodiment, artificial intelligence training is used based on the labeled images of crop leaves in the database to obtain a crop leaf recognition model, and the crop leaf recognition model is used to extract the leaf area in the currently captured target image. The use of artificial intelligence training to obtain a crop leaf recognition model and the use of the crop leaf recognition model to extract the leaf area are existing technologies and will not be repeated here.

[0059] In step S102, the intensity values ​​of the RGB three color channels of each pixel in the target image are recorded as three-channel values, and based on the differences in the three-channel values ​​of each pixel in the leaf area in the target image, it is determined whether there is a suspected diseased spot area in the leaf area in the target image.

[0060] Because the same lesion may not appear exactly the same on the leaves of different crops, depending on features such as leaf texture, for example, anthracnose typically appears as large, yellow-brown or gray-brown, spindle-shaped spots on corn leaves, while on tomato or cucumber leaves, they appear roughly circular or irregular. Therefore, it is difficult to identify lesions on the leaves of different crops based on fixed lesion characteristics. However, crops in the same region have consistent growth conditions, and the leaf surface characteristics of the same type of crops are similar. Normal crop leaves typically have uniform color and a natural transition, while lesions differ significantly from normal leaves in color and have relatively distinct edges. Therefore, the intensity values ​​of each pixel in the target image in the three RGB color channels can be recorded as three-channel values. Based on the differences in the three-channel values ​​of each pixel in the leaf area of ​​the target image, it can be determined whether there are suspected lesion areas in the leaf area of ​​the target image.

[0061] The method for determining whether there is a suspected diseased spot area in the leaf surface area of ​​the target image based on the difference in the three-channel values ​​of each pixel point in the leaf surface area of ​​the target image is as follows:

[0062] (1) The pixel points in the leaf area of ​​the target image are recorded as leaf pixels. Based on the difference in the three-channel values ​​between each two leaf pixels, the color similarity between each two leaf pixels is obtained.

[0063] Specifically, for any two adjacent leaf surface pixels, the channel values ​​of the two leaf surface pixels in the same color channel are combined into a channel value combination. For any channel value combination, the absolute value of the difference between the channel values ​​of the two leaf surface pixels in the channel value combination is obtained, recorded as the channel value difference. The reciprocal of the sum of the channel value difference and a preset constant is obtained, recorded as the channel value similarity of the channel value combination.

[0064] Since crop leaves are usually green, while lesions are yellow, brown, etc., in order to avoid the problem of difficulty in distinguishing between vein areas and lesion areas due to the lighter colors of some light green leaf veins and light yellow lesions, the standard deviation of the channel values ​​of all leaf pixel points in different color channels is obtained respectively, and the product of the channel value similarity of any channel value combination and the channel value standard deviation of the same color channel is obtained to obtain the channel color similarity of any channel value combination;

[0065] The channel color similarity of each channel value combination is obtained, and a corresponding channel color similarity cumulative value is obtained. The channel color similarity cumulative value is normalized to obtain the color similarity between the arbitrary two leaf surface pixels.

[0066] In one embodiment, taking the adjacent i-th leaf surface pixel and j-th leaf surface pixel as an example (the i-th leaf surface pixel belongs to the eight-neighborhood pixel of the j-th leaf surface pixel), the calculation formula for the color similarity between the i-th leaf surface pixel and the j-th leaf surface pixel is:

[0067]

[0068] in, is the color similarity between the i-th leaf pixel and the j-th leaf pixel; is the channel value of the i-th leaf pixel in the c-th color channel; is the channel value of the j-th leaf pixel in the c-th color channel; is the number of color channels; is the standard deviation of the channel values ​​of all leaf pixels in the cth color channel; is the normalization function; is the absolute value symbol; is a preset constant. In this embodiment, , used to ensure that the fraction is meaningful. There is no restriction here and it can be set according to the specific implementation scenario.

[0069] It should be noted that is the channel value similarity of the channel value combination composed of the channel values ​​of the i-th leaf pixel and the j-th leaf pixel in the c-th color channel, The smaller it is, the smaller the difference in channel value between the i-th leaf pixel and the j-th leaf pixel in the c-th color channel is, that is, the colors of the i-th leaf pixel and the j-th leaf pixel are closer. The bigger it is, the the bigger it is; The larger the value is, the more obvious the leaf surface features are under the cth color channel, that is, the better it can show the difference between diseased spots and normal leaves. The bigger it is.

[0070] (2) According to the color similarity between every two leaf pixels, the leaf area in the target image is divided into at least one connected domain.

[0071] Since the color of normal leaves is similar, the color similarities between adjacent leaf pixels are relatively close. However, there will be obvious color differences at the edge positions connecting the diseased spots and normal areas, and at the edge positions connecting the leaf veins and other areas. That is, the color similarity is significantly lower than the color similarity of leaf pixels in the same part. Therefore, the color similarities between every two leaf pixels are sorted in descending order to form a color similarity sequence. The absolute value of the difference between each color similarity except the first color similarity and its previous color similarity in the color similarity sequence is obtained respectively, and the degree of change of each color similarity is recorded. The color similarity with the largest degree of change is recorded as the color similarity threshold.

[0072] Two leaf surface pixels whose color similarity is greater than the color similarity threshold are divided into the same connected domain to obtain at least one connected domain.

[0073] (3) Obtain the edge regularity degree of each connected domain.

[0074] Since the veins on a normal leaf surface are usually not the same color as other leaf parts, the connected domain in the above step (2) also includes the vein area. In order to avoid misidentifying the veins as lesions, it is necessary to further distinguish between the veins and lesions. Since the shape of the lesions is usually irregular, and although the veins divide the entire leaf surface into multiple pieces, each branch of the veins extends in a fixed direction, the edge of the normal leaf surface is relatively regular and smooth. Therefore, for any connected domain, the edge pixel points of any connected domain can be obtained (that is, if a pixel point and its eight adjacent neighboring pixels are all in the same connected domain, this pixel point is a pixel point inside the connected domain, otherwise it is an edge pixel point of the connected domain). According to the distribution characteristics of the edge pixel points of any connected domain, the edge regularity of any connected domain is obtained to identify the suspected lesion area.

[0075] Specifically, a two-dimensional rectangular coordinate system is established with the lower left corner of the target image as the origin, the horizontal direction as the abscissa, and the vertical direction as the ordinate, and edge pixels of any connected region are connected in the two-dimensional rectangular coordinate system to obtain a closed curve;

[0076] In the two-dimensional rectangular coordinate system, the slope of each edge pixel point on the closed curve is obtained, and the absolute value of the difference between the slopes of every two adjacent edge pixel points on the closed curve is obtained respectively, and the corresponding mean of the absolute values ​​of the differences is obtained. The reciprocal of the mean of the absolute values ​​of the differences is obtained as the edge regularity degree of any connected domain.

[0077] In one embodiment, taking the u-th connected domain as an example, the calculation formula for the edge regularity degree of the u-th connected domain is:

[0078]

[0079] in, is the edge regularity degree of the u-th connected domain; is the slope of the d+1th edge pixel in the closed curve of the uth connected domain; is the slope of the d-th edge pixel in the closed curve of the u-th connected domain; is the number of edge pixels in the closed curve of the u-th connected domain; is the absolute value symbol.

[0080] It should be noted that Indicates the difference in slope between the d+1th edge pixel and the dth edge pixel in the closed curve of the uth connected domain. The smaller it is, the smaller the extension trend of the edge of the u-th connected domain is, that is, the more regular the edge is. The bigger it is.

[0081] According to the method for obtaining the edge regularity degree of the u-th connected component, the edge regularity degree of each connected component is obtained.

[0082] (4) According to the degree of edge regularity of each connected domain, the degree of lesions in each connected domain is obtained.

[0083] Since the edge regularity of the connected domains corresponding to normal leaf surfaces is similar, while the edge regularity of the diseased spots is relatively random, DBSCAN is used to cluster the edge regularity of each connected domain to obtain at least one cluster. The cluster with the largest edge regularity is obtained and recorded as the largest cluster. DBSCAN is a prior art and will not be described in detail here.

[0084] The average value of the edge regularity of the largest cluster is obtained, and the difference between the average value of the edge regularity and the edge regularity of any connected domain is normalized to obtain the lesion degree of any connected domain.

[0085] In one embodiment, taking the u-th connected domain as an example, the calculation formula for the lesion degree of the u-th connected domain is:

[0086]

[0087] in, is the degree of lesions in the u-th connected domain; is the edge regularity degree of the u-th connected domain; is the mean of the edge regularity of the largest cluster; is the normalization function.

[0088] It should be noted that Indicates the general level of regularity of the edges of the normal leaf surface connectivity domain, The larger the value is, the more likely it is that the edge regularity of the u-th connected domain has not reached the general level of the edge regularity of the normal leaf surface connected domain. The u-th connected domain is more likely to be a diseased area. The bigger it is.

[0089] Since the edge regularity of the connected domains corresponding to normal leaf surfaces is relatively close and is quite different from that of the lesion edges, in this embodiment, the lesion degree of each connected domain is obtained, and the median value is taken as the lesion degree threshold, that is, the lesion degree threshold is 0.5. There is no restriction here and it can be set according to the specific implementation scenario. If the lesion degree of the u-th connected domain is greater than 0.5, then the u-th connected domain is confirmed to be a suspected lesion area.

[0090] (5) According to the degree of diseased spots in each connected domain, determine whether there is a suspected diseased spot area in the leaf surface area of ​​the target image.

[0091] Specifically, the number of suspected diseased spot areas in the target image is obtained. If the number of suspected diseased spot areas in the target image is greater than or equal to 1, it is confirmed that there are suspected diseased spot areas in the leaf surface area in the target image.

[0092] Since some lesions may become darker brown in the center due to a long formation time, and appear light yellow at the edge (i.e., the newly spread location), when dividing the connected domain in the above step (2), one lesion area may be divided into two or more connected domains. Therefore, two suspected lesion areas with the same pixel points are merged into one suspected lesion area. That is, if there are multiple suspected lesion areas connected, the multiple connected suspected lesion areas are merged into one suspected lesion area, thereby obtaining all suspected lesion areas in the target image.

[0093] For example, if suspected lesion area A contains suspected lesion area B, then suspected lesion area A and suspected lesion area B are merged into one suspected lesion area; if suspected lesion area A contains suspected lesion area B and suspected lesion area C, then suspected lesion area A, suspected lesion area B and suspected lesion area C are merged into one suspected lesion area; if suspected lesion area A is connected to suspected lesion area B (that is, suspected lesion area A and suspected lesion area B have the same edge pixels), then suspected lesion area A and suspected lesion area B are merged into one suspected lesion area.

[0094] At this point, it is determined whether there is a suspected diseased spot area in the leaf surface area in the target image.

[0095] Step S103: If there is at least one suspected diseased spot area in the leaf surface area of ​​the target image, a preset number of historical target images that belong to the same shooting position as the target image are obtained, and the suspected diseased spot area in each historical target image is obtained. Based on the change characteristics of the suspected diseased spot area in each historical target image and the suspected diseased spot area in the target image, it is determined whether there is a real diseased spot area in the target image.

[0096] If at least one suspected lesion area exists within the target image's leaf surface, it indicates that lesions may be present on the crop leaves in the target image. However, since crop images may contain interfering factors with similar characteristics to lesions, such as reflections from water droplets on leaves or passing insects, the area in question may differ significantly in color from other leaf areas and exhibit significant variations in edge extension, potentially leading to it being mistakenly identified as a lesion. Therefore, further verification is needed to determine whether there are actual lesion areas within the target image, allowing for timely prevention and control measures when these areas appear.

[0097] If appropriate treatment measures are not taken after the appearance of leaf lesions, they may continue to grow and spread and will not disappear automatically. Other interfering factors are highly random and will not persist. Therefore, if the current suspected leaf lesion reappears in historical images, it is more likely to be a real leaf lesion. Therefore, a preset number of historical target images are obtained, taken from the same location (i.e., the same camera) as the target image. Using the above-mentioned method for determining suspected lesion areas, the suspected lesion areas in each historical target image are obtained. Based on the variation characteristics between the suspected lesion areas in each historical target image and the suspected lesion areas in the target image, the actual lesion extent of each suspected lesion area in the target image is determined. Based on the actual lesion extent of each suspected lesion area in the target image, the presence of a real lesion area in the target image is determined. Since crop morphology does not change significantly over a short period of time, in this embodiment, historical target images from the five days prior to the target image are obtained, i.e., the preset number is five. This number is not limited here and can be set according to the specific implementation scenario.

[0098] Among them, according to the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image, the method for obtaining the actual lesion degree of each suspected lesion area in the target image is as follows:

[0099] Recording any suspected lesion area in the target image as a target lesion area; for any historical target image, mapping the suspected lesion area in the historical target image to the two-dimensional rectangular coordinate system; obtaining, in the historical target image, a suspected lesion area that overlaps with the target lesion area, and recording it as the historical target lesion area;

[0100] Obtaining the number of pixels in the overlapping area between each historical target lesion area and the target lesion area, recorded as the overlap number, obtaining the ratio of the overlap number to the number of pixels in each historical target lesion area, and obtaining the overlap degree of the target lesion area in any of the historical target images;

[0101] The overlap of the target lesion area in each historical target image is obtained, and a corresponding overlap accumulation value is obtained. The overlap accumulation value is normalized to obtain the true lesion degree of the target lesion area.

[0102] In one embodiment, the bth suspected lesion area in the target image is recorded as the target lesion area, and the calculation formula for the actual lesion degree of the target lesion area is:

[0103]

[0104] in, is the actual lesion extent of the target lesion area; is the number of overlaps (i.e., the total number of all pixels in the overlapped area between each historical target lesion area and the target lesion area in the t-th historical target image); is the number of pixels in each historical target lesion area in the t-th historical target image (i.e., the total number of all pixels in all historical target lesion areas in the t-th historical target image); is the number of historical target images; is the normalization function.

[0105] It should be noted that is the overlap of the target lesion area in the tth historical target image. Since the lesion will only expand or remain unchanged but will not shrink by itself, the number of pixels contained in the target lesion area should be greater than or equal to the number of pixels in the historical target lesion area in the historical target image. The smaller it is, the less the number of overlaps in the overlap area is compared to the total number of all pixels in all historical target lesion areas in the t-th historical target image, and the less likely the target lesion area is to be the real lesion area. The smaller it is.

[0106] Because the target lesion area needs to have a high degree of overlap in multiple images to indicate that the target lesion area is a real lesion area, and interference factors usually only appear in a single image, the overlap varies greatly. Therefore, in this embodiment, the real lesion degree threshold is set to 0.5. If the real lesion degree of the target lesion area is greater than 0.5, the target lesion area is confirmed to be a real lesion area.

[0107] Furthermore, according to the above-mentioned method for obtaining the true lesion degree of the target lesion area, the true lesion degree of each target lesion area in the target image is obtained, and the number of true lesion areas in the target image is obtained. If the number of true lesion areas in the target image is greater than or equal to 1, it is confirmed that there are true lesion areas in the target image.

[0108] At this point, it is determined whether there is a real diseased spot area in the leaf surface area in the target image.

[0109] Step S104: If there is at least one real lesion area in the target image, the severity of the lesion in the target image is obtained based on the difference between the target image and the real lesion area in each historical target image, so as to predict the lesion diffusion speed.

[0110] Leaf lesions not only damage crops, affecting yield and quality, but if left untreated, the pathogen can spread, impacting crop health across the entire region. Therefore, if true lesions are present in the target image, they must be treated. However, leaf lesions may appear in multiple crop areas within a growing region, and resources for lesion control are limited, so appropriate control measures must be taken based on the severity of the lesions.

[0111] Since leaf lesions may continue to grow and spread after they appear, the severity of the lesions in the target image can be obtained based on the difference between the target image and the actual lesion area in each historical target image.

[0112] Among them, the method for obtaining the severity of the lesion in the target image based on the difference between the target image and the actual lesion area in each historical target image is as follows:

[0113] (1) According to the number of pixels in the historical real lesion area in each historical target image, the growth degree of each real lesion area in each historical target image except the first historical target image is obtained.

[0114] Specifically, the suspected lesion area in each historical target image is mapped to the two-dimensional rectangular coordinate system, and for any real lesion area in the target image, a suspected lesion area that overlaps with the real lesion area in each historical target image is obtained and recorded as the historical real lesion area;

[0115] The historical target images are sorted according to the shooting time. For any historical target image except the first historical target image, the difference in the number of pixels in the historical real lesion area between the any historical target image and the previous historical target image is obtained, which is recorded as the number of increased pixels. The ratio of the number of increased pixels to the number of pixels in the historical real lesion area of ​​the previous historical target image of the any historical target image is obtained to obtain the degree of growth of the any real lesion area in the any historical target image.

[0116] In one embodiment, taking the oth real lesion area in the target image and the tth historical target image as an example, the calculation formula for the growth degree of the oth real lesion area in the tth historical target image is:

[0117]

[0118] in, is the growth degree of the o-th real lesion area in the t-th historical target image; is the number of pixels in the historical real lesion area of ​​the oth real lesion area in the tth historical target image; is the number of pixels in the historical true lesion area of ​​the oth true lesion area in the t-1th historical target image.

[0119] It should be noted that To increase the number of pixels, The larger it is, the faster the o-th real lesion area grows in the t-th historical target image. The bigger it is.

[0120] (2) Obtain the severity of the lesions in the target image based on the growth degree of each real lesion area in each historical target image except the first historical target image and the number of real lesion areas in the target image.

[0121] Specifically, according to the above method for obtaining the growth degree of the o-th real lesion area and the t-th historical target image, the growth degree of each real lesion area in each historical target image except the first historical target image is obtained to form a growth degree sequence;

[0122] Using the least squares method, a linear fit is performed on the growth degree sequence to obtain a linear fitting curve. The least squares method belongs to the prior art and will not be described in detail here. The slope of the linear fitting curve is obtained and recorded as the growth trend value of any real lesion area. The growth trend value of each real lesion area in the target image is obtained, and the corresponding growth trend value mean is obtained.

[0123] The number of real lesion areas in the target image is obtained, and the product of the number of real lesion areas in the target image and the mean value of the growth trend value is normalized to obtain the severity of the lesions in the target image.

[0124] In one embodiment, the calculation formula for the severity of the lesion in the target image is:

[0125]

[0126] Where E is the severity of the lesion in the target image; Y is the number of real lesion areas in the target image; K is the mean of the growth trend value; is the normalization function.

[0127] It should be noted that the larger Y is, the more real lesion areas there are in the target image, and the larger E is; the larger K is, the faster the real lesion areas in the target image grow, and the larger E is.

[0128] The greater the severity of the lesions in the target image, the faster the lesions spread in the target image, and the more necessary it is to treat the crop growing area to which the target image belongs. Since the resources for the prevention and control of lesions are limited, the severity of the lesions in the target image taken by each camera around the crop growing area is obtained. The crop area with higher severity has a higher treatment priority. Combined with the current treatment resources, the lesions are treated in order of severity.

[0129] In summary, according to an embodiment of the present invention, for any monitoring image, an RGB image of the monitoring image is obtained, recorded as a target image, and a leaf surface area in the target image is obtained; the intensity values ​​of the three RGB color channels of each pixel in the target image are recorded as three-channel values, and based on the difference in the three-channel values ​​of each pixel in the leaf surface area in the target image, it is judged whether there is a suspected diseased spot area in the leaf surface area of ​​the target image; if there is at least one suspected diseased spot area in the leaf surface area of ​​the target image, a preset number of historical target images belonging to the same shooting position as the target image are obtained, and the suspected diseased spot areas in each historical target image are obtained. Based on the change characteristics of the suspected diseased spot areas in each historical target image and the suspected diseased spot areas in the target image, it is judged whether there is a real diseased spot area in the target image; if there is at least one real diseased spot area in the target image, the severity of the diseased spot in the target image is obtained based on the difference between the target image and the real diseased spot areas in each historical target image, so as to predict the spread rate of the diseased spot. Among them, according to the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image, the real lesion area is identified, which can not only effectively solve the problem that the veins and lesions on the leaf surface of crops may have similar grayscale values ​​and are difficult to distinguish, but also avoid the interference of accidental factors such as dew on the accuracy of leaf lesion identification; at the same time, according to the difference between the target image and the real lesion area in each historical target image, the severity of the lesions in the target image is obtained, the spread rate of the lesions is predicted, and the impact of environmental changes on the analysis results of the spread rate of lesions is reduced, so that effective prevention and control measures can be taken in time.

[0130] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A method for identifying and predicting crop leaf spots, characterized in that: The method comprises: For any monitoring image, obtain an RGB image of the monitoring image, record it as a target image, and obtain a leaf surface area in the target image; Recording the intensity values ​​of the three RGB color channels of each pixel in the target image as three-channel values, recording the pixels in the leaf area of ​​the target image as leaf pixels, and obtaining the color similarity between each two leaf pixels based on the difference in the three-channel values ​​between each two leaf pixels; dividing the leaf area in the target image into at least one connected domain based on the color similarity between each two leaf pixels; obtaining the edge pixels of any connected domain, and obtaining the degree of edge regularity of any connected domain based on the distribution characteristics of the edge pixels of any connected domain; Use DBSCAN to cluster the edge regularity of each connected domain to obtain at least one cluster, obtain the cluster with the largest edge regularity, record it as the largest cluster, obtain the mean edge regularity of the largest cluster, normalize the difference between the mean edge regularity and the edge regularity of any connected domain, obtain the diseased spot degree of any connected domain, set a diseased spot degree threshold, if the diseased spot degree of any connected domain is greater than the diseased spot degree threshold, then confirm that any connected domain is a suspected diseased spot area; merge two suspected diseased spot areas with the same pixel points into one suspected diseased spot area, obtain the number of suspected diseased spot areas in the target image, if the number of suspected diseased spot areas in the target image is greater than or equal to 1, then confirm that there is a suspected diseased spot area in the leaf surface area of ​​the target image; If there is at least one suspected diseased spot area in the leaf surface area of ​​the target image, a preset number of historical target images that are taken at the same location as the target image are obtained, the suspected diseased spot area in each historical target image is obtained, and based on the change characteristics of the suspected diseased spot area in each historical target image and the suspected diseased spot area in the target image, it is determined whether there is a real diseased spot area in the target image; If there is at least one real lesion area in the target image, the severity of the lesion in the target image is obtained based on the difference between the real lesion area in the target image and each historical target image, and used to predict the spread rate of the lesion, specifically including: For any real lesion area in the target image, in each historical target image, obtain a suspected lesion area that overlaps with the real lesion area and record it as the historical real lesion area; Sort the historical target images by shooting time, and obtain the growth degree of any real lesion area in each historical target image except the first historical target image based on the number of pixels in the historical real lesion area in each historical target image, to form a growth degree sequence; Performing linear fitting on the growth degree sequence to obtain a linear fitting curve, obtaining the slope of the linear fitting curve and recording it as the growth trend value of any real lesion area, obtaining the growth trend value of each real lesion area in the target image, and correspondingly obtaining a mean of the growth trend values; The number of real lesion areas in the target image is obtained, and the product of the number of real lesion areas in the target image and the mean value of the growth trend value is normalized to obtain the severity of the lesions in the target image.

2. A method for identifying and predicting crop leaf lesions according to claim 1, characterized in that: The step of obtaining the color similarity between each two leaf surface pixels according to the difference in the three-channel values ​​between each two leaf surface pixels includes: For any two adjacent leaf pixels, the channel values ​​of the two leaf pixels in the same color channel are combined into a channel value combination. For any channel value combination, the absolute value of the difference between the channel values ​​of the two leaf pixels in the channel value combination is obtained, which is recorded as the channel value difference. The reciprocal of the sum of the channel value difference and a preset constant is obtained, which is recorded as the channel value similarity of the channel value combination. Obtain the standard deviation of the channel values ​​of all leaf pixel points in different color channels respectively, obtain the product of the channel value similarity of any channel value combination and the channel value standard deviation of the same color channel, and obtain the channel color similarity of any channel value combination; The channel color similarity of each channel value combination is obtained, and a corresponding channel color similarity cumulative value is obtained. The channel color similarity cumulative value is normalized to obtain the color similarity between the arbitrary two leaf surface pixels.

3. The method for identifying and predicting crop leaf lesions according to claim 1, characterized in that: The step of dividing the leaf surface area in the target image into at least one connected domain according to the color similarity between every two leaf surface pixels comprises: Sort the color similarities between every two leaf pixels in descending order to form a color similarity sequence, obtain the absolute value of the difference between each color similarity except the first color similarity and its previous color similarity in the color similarity sequence, record the degree of change of each color similarity, and record the color similarity with the largest degree of change as the color similarity threshold; Two leaf surface pixels whose color similarity is greater than the color similarity threshold are divided into the same connected domain to obtain at least one connected domain.

4. The method for identifying and predicting crop leaf lesions according to claim 1, characterized in that: The step of obtaining the edge regularity of any connected domain according to the distribution characteristics of the edge pixels of any connected domain comprises: Establishing a two-dimensional rectangular coordinate system with the lower left corner of the target image as the origin, the horizontal direction as the abscissa, and the vertical direction as the ordinate, and connecting the edge pixels of any connected region in the two-dimensional rectangular coordinate system to obtain a closed curve; In the two-dimensional rectangular coordinate system, the slope of each edge pixel point on the closed curve is obtained, and the absolute value of the difference between the slopes of every two adjacent edge pixel points on the closed curve is obtained respectively, and the corresponding mean of the absolute values ​​of the differences is obtained. The reciprocal of the mean of the absolute values ​​of the differences is obtained as the edge regularity degree of any connected domain.

5. The method for identifying and predicting crop leaf lesions according to claim 4, characterized in that: The determining whether there is a real lesion area in the target image based on the change characteristics of the suspected lesion area in each historical target image and the suspected lesion area in the target image includes: Recording any suspected lesion area in the target image as a target lesion area; for any historical target image, mapping the suspected lesion area in the historical target image to the two-dimensional rectangular coordinate system; obtaining, in the historical target image, a suspected lesion area that overlaps with the target lesion area, and recording it as the historical target lesion area; Obtaining the number of pixels in the overlapping area between each historical target lesion area and the target lesion area, recorded as the overlap number, obtaining the ratio of the overlap number to the number of pixels in each historical target lesion area, and obtaining the overlap degree of the target lesion area in any of the historical target images; Obtaining the degree of overlap of the target lesion area in each historical target image, obtaining a corresponding cumulative value of the overlap, and normalizing the cumulative value of the overlap to obtain a true degree of the lesion in the target lesion area; The true lesion degree of each target lesion area in the target image is obtained, and according to the true lesion degree of each target lesion area in the target image, it is determined whether there is a true lesion area in the target image.

6. The method for identifying and predicting crop leaf lesions according to claim 5, characterized in that: The determining whether there is a real lesion area in the target image according to the real lesion degree of each target lesion area in the target image includes: Setting a true lesion degree threshold, for any target lesion area, if the true lesion degree of any target lesion area is greater than the true lesion degree threshold, then confirming the target lesion area as a true lesion area; The number of real lesion areas in the target image is obtained. If the number of real lesion areas in the target image is greater than or equal to 1, it is confirmed that there are real lesion areas in the target image.

7. The method for identifying and predicting crop leaf lesions according to claim 1, characterized in that: The step of respectively obtaining the growth degree of any one of the real lesion areas in each of the historical target images except the first historical target image based on the number of pixels of the historical real lesion area in each of the historical target images includes: For any historical target image other than the first historical target image, obtain the difference in the number of pixels in the historical real lesion area between any historical target image and its previous historical target image, which is recorded as the number of increased pixels. Obtain the ratio of the number of increased pixels to the number of pixels in the historical real lesion area of ​​the previous historical target image of any historical target image to obtain the degree of growth of any real lesion area in any historical target image.

Citation Information

Patent Citations

  • Fuzzy edge scab extraction method and device

    CN110895804A

  • Rapid detection method for garden plant disease and insect pest area

    CN117974989A