An improved blind pixel detection method for infrared images of agricultural pests and diseases

By using the local directional integrated grayscale gradient deviation model and symbol consistency score in agricultural pest and disease infrared images, the confusion problem between blind pixel noise and thermal abnormality areas of pests and diseases is solved, and high-precision blind pixel detection is achieved.

CN120356157BActive Publication Date: 2025-09-26HOHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510828593.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-26
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

In existing infrared image detection of agricultural pests and diseases, blind pixel noise is easily confused with thermal abnormality areas of pests and diseases, resulting in misjudgment and irreversible smoothing, which destroys the identifiability of pests and diseases.

Method used

A 3×3 grayscale sliding window is used to extract grayscale eigenvalues, and a local directional comprehensive grayscale gradient deviation model is constructed. Combined with the directional entropy weight and symbol consistency score, the thermal anomaly areas of pests and diseases and potential blind pixel areas are distinguished, and further blind pixel detection is performed.

Benefits of technology

Effectively distinguish between thermal abnormality areas of pests and diseases and potential blind spot areas, reduce misjudgments, and improve the accuracy and reliability of blind spot detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356157B_ABST
    Figure CN120356157B_ABST
Patent Text Reader

Abstract

The present invention discloses an improved blind pixel detection method for infrared images of agricultural pests and diseases, which relates to the technical field of infrared image processing. Aiming at the spatial continuity characteristics of thermal anomaly areas of pests and diseases in agricultural scenes, the method of the present invention first constructs a local directional integrated grayscale gradient deviation model for agricultural pest and disease infrared images, thereby realizing the distinction between thermal anomaly areas of pests and diseases, potential blind pixel areas and other areas; then, a blind pixel detection method based on local directional grayscale gradient is adopted for the areas initially marked as potential blind pixels, so as to further accurately locate the blind pixels and finally complete the blind pixel detection; the local directional integrated grayscale gradient deviation model is used to distinguish the potential blind pixel areas based on the deviation degree of the directional integrated gradient distribution of the center-neighborhood window, and further, a symbol consistency scoring mechanism is introduced to effectively avoid the misjudgment of thermal anomaly areas of pests and diseases and potential blind pixel areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of infrared image processing technology, and in particular to an improved blind pixel detection method for agricultural pest and disease infrared images. Background Art

[0002] Infrared imaging technology, with its advantages of all-weather monitoring capabilities, large measurement range, and high sensitivity, has become one of the core methods for non-destructive detection of pests and diseases in modern agriculture. Agricultural thermal infrared cameras can accurately locate plant physiological abnormalities caused by pests and diseases, such as impaired transpiration and tissue necrosis, by capturing the thermal radiation distribution of target objects. However, due to limitations in detector manufacturing processes, the images output by agricultural thermal infrared cameras are generally subject to blind pixel noise, manifesting as local pixel response values ​​that significantly deviate from normal thermal radiation intensity. This noise can easily be confused with thermal anomalies of pests and diseases in subsequent image processing, leading to double misjudgment: blind pixels may be mistaken for thermal anomalies of pests and diseases, and conversely, thermal anomalies of pests and diseases may be mistakenly labeled as blind pixels, which in turn has a serious impact on subsequent blind pixel correction.

[0003] Current mainstream blind pixel detection algorithms, such as calibration-based blind pixel calibration and scene-based blind pixel detection, typically employ a global unified threshold strategy, identifying blind pixels based on the statistical characteristics of pixel responses across the entire image. However, in agricultural pest and disease scenarios, pathogen-infected plant tissue often exhibits the following typical thermal characteristics: 1) Infested areas experience localized overheating due to pest feeding, manifesting as high pixel output values ​​in these areas; 2) Infested areas often exhibit cold patches, manifesting as low pixel output values ​​in these areas. These thermal characteristics of pest and disease areas are easily classified as response anomalies by traditional blind pixel detection methods, resulting in numerous false positives. Furthermore, subsequent blind pixel correction irreversibly smooths these thermally anomalous areas, completely impairing their identifiability. Summary of the Invention

[0004] In order to solve the above technical problems, the present invention provides an improved blind pixel detection method for infrared images of agricultural pests and diseases, comprising the following steps:

[0005] S1. Obtain an infrared image of agricultural pests and diseases, and use a 3×3 grayscale sliding window to extract grayscale features of the image to obtain the grayscale change feature value of the central pixel;

