Improved blind pixel detection method for infrared images of agricultural diseases and insect pests

By constructing a local direction comprehensive grayscale gradient deviation model and weighted symbol consistency score, the confusion between blind element noise and pest and heat abnormal areas in agricultural pest and pest infrared images is solved, and precise positioning and accurate detection are achieved.

CN120356157AActive Publication Date: 2025-07-22HOHAI UNIV
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing infrared images of agricultural pests and diseases, blind element noise and pests and diseases are easily confused, resulting in misjudgment and irreversible smoothing, destroying the recognizability of pests and diseases.

Method used

A comprehensive grayscale gradient deviation model for local direction is constructed, and the characteristic value of grayscale change, direction entropy and weighted symbol consistency scores are used to distinguish between pest and pest thermal abnormalities, potential blind element areas and other areas, and precisely positioned with the local direction grayscale gradient method.

Benefits of technology

Effectively distinguish and accurately locate blind elements and pest and heat abnormal areas to avoid misjudgment, and improve the accuracy and reliability of pest and disease detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356157A_ABST
    Figure CN120356157A_ABST
Patent Text Reader

Abstract

The invention discloses an improved blind pixel detection method for an agricultural disease and insect pest infrared image, and relates to the technical field of infrared image processing, and the method comprises the steps: firstly constructing a local direction comprehensive gray gradient deviation model for the agricultural disease and insect pest infrared image according to the spatial continuity characteristics of a disease and insect pest thermal anomaly region in an agricultural scene; distinguishing of a pest and disease damage heat abnormal area, a potential blind pixel area and other areas is achieved. Performing further blind pixel accurate positioning on the blind pixel region which is preliminarily marked as potential by adopting a blind pixel detection method based on a local direction gray scale gradient, and finally completing blind pixel detection; the local direction comprehensive gray gradient deviation degree model carries out the discrimination of a potential blind pixel region based on the direction comprehensive gradient distribution deviation degree of a center-neighborhood window, and further effectively avoids the misjudgment of a pest and disease damage thermal anomaly region and the potential blind pixel region through introducing a symbol consistency scoring mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With its advantages such as all-weather monitoring ability, large measurement range and high sensitivity, infrared imaging technology has become one of the core means for non-destructive detection of agricultural pests and diseases. An agricultural thermal infrared camera can accurately locate plant physiological abnormalities caused by pests and diseases, such as blocked transpiration and tissue necrosis, by capturing the thermal radiation distribution of the target object. However, due to the limitations of detector manufacturing technology, the images output by agricultural thermal infrared cameras generally have blind pixel noise, which is manifested as the response value of local pixels deviating significantly from the normal thermal radiation intensity. Such noise is prone to be confused with the thermal abnormal areas of pests and diseases in subsequent image processing, resulting in double misjudgments: it may misidentify blind pixels as thermal abnormal areas of pests and diseases, or vice versa mislabel the thermal abnormal areas of pests and diseases as blind pixels, thus having a serious impact on subsequent blind pixel correction.

[0003] Current mainstream blind pixel detection algorithms, such as the blind pixel calibration method based on calibration and the blind pixel detection method based on the scene, usually adopt a global unified threshold strategy, that is, judging blind pixels based on the statistical characteristics of pixel response values within the entire image range. However, in the agricultural pest and disease scene, the plant tissues infected by pathogens often exhibit the following typical thermal characteristics: 1) The pest and disease area is locally overheated due to pest gnawing, and the image of this area shows a higher pixel output value; 2) Low-temperature patches often appear in the pest and disease area, and the image of this area shows a lower pixel output value. The above thermal characteristics of the pest and disease area are easily classified as response anomalies in traditional blind pixel detection methods, resulting in a large number of misjudgments in detection. More seriously, subsequent blind pixel correction will perform irreversible smoothing processing on these thermal abnormal areas of pests and diseases, completely destroying the identifiability of pests and diseases. Summary of the Invention