[0006] S2. Calculate the grayscale change eigenvalues ​​of all pixels in the grayscale sliding window, and sum and average the grayscale change eigenvalues ​​obtained for all pixels in the window to obtain the grayscale gradient value of the window; calculate the grayscale gradient values ​​of all windows, and arrange and combine the grayscale gradient values ​​of all windows into a grayscale change matrix;

[0007] S3. Based on the grayscale change matrix, a 3×3 gradient sliding window is used to traverse the matrix. The gradient eigenvalues ​​in four directions within the eight neighborhoods of the window center value are calculated. Finally, the directional integrated gradient value of the center value of the gradient sliding window is calculated.

[0008] S4. Based on the directional comprehensive gradient value, the directional comprehensive gradient values ​​obtained in the four neighborhood directions of the window center are normalized into a probability distribution, and the directional entropy is calculated. The directional entropy quantifies the difference between the directional comprehensive gradient value of the center value of the gradient sliding window in the image and the comprehensive gradient values ​​of different directions through the dynamic weight distribution of the information entropy. According to the uniformity of the distribution of the directional comprehensive gradient value, the area of ​​directional entropy is divided into a high entropy area and a low entropy area. The corresponding directional entropy in the high entropy area is greater than 1.5, and the corresponding directional entropy in the low entropy area is less than 0.5.

[0009] S5. Adjust the entropy weight of each direction according to the value of the directional entropy to obtain the directional entropy weight of each direction;

[0010] S6. Calculate the weighted sign consistency score of the directional integrated gradient value of the center value of the gradient sliding window and the directional integrated gradient values ​​of the four neighboring directions, and determine the sign correlation between the directional integrated gradient value of the center value of the window and the directional integrated gradient values ​​of the four neighboring directions according to the numerical value of the weighted sign consistency score;

[0011] S7, combining the directional entropy weight value and the weighted symbol consistency score to obtain a local directional comprehensive grayscale gradient deviation model;

[0012] S8. For each grayscale sliding window, the window is divided into potential blind pixel areas, pest and disease thermal anomaly areas, and other areas using the calculation results of the local directional integrated grayscale gradient deviation model;

[0013] S9, performing blind pixel detection on the window marked as a potential blind pixel area using a blind pixel detection method based on local directional grayscale gradient;

[0014] S10. Repeat step S9 to perform blind pixel detection on all windows marked as potential blind pixel areas in the entire image to obtain a final blind pixel detection result.

[0015] The technical solution further defined in the present invention is:

[0016] Furthermore, in step S1, the grayscale value I(x, y) of the center pixel of the grayscale sliding window is used as the center, and the sum of the squares of the grayscale value differences of adjacent pixels in the four directions within the eight neighborhoods is calculated to obtain four values ​​H i 、V i , L i and R i, the four directions are horizontal, vertical, and two intersecting main diagonal and sub-diagonal directions; the average of the above four values ​​is taken as the grayscale change characteristic value g(x,y) of the central pixel, that is:

[0017] (1)

[0018] in,

[0019] (2)

[0020] (3)

[0021] (4)

[0022] (5)

[0023] Among them, I(x,y-1), I(x,y+1), I(x-1,y), I(x+1,y), I(x-1,y-1), I(x+1,y+1), I(x-1,y+1), I(x-1,y+1), and I(x+1,y-1) represent the grayscale values ​​of the pixels directly below, directly above, directly to the left, directly to the right, lower left, upper left, upper left, and lower right of the center pixel, respectively.

[0024] As described above, in the improved blind pixel detection method for infrared images of agricultural pests and diseases, in step S2, the grayscale change characteristic value g(x,y) of all pixels in the grayscale sliding window is calculated, and the g(x,y) values ​​obtained for all pixels in the window are summed and averaged to obtain the grayscale gradient value G(x,y) of the window, that is:

[0025] (6)

[0026] Among them, n is the sum of the pixels in the window, which is 9; finally, the G(x,y) values ​​of all windows are calculated, and the G(x,y) values ​​of all windows are arranged and combined into the grayscale variation matrix GM(x,y), where the number of rows and columns of GM(x,y) is m, and the value of m changes with the change of image resolution.

[0027] As described above, an improved blind pixel detection method for infrared images of agricultural pests and diseases is proposed. In step S3, based on the grayscale variation matrix GM(x,y), a 3×3 gradient sliding window is used to traverse the matrix, and the gradient eigenvalues ​​GM in the four directions within the eight neighborhoods are calculated using formulas (2) to (5) for the center value of the window. k , k=1,2,3,4, namely the gradient eigenvalues ​​in the horizontal direction, vertical direction, and two intersecting main diagonal directions and sub-diagonal directions; finally, the directional comprehensive gradient value GM of the center value of the gradient sliding window is obtained according to formula (1):m .

[0028] As described above, the improved blind pixel detection method for infrared images of agricultural pests and diseases, step S4 specifically includes the following sub-steps:

[0029] S4.1. Calculate the directional integrated gradient value GM corresponding to each grayscale gradient value G(x,y) in the window according to the method in step S3 m , and the GM obtained from the four neighborhood directions of the window center m The values ​​are normalized to the probability distribution P e :

[0030] (7)

[0031] Among them, GM di Represents the directional integrated gradient value of a certain direction in the four neighborhoods of the window center, i takes any one of 1, 2, 3, and 4, representing the four directions of the window center, respectively, up, down, left, and right;

[0032] S4.2, according to P e Get the directional entropy G e , the formula is:

[0033] (8)

[0034] Among them, G e The value range is [0,2]. According to the obtained G e The window is divided into high entropy area and low entropy area. The distribution interval of high entropy area is G e ∈[1.5,2], if the obtained G e If the value is within this interval, the window corresponds to a potential thermal anomaly area of ​​pests and diseases; the distribution interval of the low entropy area is G e ∈[0,0.5], if the obtained G e If the value is within this interval, the window corresponds to a potential blind pixel area.

[0035] As described above, in the improved blind pixel detection method for infrared images of agricultural pests and diseases, in step S5, the directional entropy weight The value range is [0,1], and the directional entropy weight The calculation formula is:

[0036] (9)

[0037] Among them, G M Indicates the maximum directional entropy, calculated by taking the four neighborhood directions, that is, G M =log24=2.

[0038] As described above, in the improved blind pixel detection method for agricultural pests and diseases infrared images, in step S6, if the direction integrated gradient value GM of the window center value is m GM with four neighboring directions m The value symbol correlation is consistent, that is, the weighted symbol consistency score C is greater than 0.6, which means that the area corresponds to a potential thermal anomaly area of ​​pests and diseases; if the GM of the window center value is m GM of value and four neighborhood directions m If the value-symbol correlation is weak, that is, the weighted symbol consistency score C is less than 0.3, it means that the region corresponds to a potential blind pixel region;

[0039] The calculation method of the weighted symbol consistency score C includes the following steps:

[0040] S6.1. Calculate the GM of the center value of the gradient sliding window m Gradient symbol of the value s c :

[0041] (10)

[0042] Among them, g i (x,y) represents GM m The grayscale eigenvalues ​​of the pixels in the eight neighboring directions of the window corresponding to the value except the central pixel;

[0043] S6.2. Calculate the GM of the four neighborhood directions of the window center value respectively m The gradient symbol corresponding to the value s k , the four neighborhood directions are the up, down, left and right directions of the window center value;

[0044] S6.3、S c With s k Compare the symbol consistency matching and obtain the weighted symbol consistency score C:

[0045] (11)

[0046] in, Represents the indicator function. When calculating the symbol consistency score, if the gradient symbol s in the kth direction k With s c If the signs are consistent, the count is increased by 1; if the signs are inconsistent, the original value is retained.

[0047] As described above, in the improved blind pixel detection method for infrared images of agricultural pests and diseases, in step S7, the calculation formula of the local direction integrated gray gradient deviation model GDM is:

[0048] (12)

[0049] Among them, μ represents the slope parameter, which is used to control the excessive steepness; C0 represents the offset threshold, which is used to match the minimum consistency requirement of the thermal anomaly area of ​​pests and diseases.

[0050] As described above, in the improved blind pixel detection method for infrared images of agricultural pests and diseases, in step S8, the results obtained by calculating the local direction integrated gray gradient deviation model GDM for all windows are averaged and the standard deviation is obtained to obtain the average deviation value. and standard deviation v l , as shown below:

[0051] (13)

[0052] (14)

[0053] Among them, GDM i Represents the value obtained by GDM for the corresponding grayscale sliding window. Each grayscale sliding window is classified according to this value. The classification result RE is shown in the following formula:

[0054] (15)

[0055] Among them, 0 indicates that the area is marked as a potential blind pixel area, and 1 indicates that the area is marked as a pest and disease thermal abnormality area; regional classification is achieved based on the dual judgment conditions. When the value obtained by the grayscale sliding window using GDM is greater than the blind pixel threshold , and the C value is less than 0.3, it is marked as a potential blind pixel area; when the value obtained by using GDM in the grayscale sliding window is greater than or equal to the thermal anomaly threshold of pests and diseases , and is less than or equal to the blind pixel threshold , and when the C value calculated by the window is greater than 0.6, it is marked as a pest and disease thermal anomaly area; when the value obtained by using GDM in the grayscale sliding window is less than the pest and disease thermal anomaly threshold When , it is classified as other areas and no processing is done.