[0004] In order to solve the above technical problems, the present invention provides an improved blind pixel detection method for agricultural pest and disease infrared images, including the following steps: S1. Obtain an agricultural pest and disease infrared image, and use a 3×3 gray-scale sliding window to extract the gray-scale feature of the image to obtain the gray-scale change feature value of the central pixel; S2. Calculate the gray-scale change feature values of all pixels within the gray-scale sliding window, sum and average the gray-scale change feature values obtained for all pixels within the window to obtain the gray-scale gradient value of the window; calculate the gray-scale gradient values of all windows, and arrange and combine the gray-scale gradient values of all windows into a gray-scale change degree matrix; S3. Based on the gray-scale change degree matrix, use a 3×3 gradient sliding window to traverse the matrix, calculate the gradient eigenvalue in four directions within the eight-neighborhood of the window center value, and finally calculate the comprehensive gradient value of the direction of the window center value of the gradient sliding window; S4. According to the comprehensive gradient value of the direction, normalize the comprehensive gradient values of the directions obtained from the four-neighborhood directions of the window center into a probability distribution, and calculate the direction entropy; the direction entropy quantifies the difference between the comprehensive gradient value of the direction of the window center value in the image and the comprehensive gradient values of different directions through the dynamic weight allocation of information entropy. According to the uniformity of the distribution of the comprehensive gradient values of the direction, divide the area of the direction entropy into a high-entropy area and a low-entropy area. The corresponding direction entropy obtained in the high-entropy area is greater than 1.5, and the corresponding direction entropy obtained in the low-entropy area is less than 0.5; S5. Adjust the weights of each direction entropy according to the value of the direction entropy to obtain the weights of the direction entropy in each direction; S6. Calculate the weighted sign consistency score between the comprehensive gradient value of the direction of the window center value and the comprehensive gradient values of the four-neighborhood directions, and determine the sign correlation between the comprehensive gradient value of the direction of the window center value and the comprehensive gradient values of the four-neighborhood directions according to the numerical value of the weighted sign consistency score; S7. Combine the direction entropy weight value and the weighted sign consistency score to obtain a local comprehensive gray-scale gradient deviation model; S8. For each gray-scale sliding window, use the calculation result of the local comprehensive gray-scale gradient deviation model to divide the window into a potential blind pixel area, a pest and disease heat anomaly area, and other areas; S9. Use a blind pixel detection method based on local direction gray-scale gradient to detect blind pixels in the windows marked as potential blind pixel areas; S10. Repeat step S9 to detect blind pixels in all windows marked as potential blind pixel areas in the entire image to obtain the final blind pixel detection result.

[0005] The further limited technical solution of the present invention is: Further, in step S1, taking the gray-scale value I(x, y) of the central pixel of the gray-scale sliding window as the center, calculate the sum of the squares of the differences in the gray-scale values of adjacent pixels in four directions within the eight-neighborhood respectively, and obtain four values H i 、V i 、L i and R i , and the four directions are the horizontal direction, the vertical direction, and the two main diagonal directions and sub-diagonal directions of the two intersections; take the average of the above four values as the gray-scale change feature value g(x, y) of the central pixel, that is: (1) Among them, (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), and I(x + 1, y - 1) respectively represent the gray values of the pixels directly below, directly above, directly to the left, directly to the right, bottom left, top left, top right, and bottom right of the central pixel.

[0006] In an improved blind pixel detection method for agricultural pest and disease infrared images as described above, in step S2, the gray value change feature value g(x, y) of all pixels within the gray sliding window is calculated, and the g(x, y) values obtained for all pixels within the window are summed and averaged to obtain the gray gradient value G(x, y) of the window, that is: (6) Among them, n is the total number of pixels within 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 a gray value change degree 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 the image resolution.

[0007] In an improved blind pixel detection method for agricultural pest and disease infrared images as described above, in step S3, based on the gray value change degree matrix GM(x, y), a 3×3 gradient sliding window is used to traverse the matrix, and the gradient feature values GM k , k = 1, 2, 3, 4, that is, the gradient feature values in the horizontal direction, vertical direction, and the four directions of the two crossed main diagonals and sub - diagonals are calculated for the center value of the window using formulas (2) to (5) respectively; finally, the direction comprehensive gradient value GM m of the center value of the gradient sliding window is obtained according to formula (1).