[0056] As described above, in the improved blind pixel detection method for infrared images of agricultural pests and diseases, in step S9, the g(x,y) values ​​of all pixels in the four neighboring direction windows of the grayscale sliding window marked as potential blind pixel areas are calculated, and the g(x,y) values ​​obtained for all pixels in the four neighboring direction windows are averaged. and standard deviation v w , if the pixel g(x,y) value in the window marked as a potential blind pixel area is The difference is greater than 3 times v w , then the pixel is marked as 1, indicating that the pixel is a blind pixel; otherwise it is marked as 0, indicating that the pixel is a normal pixel. The formula is as follows:

[0057] (16)

[0058] Among them, g(x,y) represents the grayscale change characteristic value.

[0059] The beneficial effects of the present invention are:

[0060] (1) In this invention, the blind pixel noise in the infrared image of agricultural pests and diseases is easily confused with the thermal abnormality area of ​​agricultural pests and diseases. By constructing a local directional integrated grayscale gradient deviation model, the thermal abnormality area of ​​pests and diseases, the potential blind pixel area and other areas can be distinguished. Then, the blind pixel detection method based on the local directional grayscale gradient is used for the areas initially marked as potential blind pixels to further accurately locate the blind pixels, and finally the blind pixel detection is completed.

[0061] (2) In the present invention, the local directional comprehensive grayscale gradient deviation model is combined with the directional entropy weight and the symbol consistency score; based on the directional entropy weight of the center-neighborhood window, the degree of deviation of the directional comprehensive gradient distribution is obtained to distinguish the potential blind pixel area, and further by introducing the symbol consistency score mechanism, the misjudgment of the thermal abnormality area of ​​pests and diseases and the potential blind pixel area is effectively avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of the overall process of the present invention;

[0063] Figure 2 Schematic diagram of the eight-neighborhood direction of the central pixel of a 3×3 grayscale sliding window in an embodiment of the present invention;

[0064] Figure 3 Schematic diagram of eight neighborhood directions of the center of the gradient sliding window in an embodiment of the present invention;

[0065] Figure 4 Schematic diagram of the four neighborhood directions of the center of the gradient sliding window in an embodiment of the present invention. DETAILED DESCRIPTION

[0066] This embodiment provides an improved blind pixel detection method for agricultural pest and disease infrared images, such as Figure 1 As shown, the following steps are included:

[0067] S1. Obtain infrared images of agricultural pests and diseases, and use a 3×3 grayscale sliding window to extract grayscale features of the image.

[0068] Taking the grayscale value I(x,y) of the center pixel of the grayscale sliding window as the center, calculate the sum of the squares of the grayscale value differences of adjacent pixels in the four directions within the eight neighborhoods, and obtain four values ​​H respectively. i 、V i 、L i and R i ,like Figure 2 As shown, the four directions are horizontal, vertical, and two intersecting main diagonal and sub-diagonal directions; the average of the above four values ​​is taken as the grayscale change characteristic value g(x,y) of the central pixel, that is:

[0069] (17)

[0070] in,

[0071] (18)

[0072] (19)

[0073] (20)

[0074] (twenty one)

[0075] Among them, I(x,y-1), I(x,y+1), I(x-1,y), I(x+1,y), I(x-1,y-1), I(x+1,y+1), I(x-1,y+1), I(x-1,y+1), and I(x+1,y-1) represent the grayscale values ​​of the pixels directly below, directly above, directly to the left, directly to the right, lower left, upper left, upper left, and lower right of the center pixel, respectively.

[0076] S2. Calculate the grayscale change characteristic value g(x,y) of all pixels in the grayscale sliding window, and sum and average the g(x,y) values ​​obtained for all pixels in the window to obtain the grayscale gradient value G(x,y) of the window, that is:

[0077] (twenty two)

[0078] Wherein, n is the sum of the pixels in the window, and in this embodiment, n is 9; finally, the G(x, y) values ​​of all windows are calculated, and the G(x, y) values ​​of all windows are arranged and combined into a grayscale variation matrix GM(x, y), where the number of rows and columns of GM(x, y) is m, and the value of m varies with the change of image resolution.