[0008] In an improved blind pixel detection method for agricultural pest and disease infrared images as described above, step S4 specifically includes the following sub - steps: S4.1. Calculate the direction comprehensive gradient value GM m corresponding to each gray gradient value G(x, y) within the window according to the method of step S3, and normalize the GM m values obtained from the four - neighborhood directions of the window center into a probability distribution P e : (7) Among them, GMdi Represents the directional integrated gradient value in a certain direction in the four-neighborhood of the window center. i takes any one of 1, 2, 3, and 4, respectively representing the four directions of up, down, left, and right of the window center; S4.2. According to P e Obtain the directional entropy G e , the formula is: (8) Among them, the value range of G e is [0, 2]. According to the obtained G e value interval, the window is divided into a high-entropy region and a low-entropy region; the distribution interval of the high-entropy region is G e ∈[1.5, 2]. If the obtained G e value is within this interval, then this window corresponds to a potential pest and disease thermal anomaly region; the distribution interval of the low-entropy region is G e ∈[0, 0.5]. If the obtained G e value is within this interval, then this window corresponds to a potential blind pixel region.

[0009] As mentioned above, in an improved blind pixel detection method for agricultural pest and disease infrared images, in step S5, the directional entropy weight has a value range of [0, 1], and the calculation formula of the directional entropy weight is: (9) Among them, G M represents the maximum directional entropy, calculated by taking the four-neighborhood directions, that is, G M = log24 = 2.

[0010] As mentioned above, in an improved blind pixel detection method for agricultural pest and disease infrared images, in step S6, if the sign correlation between the directional integrated gradient value GM m of the window center value and the GM m values in the four-neighborhood directions is consistent, that is, the weighted sign consistency score C is greater than 0.6, it means that this region corresponds to a potential pest and disease thermal anomaly region; if the sign correlation between the GM m value of the window center value and the GM m values in the four-neighborhood directions is weak, that is, the weighted sign consistency score C is less than 0.3, it means that this region corresponds to a potential blind pixel region; The calculation method of the weighted sign consistency score C includes the following steps: S6.1. Calculate the gradient sign s m of the GM c value of the gradient sliding window center value: (10) Among them, gi (x, y) represents the GM m gray-scale feature values of the pixels in the eight-neighborhood directions except the central pixel in the window corresponding to the value; S6.2. Calculate the GM in the four-neighborhood directions of the window center value respectively m gradient symbol s corresponding to the value k , and the four-neighborhood directions are the four directions of up, down, left, and right of the window center value; S6.3. Compare the symbol consistency match degree between s c and s k to obtain the weighted symbol consistency score C: (11) where, represents the indicator function. When calculating the symbol consistency score, if the gradient symbol s k in the k-th direction is consistent with the symbol of s c , the count is incremented by 1; if the symbols are inconsistent, the original value is retained.

[0011] As described above, in an improved blind pixel detection method for agricultural pest infrared images, in step S7, the calculation formula of the local direction comprehensive gray-scale gradient deviation model GDM is: (12) where, μ 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 pest heat anomaly area.

[0012] As described above, in an improved blind pixel detection method for agricultural pest infrared images, in step S8, the average and standard deviation are taken for the results calculated by using the local direction comprehensive gray-scale gradient deviation model GDM for all windows, and the average deviation and the standard deviation v l are obtained, as shown in the following formula: (13) (14) where, GDM i represents the value obtained by using GDM for the corresponding gray-scale sliding window. Each gray-scale sliding window is classified according to this value, and the classification result RE is as shown in the following formula: (15) where, 0 represents the marked potential blind pixel area, and 1 represents the marked pest heat anomaly area; regional classification is achieved according to the double determination conditions. When the value obtained by using GDM for the gray-scale sliding window is greater than the blind pixel threshold When the C value is less than 0.3, it is marked as a potential blind pixel area; when the value obtained by the gray - scale sliding window using GDM is greater than or equal to the pest and disease thermal anomaly threshold and less than or equal to the blind pixel threshold At the same time, when the C value calculated by this window is greater than 0.6, it is marked as the pest and disease thermal anomaly area; when the value obtained by the gray - scale sliding window using GDM is less than the pest and disease thermal anomaly threshold , it is classified as other areas and no processing is done.

[0013] As mentioned above, in an improved blind pixel detection method for agricultural pest and disease infrared images, in step S9, calculate the g(x, y) values of all pixels in the four - neighborhood direction window of the gray - scale 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 - neighborhood direction window and the standard deviation v w . If the difference between the g(x, y) value of the pixel in the window marked as the potential blind pixel area and is greater than 3 times of v w , then mark this pixel as 1, indicating that this pixel is a blind pixel; otherwise mark it as 0, indicating that this pixel is a normal pixel. The formula is as follows: (16) where g(x, y) represents the gray - scale change feature value.

[0014] The beneficial effects of the present invention are: (1)In the present invention, aiming at the problem that blind pixel noise and agricultural pest and disease thermal anomaly areas are easily confused in agricultural pest and disease infrared images, by constructing a local - direction comprehensive gray - scale gradient deviation model, the distinction between pest and disease thermal anomaly areas, potential blind pixel areas and other areas is realized; then, for the areas initially marked as potential blind pixel areas, a blind pixel detection method based on local - direction gray - scale gradient is used for further accurate blind pixel positioning, and finally blind pixel detection is completed; (2)In the present invention, the local - direction comprehensive gray - scale gradient deviation model combines direction entropy weight and symbol consistency score; based on the direction entropy weight of the center - neighborhood window, the deviation degree of the direction comprehensive gradient distribution is obtained for the discrimination of potential blind pixel areas, and further, by introducing a symbol consistency score mechanism, the misjudgment between pest and disease thermal anomaly areas and potential blind pixel areas is effectively avoided. Description of the Drawings

[0015] Figure 1 is the overall flow schematic diagram of the present invention; Figure 2 is the schematic diagram of the eight - neighborhood direction of the central pixel of the 3×3 gray - scale sliding window in the embodiment of the present invention; Figure 3Schematic diagram of the eight-neighborhood directions centered on the gradient sliding window in the embodiment of the present invention; Figure 4 Schematic diagram of the four-neighborhood directions centered on the gradient sliding window in the embodiment of the present invention. Specific implementation manner

[0016] An improved blind pixel detection method for agricultural pest infrared images provided in this embodiment is as Figure 1 shown, and includes the following steps: S1. Obtain an agricultural pest infrared image, and use a 3×3 gray sliding window to extract the gray features of the image.

[0017] Taking the gray value I(x,y) of the central pixel of the gray sliding window as the center, calculate the sum of the squares of the differences in the gray values of the adjacent pixels in four directions within the eight-neighborhood, and obtain four values H i , V i , L i and R i respectively, as Figure 2 shown, the four directions are the horizontal direction, the vertical direction, and the two crossed main diagonal directions and sub-diagonal directions; take the average of the above four values as the gray change feature value g(x,y) of the central pixel, that is: (17) where (18) (19) (20) (21) where 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) respectively represent the gray 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 central pixel.

[0018] S2. Calculate the gray change feature value g(x,y) of all pixels within the gray sliding window, and sum and average the g(x,y) values obtained for all pixels within the window to obtain the gray gradient value G(x,y) of the window, that is: (22) Among them, n is the sum of the pixels within 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 gray-scale change degree matrix GM(x, y), where the number of rows and columns of GM(x, y) are both m, and the value of m changes with the change of the image resolution.

[0019] S3. Based on the gray-scale change degree matrix GM(x, y), use a 3×3 gradient sliding window to traverse the matrix, and use formulas (18) to (21) to calculate the gradient eigenvalue GM in four directions within the eight neighborhoods for the center value of the window k , k = 1, 2, 3, 4, as Figure 3 shown, that is, the gradient eigenvalues in the horizontal direction, vertical direction, and two crossed main diagonal directions and sub-diagonal directions; finally, the direction comprehensive gradient value GM of the center value of the gradient sliding window is obtained according to formula (17) m .