[0079] S3. Based on the grayscale variation matrix GM(x,y), a 3×3 gradient sliding window is used to traverse the matrix. The gradient eigenvalues ​​GM in the four directions within the eight neighborhoods are calculated using formulas (18) to (21) for the center value of the window. k , k=1,2,3,4, such as Figure 3 As shown, the gradient eigenvalues ​​in the horizontal direction, vertical direction, and two intersecting main diagonal directions and sub-diagonal directions; finally, the directional comprehensive gradient value GM of the center value of the gradient sliding window is obtained according to formula (17): m .

[0080] S4, based on the direction integrated gradient value GM m , calculate the directional entropy G e ; G e Quantify the GM of the center value of the gradient sliding window in the image through the dynamic weight distribution of information entropy m The core idea is to divide the directional entropy region into high entropy region and low entropy region according to the uniformity of the distribution of directional comprehensive gradient values. The high entropy region indicates that the comprehensive gradient values ​​in each direction are evenly distributed, that is, the region corresponds to the obtained G e The value is relatively large, and in this embodiment it is set to be at least greater than 1.5; the low entropy area indicates that the comprehensive gradient value in a single direction is dominant, that is, the G obtained in this area e The value is relatively small, and in this embodiment is set to be less than 0.5.

[0081] First, calculate the GM corresponding to each G(x,y) value in the window according to the method in step S3 m value, and center the window as Figure 4 The GM obtained by the four neighborhood directions shown m The values ​​are normalized to the probability distribution P e :

[0082] (twenty three)

[0083] Among them, GM di It represents the directional comprehensive gradient value of a certain direction in the four neighborhoods of the window center. i takes any one of 1, 2, 3, and 4, representing the four directions of the window center, namely, up, down, left, and right.

[0084] Subsequently, according to P e Get the directional entropy G e , the formula is:

[0085] (twenty four)

[0086] Among them, G e The value range is [0,2]. According to the obtained G e The window is divided into high entropy area and low entropy area. The distribution interval of high entropy area is G e ∈[1.5,2], GM representing the window center value m The value and the comprehensive gradient value in four directions are highly uniformly distributed. If the G e If the value is within this interval, the window corresponds to a potential thermal anomaly area of ​​pests and diseases; the distribution interval of the low entropy area is G e ∈[0,0.5], GM representing the window center value m The value and the comprehensive gradient value in the four directions are unevenly distributed. If the Ge If the value is within this interval, the window corresponds to a potential blind pixel area.

[0087] S5. According to G e The value of the reverse direction adjusts the weight of each direction to highlight the comprehensive gradient value of the dominant direction to prevent the G obtained in a certain direction from being too high. e If the value is too large or too small, the accuracy of the calculation results will be affected; the directional entropy weight The value range is [0,1], and the directional entropy weight The calculation formula is:

[0088] (25)

[0089] Among them, G M Indicates the maximum directional entropy. In this embodiment, four neighborhood directions are used for calculation, that is, G M =log24=2; if the GM of the gradient sliding window center value m If the value is significantly greater than the comprehensive gradient value in other directions, the weight value in this direction will be reduced, that is, Small value to prevent G e The value is too large; if the directions are relatively balanced, the weight distribution tends to be even, that is, Value and G e The values ​​are close.

[0090] S6, calculate the GM of the center value of the gradient sliding window m GM with four neighboring directions m The weighted symbol consistency score C; if the direction of the window center value is the integrated gradient value GM m GM with four neighboring directions m The value sign correlation is relatively consistent, and the corresponding C value is large. In this embodiment, the C value is set to be greater than 0.6, which means that the area corresponds to a potential thermal abnormal area of ​​pests and diseases; if the GM of the window center value is m GM of value and four neighborhood directions m The value symbol has a weak correlation, and the corresponding C value is small. In this embodiment, the C value is set to be less than 0.3, which means that the area corresponds to a potential blind pixel area.

[0091] The correlation is determined by the size of the C value to prevent the single use of The value may lead to misjudgment of potential blind pixel areas and abnormal pest and disease thermal areas. The specific implementation steps of the weighted symbol consistency score C are as follows:

[0092] S6.1. Calculate the GM of the center value of the gradient sliding window m Gradient symbol of the value s c :

[0093] (26)

[0094] Among them, g i (x,y) represents GM m The grayscale eigenvalues ​​of the pixels in the eight neighborhood directions of the window corresponding to the value except the central pixel.

[0095] S6.2. Calculate the GM of the four neighborhood directions of the window center value respectively m The gradient symbol corresponding to the value s k , the four neighborhood directions are the up, down, left, and right directions of the window center value.

[0096] S6.3、S c With s k Compare the symbol consistency matching and obtain the weighted symbol consistency score C:

[0097] (27)

[0098] in, Represents the indicator function. When calculating the symbol consistency score, if the gradient symbol s in the kth direction k With s c If the signs are consistent, the count is increased by 1; if the signs are inconsistent, the original value is retained.

[0099] S7, combination The value and the weighted sign consistency score C are used to obtain the local direction comprehensive gray gradient deviation model GDM, which is calculated as follows:

[0100] (28)

[0101] Wherein, μ represents a slope parameter, which is used to control excessive steepness. In this embodiment, the value is set to 5. C0 represents an offset threshold, which is used to match the minimum consistency requirement of the thermal anomaly area of ​​pests and diseases. In this embodiment, the value is set to 0.7.

[0102] S8. For each grayscale sliding window, the calculation results of GDM can be used to divide the window into potential blind pixel areas, pest and disease thermal anomaly areas, and other areas.

[0103] To improve the classification accuracy, this embodiment averages and standard deviations the results obtained by GDM calculation for all windows to obtain the average deviation value. and standard deviation v l , as shown below:

[0104] (29)

[0105] (30)

[0106] Among them, GDMi Represents the value obtained by GDM for the corresponding grayscale sliding window. Each grayscale sliding window is classified according to this value. The classification result RE is shown in the following formula:

[0107] (31)

[0108] Among them, 0 indicates that the area is marked as a potential blind pixel area, and 1 indicates that the area is marked as a thermal abnormality area caused by pests and diseases. This embodiment implements regional classification based on the dual judgment condition. When the value obtained by the grayscale sliding window using GDM is greater than the blind pixel threshold , and when the C value is less than 0.3, it means that the gradient deviation of the window is high but the sign is confusing, and it is marked as a potential blind pixel area; when the value obtained by using GDM in the grayscale sliding window is greater than or equal to the thermal anomaly threshold of pests and diseases , and is less than or equal to the blind pixel threshold , and when the C value calculated by the window is greater than 0.6, it means that the gradient deviation of the window is small and the sign consistency is high, and it is marked as a pest and disease thermal anomaly area; when the value obtained by the grayscale sliding window using GDM is less than the pest and disease thermal anomaly threshold When , it is classified as other areas and no processing is done.

[0109] S9. Further perform accurate blind pixel detection on the window marked as a potential blind pixel area. This embodiment uses a blind pixel detection method based on local directional grayscale gradient. First, calculate the g(x,y) values ​​of all pixels in the four neighboring directional windows of the grayscale sliding window marked as the potential blind pixel area, and take the average of the g(x,y) values ​​obtained for all pixels in the four neighboring directional windows. and standard deviation v w , if the pixel g(x,y) value in the window marked as a potential blind pixel area is The difference is greater than 3 times v w , then the pixel is marked as 1, indicating that the pixel is a blind pixel; otherwise it is marked as 0, indicating that the pixel is a normal pixel. The formula is as follows:

[0110] (32)

[0111] Among them, g(x,y) represents the grayscale change characteristic value.

[0112] S10. Repeat step S9 to perform blind pixel detection on all windows marked as potential blind pixel areas in the entire image to obtain a final blind pixel detection result.

[0113] The method of this embodiment targets the spatial continuity characteristics of thermal anomaly areas of pests and diseases in agricultural scenes. For infrared images of agricultural pests and diseases, a local directional integrated grayscale gradient deviation model is first constructed to achieve the distinction between thermal anomaly areas of pests and diseases, potential blind pixel areas, and other areas. Subsequently, a blind pixel detection method based on local directional grayscale gradient is used for the areas initially marked as potential blind pixels to further accurately locate the blind pixels, and finally complete the blind pixel detection. The local directional integrated grayscale gradient deviation model is used to make judgments based on the degree of deviation of the directional integrated gradient distribution of the center-neighborhood window, and further by introducing a symbol consistency scoring mechanism, the misjudgment of thermal anomaly areas of pests and diseases and potential blind pixel areas is effectively avoided.