[0020] S4. According to the direction comprehensive gradient value GM m , calculate the direction entropy G e ; G e quantifies the difference between the GM m value of the center value of the gradient sliding window in the image and the different direction comprehensive gradient values through the dynamic weight allocation of information entropy; its core idea is to divide the region of the direction entropy into a high-entropy region and a low-entropy region according to the uniformity of the distribution of the direction comprehensive gradient values. The high-entropy region indicates that the distribution of the direction comprehensive gradient values in each direction is uniform, that is, the G e value obtained for this region is relatively large, and in this embodiment, it is set to be at least greater than 1.5; the low-entropy region indicates that the single direction comprehensive gradient value is dominant, that is, the G e value obtained for this region is relatively small, and in this embodiment, it is set to be lower than 0.5.

[0021] First, calculate the GM m value corresponding to each G(x, y) value within the window according to the method in step S3, and normalize the GM Figure 4 values obtained in the four-neighborhood directions with the window center as m shown into a probability distribution P e : (23) Among them, GM di represents the direction comprehensive gradient value in a certain direction in the four neighborhoods of the window center, and i takes any one of 1, 2, 3, 4, respectively representing the four directions of up, down, left, and right of the window center.

[0022] Subsequently, obtain the direction entropy G e according to P e , and the formula is: (24) Among them, the value range of G e is [0, 2]. According to the obtained G e value interval, the window is divided into a high-entropy region and a low-entropy region; the distribution interval of the high-entropy region is G e ∈[1.5, 2], indicating that the GM m value of the window center value and the comprehensive gradient value distribution in four directions are highly uniform. If the obtained G e value is within this interval, then this window corresponds to a potential pest and disease heat anomaly region; the distribution interval of the low-entropy region is G e ∈[0, 0.5], indicating that the GM m value of the window center value and the comprehensive gradient value distribution in four directions are not uniform. If the obtained G e value is within this interval, then this window corresponds to a potential blind pixel region.

[0023] S5. Reverse-adjust the weights of each direction according to the size of the G e value to highlight the comprehensive gradient value of the dominant direction, so as to prevent the G e value obtained in a certain direction from being too large or too small, affecting the accuracy of the calculation result; the direction entropy weight value range is [0, 1], and the calculation formula of the direction entropy weight is: (25) Among them, G M represents the maximum direction entropy. In this embodiment, the four-neighborhood direction is calculated, that is, G M = log24 = 2; if the GM m value of the gradient sliding window center value is significantly greater than the comprehensive gradient values in other directions, then the weight value of this direction is reduced, that is, value is smaller, to prevent the G e value from being too large; if each direction is relatively balanced, the weight distribution tends to be average, that is, value is close to the G e value.

[0024] S6. Calculate the weighted sign consistency score C of the GM m of the gradient sliding window center value and the GM m of the four-neighborhood direction; if the direction comprehensive gradient value GM m of the window center value and the GM m value of the four-neighborhood direction are relatively consistent in sign, the corresponding C value is larger. In this embodiment, it is set that the C value is greater than 0.6, which means that this region corresponds to a potential pest and disease heat anomaly region; if the GM m value of the window center value and the GM mThe correlation with the value symbol is weak, and the corresponding C value is small. In this embodiment, it is set that the C value is less than 0.3, which indicates that the area corresponds to a potential blind pixel area.

[0025] The correlation is determined by the magnitude of the C value to prevent the single use of the value from causing misjudgment between the potential blind pixel area and the pest and disease heat anomaly area. The specific implementation steps of the weighted symbol consistency score C are as follows: S6.1. Calculate the GM of the center value of the gradient sliding window m of the gradient symbol s c : (26) where g i (x,y) represents the gray-level feature values of the pixels in the eight-neighborhood directions of the window corresponding to the GM m value except the central pixel.

[0026] S6.2. Calculate the GM m of the center value of the window in the four-neighborhood directions respectively k of the gradient symbol s

[0027] The four-neighborhood directions are the up, down, left, and right directions of the center value of the window respectively. c S6.3. Compare the symbol consistency matching degree of s k with s (27) to obtain the weighted symbol consistency score C: where k represents the indicator function. When calculating the symbol consistency score, if the gradient symbol s c in the k-th direction is consistent with the symbol of s

[0028] S7. Combine the value with the weighted symbol consistency score C to obtain the local direction comprehensive gray-level gradient deviation model GDM. The calculation formula is: (28) where μ represents the slope parameter used to control the excessive steepness. In this embodiment, this value is set to 5; C0 represents the offset threshold used to match the minimum consistency requirement of the pest and disease heat anomaly area. In this embodiment, this value is set to 0.7.

[0029] S8. For each gray-level sliding window, the calculation result of GDM can be used to divide the window into a potential blind pixel area, a pest and disease heat anomaly area, and other areas.

[0030] To improve the classification accuracy, in this embodiment, the results obtained by calculating all windows using GDM are averaged and the standard deviation is calculated to obtain the average deviation degree. and the standard deviation v l , as shown in the following formula: (29) (30) Among them, GDM i represents the value obtained by using GDM for the corresponding grayscale sliding window. Each grayscale sliding window is classified according to this value, and the classification result RE is as shown in the following formula: (31) Among them, 0 indicates the marked potential blind pixel area, and 1 indicates the marked pest and disease heat anomaly area; in this embodiment, the area classification is realized according to the double determination conditions. When the value obtained by using GDM for the grayscale sliding window is greater than the blind pixel threshold , and the C value is less than 0.3, it means that the gradient deviation degree of this window is relatively high but the symbols are chaotic, and it is marked as a potential blind pixel area; when the value obtained by using GDM for the grayscale sliding window is greater than or equal to the pest and disease heat anomaly threshold , and less than or equal to the blind pixel threshold , and at the same time the C value calculated for this window is greater than 0.6, it means that the gradient deviation degree of this window is relatively small and the symbol consistency is high, and it is marked as a pest and disease heat anomaly area; when the value obtained by using GDM for the grayscale sliding window is less than the pest and disease heat anomaly threshold , it is classified as other areas and no processing is performed.

[0031] S9. Further perform precise blind pixel detection on the windows marked as potential blind pixel areas. In this embodiment, a blind pixel detection method based on local direction grayscale gradient is used. First, calculate the g(x,y) values of all pixels in the four-neighborhood direction window of the grayscale sliding window marked as a potential blind pixel area, and average the g(x,y) values obtained for all pixels in the four-neighborhood direction window and the standard deviation v w . If the difference between the g(x,y) value of the pixel in the window marked as a potential blind pixel area and is greater than 3 times of v w , then mark this pixel as 1, indicating that this pixel is a blind pixel; otherwise mark it as 0, indicating that this pixel is a normal pixel. The formula is as follows: (32) Among them, g(x,y) represents the grayscale change feature value.

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

[0033] The method of this embodiment aims at the spatial continuity characteristics of the hot abnormal areas of pests and diseases in the agricultural scenario. For the infrared images of agricultural pests and diseases, first, a local direction comprehensive gray gradient deviation model is constructed to distinguish the hot abnormal areas of pests and diseases, potential blind pixel areas and other areas. Subsequently, the blind pixel detection method based on the local direction gray gradient is used for the areas initially marked as potential blind pixel areas to further accurately locate the blind pixels, and finally the blind pixel detection is completed. The local direction comprehensive gray gradient deviation model is discriminated based on the deviation degree of the direction comprehensive gradient distribution of the center-neighborhood window, and further, by introducing a symbol consistency score mechanism, the misjudgment between the hot abnormal areas of pests and diseases and the potential blind pixel areas can be effectively avoided.

[0034] In addition to the above embodiments, the present invention may also have other implementation manners. All technical solutions formed by equivalent replacement or equivalent transformation fall within the protection scope required by the present invention.

Claims