[0114] In addition to the above embodiments, the present invention may also have other implementations. Any technical solution formed by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. An improved blind pixel detection method for infrared images of agricultural pests and diseases, characterized by: The following steps are involved: S1. Obtain an infrared image of agricultural pests and diseases, and use a 3×3 grayscale sliding window to extract grayscale features of the image to obtain the grayscale change feature value of the central pixel; S2. Calculate the grayscale change characteristic values ​​of all pixels in the grayscale sliding window, and sum and average the grayscale change characteristic values ​​obtained for all pixels in the window to obtain the grayscale gradient value of the window; Calculate the grayscale gradient values ​​of all windows and arrange and combine the grayscale gradient values ​​of all windows into a grayscale change matrix; S3. Based on the grayscale change matrix, a 3×3 gradient sliding window is used to traverse the matrix. The gradient eigenvalues ​​in four directions within the eight neighborhoods of the window center value are calculated. Finally, the directional integrated gradient value of the center value of the gradient sliding window is calculated. S4. Based on the directional comprehensive gradient value, the directional comprehensive gradient values ​​obtained in the four neighborhood directions of the window center are normalized into a probability distribution, and the directional entropy is calculated. The directional entropy quantifies the difference between the directional comprehensive gradient value of the center value of the gradient sliding window in the image and the comprehensive gradient values ​​of different directions through the dynamic weight distribution of the information entropy. According to the uniformity of the distribution of the directional comprehensive gradient value, the area of ​​directional entropy is divided into a high entropy area and a low entropy area. The corresponding directional entropy in the high entropy area is greater than 1.5, and the corresponding directional entropy in the low entropy area is less than 0.

5. S5. Adjust the entropy weight of each direction according to the value of the directional entropy to obtain the directional entropy weight of each direction; S6. Calculate the weighted sign consistency score of the directional integrated gradient value of the center value of the gradient sliding window and the directional integrated gradient values ​​of the four neighboring directions, and determine the sign correlation between the directional integrated gradient value of the center value of the window and the directional integrated gradient values ​​of the four neighboring directions according to the numerical value of the weighted sign consistency score; S7, combining the directional entropy weight value and the weighted symbol consistency score to obtain a local directional comprehensive grayscale gradient deviation model; S8. For each grayscale sliding window, the window is divided into potential blind pixel areas, pest and disease thermal anomaly areas, and other areas using the calculation results of the local directional integrated grayscale gradient deviation model; S9, performing blind pixel detection on the window marked as a potential blind pixel area using a blind pixel detection method based on local directional grayscale gradient; S10. Repeat step S9 to perform blind pixel detection on all windows marked as potential blind pixel areas in the entire image to obtain a final blind pixel detection result.

2. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S1, the grayscale value I(x, y) of the center pixel of the grayscale sliding window is taken as the center, and the sum of the squares of the grayscale value differences of adjacent pixels in four directions in the eight neighborhoods is calculated to obtain four values ​​H respectively. i 、V i , L i and R i , the four directions are horizontal, vertical, and two intersecting main diagonal and sub-diagonal directions; the average of the above four values ​​is taken as the grayscale change characteristic value g(x,y) of the central pixel, that is: (1) in, (2) (3) (4) (5) Among them, I(x,y-1), I(x,y+1), I(x-1,y), I(x+1,y), I(x-1,y-1), I(x+1,y+1), I(x-1,y+1), I(x-1,y+1), and I(x+1,y-1) represent the grayscale values ​​of the pixels directly below, directly above, directly to the left, directly to the right, lower left, upper left, upper left, and lower right of the center pixel, respectively.

3. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S2, the grayscale change characteristic value g(x,y) of all pixels in the grayscale sliding window is calculated, and the g(x,y) values ​​obtained for all pixels in the window are summed and averaged to obtain the grayscale gradient value G(x,y) of the window, that is: (6) Among them, n is the sum of the pixels in the window, which is 9; finally, the G(x,y) values ​​of all windows are calculated, and the G(x,y) values ​​of all windows are arranged and combined into the grayscale variation matrix GM(x,y), where the number of rows and columns of GM(x,y) is m, and the value of m changes with the change of image resolution.

4. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 2, characterized in that: In step S3, based on the grayscale variation matrix GM(x,y), a 3×3 gradient sliding window is used to traverse the matrix, and the gradient eigenvalues ​​GM in the four directions within the eight neighborhoods are calculated using formulas (2) to (5) for the window center value. k , k=1,2,3,4, namely the gradient eigenvalues ​​in the horizontal direction, vertical direction, and two intersecting main diagonal directions and sub-diagonal directions; Finally, according to formula (1), the directional comprehensive gradient value GM of the center value of the gradient sliding window is obtained m .

5. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: The step S4 specifically includes the following sub-steps: S4.