1. An improved blind pixel detection method for agricultural pest and disease infrared images, characterized in that: It includes the following steps: S1. Obtain the infrared image of agricultural pests and diseases, and use a 3×3 gray sliding window to extract the gray feature of the image to obtain the gray change feature value of the central pixel; S2. Calculate the gray change feature values of all pixels within the gray sliding window, sum and average the gray change feature values obtained for all pixels within the window to obtain the gray gradient value of this window, that is: Calculate the gray gradient values of all windows, and arrange and combine the gray gradient values of all windows into a gray change degree matrix; S3. Based on the gray change degree matrix, use a 3×3 gradient sliding window to traverse the matrix, calculate the gradient feature values in four directions within the eight neighborhoods of the window center value, and finally calculate the direction comprehensive gradient value of the window center value; S4. According to the direction comprehensive gradient value, normalize the direction comprehensive gradient values obtained in the four neighborhood directions of the window center into a probability distribution, and calculate the direction entropy; the direction entropy quantifies the difference between the direction comprehensive gradient value of the window center value in the image and the direction comprehensive gradient values in different directions through the dynamic weight allocation of information entropy. According to the uniformity of the distribution of the direction comprehensive gradient values, the region of the direction entropy is divided into a high-entropy region and a low-entropy region. The corresponding direction entropy obtained in the high-entropy region is greater than 1.5, and the corresponding direction entropy obtained in the low-entropy region is less than 0.5; S5. Adjust the direction entropy weights in each direction according to the value of the direction entropy to obtain the direction entropy weights in each direction; S6. Calculate the weighted sign consistency score between the direction comprehensive gradient value of the window center value and the direction comprehensive gradient values in the four neighborhood directions, and determine the sign correlation between the direction comprehensive gradient value of the window center value and the direction comprehensive gradient values in the four neighborhood directions according to the numerical value of the weighted sign consistency score; S7. Combine the direction entropy weight value and the weighted sign consistency score to obtain a local direction comprehensive gray gradient deviation model; S8. For each gray sliding window, use the calculation result of the local direction comprehensive gray gradient deviation model to divide this window into a potential blind pixel region, a pest and disease thermal anomaly region, and other regions; S9. Use a blind pixel detection method based on local direction gray gradient to detect the blind pixels of the windows marked as potential blind pixel regions; S10. Repeat step S9 to detect the blind pixels of all windows marked as potential blind pixel regions in the entire image to obtain the final blind pixel detection result.

2. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: In the step S1, taking the gray value I(x, y) of the pixel at the center of the gray sliding window as the center, calculate the sum of the squares of the differences in gray values of adjacent pixels in four directions within the eight-neighborhood respectively, and obtain four values H i , V i , L i and R i . The four directions are the horizontal direction, the vertical direction, and the two cross main diagonal directions and the secondary diagonal direction respectively; take the average of the above four values as the gray change feature value g(x, y) of the central pixel, that is: (1) Among them, (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) respectively represent the gray 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 central pixel.

3. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: In step S2, calculate the gray change feature value g(x,y) of all pixels within the gray sliding window, sum and average the g(x,y) values obtained for all pixels within the window to obtain the gray gradient value G(x,y) of this window, that is: (6) Among them, n is the sum of pixels within 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 a gray-scale change degree 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. An improved blind pixel detection method for agricultural pest infrared images according to claim 2, characterized in that: In the step S3, based on the gray-scale change degree matrix GM(x, y), a 3×3 gradient sliding window is used to traverse the matrix, and the gradient eigenvalue GM in four directions within the eight neighborhoods of the window center value is calculated using the formulas (2) to (5) respectively k , where k = 1, 2, 3, 4, namely the gradient eigenvalues in the horizontal direction, vertical direction, and two crossed main diagonal directions and secondary diagonal directions Finally, the comprehensive gradient value GM of the direction of the center value of the gradient sliding window is obtained according to formula (1). m .

5. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: The specific steps of step S4 include the following sub-steps: S4.

1. Calculate the corresponding combined gradient value GM of each gray gradient value G(x, y) within the window according to the method in step S3 m , and normalize the GM m values obtained from the directions of the four neighborhoods centered on the window into a probability distribution P e : (7) Among them, GM di represents the directional comprehensive gradient value in a certain direction in the four-neighborhood of the window center. i takes any one of 1, 2, 3, and 4, representing the four directions of up, down, left, and right of the window center respectively; S4.

2. Obtain the directional entropy G according to P e where the formula is: e ​ (8) Among them, G e ranges from [0, 2]. According to the obtained value range of G e , the window is divided into a high-entropy region and a low-entropy region; the distribution interval of the high-entropy region is G e ∈[1.5, 2]. If the obtained value of G e is within this interval, then this window corresponds to a potential pest and disease heat anomaly region; the distribution interval of the low-entropy region is G e ∈[0, 0.5]. If the obtained value of G e is within this interval, then this window corresponds to a potential blind pixel region.

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

7. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: In the step S6, if the direction comprehensive gradient value GM of the window center value m is consistent with the sign correlation of the GM in the four-neighborhood directions m , that is, the weighted sign consistency score C is greater than 0.6, it indicates that the area corresponds to a potential pest and disease thermal anomaly area; if the GM m value of the window center value is weakly correlated with the sign of the GM in the four-neighborhood directions m , that is, the weighted sign consistency score C is less than 0.3, it indicates that the area corresponds to a potential blind pixel area; 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 The gradient sign s of the value c : (10) Among them, g i (x, y) represents the GM m gray scale feature values of the pixels in the eight neighborhood directions except the central pixel of the window corresponding to the value; S6.

2. Calculate the gradient signs s corresponding to the GM values in the four neighborhood directions of the window center value respectively. m The four neighborhood directions are the up, down, left, and right directions of the window center value. k ​ S6.

3. Compare s c with s k to obtain a weighted symbol consistency score C by comparing their symbol consistency matching degrees: (11) Among them, represents an indicator function. When calculating the symbol consistency score, if the gradient symbol s in the k-th direction k is consistent with the symbol of s c , the count is incremented by 1; if the symbols are inconsistent, the original value is retained.

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

9. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: In the step S8, the average value and the standard deviation are calculated for the results obtained by using the local direction comprehensive gray gradient deviation model GDM for all windows, and the average deviation is obtained. and the standard deviation v l , as shown in the following formula: (13) (14) Among them, GDM i represents the value obtained by using GDM for the corresponding grayscale sliding window. Each grayscale sliding window is classified according to this value, and the classification result RE is shown as follows: (15) Among them, 0 represents the area marked as a potential blind pixel area, and 1 represents the area marked as a pest and disease heat anomaly area; regional classification is achieved according to dual determination conditions. When the value obtained by the gray-scale 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 the gray-scale sliding window using GDM is greater than or equal to the pest and disease heat anomaly threshold , and less than or equal to the blind pixel threshold , and at the same time the C value calculated by this window is greater than 0.6, it is marked as a pest and disease heat anomaly area; when the value obtained by the gray-scale sliding window using GDM is less than the pest and disease heat anomaly threshold , it is classified as other areas and no processing is performed.

10. An improved blind pixel detection method for agricultural pest infrared images according to claim 1, characterized in that: In step S9, calculate the g(x,y) values of all pixels in the four-neighborhood direction window of the grayscale sliding window of the blind pixel area marked as potential, and take the mean of the g(x,y) values obtained for all pixels in the four-neighborhood direction window and the standard deviation v w , if the difference between the g(x,y) value of the pixel in the window of the blind pixel area marked as potential and is greater than 3 times v w , then mark the pixel as 1, indicating that the pixel is a blind pixel; otherwise mark it as 0, indicating that the pixel is a normal pixel. The formula is as follows: (16) Among them, g(x, y) represents the gray-scale 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

  • Thermal infrared imager and real-time automatic blind pixel detection processing method

    CN111612773A

  • Blind pixel detection method and device, computer equipment and medium

    CN116630227A

  • Infrared detector blind pixel dynamic detection method based on progressive classification model

    CN117475242A