1. Calculate the directional integrated gradient value GM corresponding to each grayscale gradient value G(x,y) in the window according to the method in step S3 m , and the GM obtained from the four neighborhood directions of the window center m The values ​​are normalized to the probability distribution P e : (7) Among them, GM di Represents the directional integrated gradient value of a certain direction in the four neighborhoods of the window center, i takes any one of 1, 2, 3, and 4, representing the four directions of the window center, respectively, up, down, left, and right; S4.2, according to P e Get the directional entropy G e , the formula is: (8) Among them, G e The value range is [0,2]. According to the obtained G e The window is divided into high entropy area and low entropy area. The distribution interval of high entropy area is G e ∈[1.5,2], if the obtained G e If the value is within this interval, the window corresponds to a potential thermal anomaly area of ​​pests and diseases; the distribution interval of the low entropy area is G e ∈[0,0.5], if the obtained G e If the value is within this interval, the window corresponds to a potential blind pixel area.

6. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S5, the directional entropy weight The value range is [0,1], and the directional entropy weight The calculation formula is: (9) Among them, G M Indicates the maximum directional entropy, calculated by taking the four neighborhood directions, that is, G M =log24=2.

7. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S6, if the direction comprehensive gradient value GM of the window center value is m GM with four neighboring directions m The value symbol correlation is consistent, that is, the weighted symbol consistency score C is greater than 0.6, which means that the area corresponds to a potential thermal anomaly area of ​​pests and diseases; if the GM of the window center value is m GM of value and four neighborhood directions m If the value-symbol correlation is weak, that is, the weighted symbol consistency score C is less than 0.3, it means that the region corresponds to a potential blind pixel region; The calculation method of the weighted symbol consistency score C includes the following steps: S6.

1. Calculate the GM of the center value of the gradient sliding window m Gradient symbol of the value s c : (10) Among them, g i (x,y) represents GM m The grayscale eigenvalues ​​of the pixels in the eight neighboring directions of the window corresponding to the value except the central pixel; S6.

2. Calculate the GM of the four neighborhood directions of the window center value respectively m The gradient symbol corresponding to the value s k , the four neighborhood directions are the up, down, left and right directions of the window center value; S6.3、S c With s k Compare the symbol consistency matching and obtain the weighted symbol consistency score C: (11) in, Represents the indicator function. When calculating the symbol consistency score, if the gradient symbol s in the kth direction k With s c If the signs are consistent, the count is increased by 1; if the signs are inconsistent, the original value is retained.

8. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S7, the calculation formula of the local direction comprehensive gray gradient deviation model GDM is: (12) Among them, μ represents the slope parameter, which is used to control the excessive steepness; C0 represents the offset threshold, which is used to match the minimum consistency requirement of the thermal anomaly area of ​​pests and diseases.

9. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S8, the average and standard deviation of the results calculated by the local direction integrated gray gradient deviation model GDM for all windows are taken to obtain the average deviation value. and standard deviation v l , as shown below: (13) (14) Among them, GDM i Represents the value obtained by GDM for the corresponding grayscale sliding window. Each grayscale sliding window is classified according to this value. The classification result RE is shown in the following formula: (15) Among them, 0 indicates that the area is marked as a potential blind pixel area, and 1 indicates that the area is marked as a pest and disease thermal abnormality area; regional classification is achieved based on the dual judgment conditions. When the value obtained by the grayscale sliding window using GDM is greater than the blind pixel threshold , and the C value is less than 0.3, it is marked as a potential blind pixel area; when the value obtained by using GDM in the grayscale sliding window is greater than or equal to the thermal anomaly threshold of pests and diseases , and is less than or equal to the blind pixel threshold , and when the C value calculated by the window is greater than 0.6, it is marked as a pest and disease thermal anomaly area; when the value obtained by using GDM in the grayscale sliding window is less than the pest and disease thermal anomaly threshold When , it is classified as other areas and no processing is done.

10. The improved blind pixel detection method for agricultural pest and disease infrared images according to claim 1, characterized in that: In step S9, the g(x,y) values ​​of all pixels in the four neighborhood direction windows of the grayscale sliding window marked as potential blind pixel areas are calculated, and the g(x,y) values ​​obtained for all pixels in the four neighborhood direction windows are averaged. and standard deviation v w , if the pixel g(x,y) value in the window marked as a potential blind pixel area is The difference is greater than 3 times v w , then the pixel is marked as 1, indicating that the pixel is a blind pixel; otherwise it is marked as 0, indicating that the pixel is a normal pixel. The formula is as follows: (16) Among them, g(x,y) represents the grayscale change characteristic value.

Citation Information

Patent Citations

  • Multi-band high-resolution remote sensing image segmentation method based on gray scale co-occurrence matrix

    CN103578110A

  • Blind pixel detection method for infrared image

    CN108805853A