Pest and disease prevention system and method for forestry seedling culture
By performing frequency domain transformation and gradient amplitude analysis on the pest and disease monitoring images in forestry seedling cultivation, combined with dynamic segmentation verification, the problem of difficult to distinguish prospects and backgrounds in the existing technology is solved, and the accurate identification of the degree of pest and disease invasion is achieved, and the improvement of the Protection efficiency.
Patent Information
- Application Number
- CN202411461959.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The prior art is difficult to accurately distinguish the foreground area and background area of the pest monitoring image in forestry seedlings under the influence of the adhesion and similarity of pests and diseases, resulting in the inability to accurately determine the degree of pests and diseases, and reduce the efficiency of pest protection.
By performing frequency domain transformation on pest monitoring images, multiple frequency domain coefficients are obtained, and the suspiciousness of pests and diseases is determined based on grayscale information entropy; then, the gradient amplitude of pixel points is determined, a two-dimensional amplitude matrix is constructed, and the second segmentation threshold is extracted. ; Finally, based on dynamic segmentation verification, the confidence segmentation threshold is obtained, the image is segmented, and the degree of invasion of diseases and pests is determined.
Under the influence of the adhesion and similarity of pests and diseases, the accurate segmentation of the foreground and background areas of the pest monitoring images is achieved, and the accuracy of identifying the degree of pest and diseases is improved, thereby improving the protection efficiency of pest and diseases in forestry seedling cultivation.
Smart Images

Figure CN119478668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of forestry pest and disease image recognition, and more specifically, to a pest and disease protection system and method for forestry seedling cultivation. Background Art
[0002] For the prevention of pests and diseases in forestry seedlings, the target trees can be monitored, pest and disease monitoring images can be collected, and the degree of pest damage can be analyzed based on the pest and disease monitoring images. However, the pest and disease monitoring images are affected by the adhesion of pests and diseases to each other or mixed with plant tissues, as well as the similarity between the color and texture features of pests and diseases and the color and texture features of plant leaves in the background. This makes it difficult for existing segmentation algorithms to accurately distinguish between foreground and background areas, and it is impossible to accurately determine the degree of damage caused by pests and diseases, thereby reducing the efficiency of pest and disease protection in forestry seedlings. Therefore, how to achieve the segmentation of the foreground and background areas of the pest and disease monitoring images under the influence of the adhesion and similarity of pests and diseases to determine the degree of damage caused by pests and diseases, thereby improving the efficiency of pest and disease protection in forestry seedlings has become a difficult problem faced by the industry. Summary of the invention
[0003] The present application provides a pest and disease protection system and method for forestry seedling cultivation, which can segment the foreground area and background area of the pest and disease monitoring image under the influence of the adhesion and similarity of the pests and diseases to determine the degree of damage caused by the pests and diseases, thereby improving the pest and disease protection efficiency in forestry seedling cultivation.
[0004] In a first aspect, the present application provides a pest monitoring image recognition method for use in a pest protection system for forestry seedling cultivation to perform protection identification of forest pests, the method comprising the following steps: Collect pest and disease monitoring images of target trees; Performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image, determining the pest suspicion of the target tree through all the frequency domain coefficients and the grayscale information entropy of the pest monitoring image, and extracting a first segmentation threshold of the pest monitoring image when the pest suspicion is greater than a preset suspicion; Determine the gradient amplitude of each pixel in the pest monitoring image, construct a two-dimensional amplitude matrix through all the gradient amplitudes, and extract a second segmentation threshold of the two-dimensional amplitude matrix according to a preset image segmentation model; Performing dynamic segmentation verification on the pest monitoring image using the first segmentation threshold and the second segmentation threshold to obtain a confidence segmentation threshold of the pest monitoring image; The pest monitoring image is segmented based on the confidence segmentation threshold, and the degree of pest damage of the target trees in the pest monitoring image is determined according to the segmentation result.
[0005] In some embodiments, performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image specifically includes: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determining the horizontal frequency range and the vertical frequency range of the pest monitoring image by the horizontal scale and the vertical scale respectively; Determine all frequency positions according to the horizontal frequency range and the vertical frequency range; Selecting a frequency position as a selected frequency position, and determining a frequency domain coefficient corresponding to the selected frequency position according to position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest and disease monitoring image; Continue to determine the frequency domain coefficients corresponding to the remaining frequency positions, and then obtain multiple frequency domain coefficients corresponding to the pest monitoring image.
[0006] In some embodiments, determining the frequency domain coefficient corresponding to the selected frequency position according to the position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest monitoring image specifically includes: Extracting a horizontal normalization factor and a vertical normalization factor corresponding to a selected frequency position according to the horizontal scale and the vertical scale respectively; Obtaining a preset frequency domain transformation model; The horizontal normalization factor, the vertical normalization factor, the position information corresponding to the selected frequency position and the pixel value of each pixel in the pest and disease monitoring image are input into the frequency domain transformation model, and the frequency domain transformation model outputs the frequency domain coefficient corresponding to the selected frequency position.
[0007] In some embodiments, determining the suspiciousness of pests and diseases of target trees through all frequency domain coefficients and the grayscale information entropy of the pest and disease monitoring image specifically includes: Extract the total number of high-frequency coefficients and the total number of low-frequency coefficients from all frequency domain coefficients; Determining a spectrum energy ratio of the pest monitoring image according to the total number of high-frequency coefficients and the total number of low-frequency coefficients; Determining the grayscale information entropy of the pest monitoring image; The suspicious degree of pests and diseases of target trees is determined by the spectral energy ratio and the grayscale information entropy.
[0008] In some embodiments, determining the grayscale information entropy of the pest monitoring image specifically includes: Obtaining the grayscale value corresponding to each pixel in the pest monitoring image; Extract all different grayscale values and determine the grayscale proportion of each different grayscale value; The grayscale information entropy of the pest monitoring image is determined according to the grayscale proportions of different grayscale values.
[0009] In some embodiments, extracting the first segmentation threshold of the pest monitoring image specifically includes: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determine a sample template for dividing the pest monitoring image based on the horizontal scale and the vertical scale; Dividing the pest monitoring image into a plurality of pest monitoring sub-images by using the divided sample template; The segmentation threshold of each pest monitoring sub-image is extracted, and then the first segmentation threshold of the pest monitoring image is determined by all the segmentation thresholds.
[0010] In some embodiments, pest and disease monitoring images of target trees are collected by surveillance cameras.
[0011] In a second aspect, the present application provides a pest and disease protection system for forestry seedling cultivation, which includes a pest and disease image recognition unit, and the pest and disease image recognition unit includes: A collection module is used to collect pest and disease monitoring images of target trees; A processing module, for performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image, determining the pest suspicion of the target tree through all the frequency domain coefficients and the grayscale information entropy of the pest monitoring image, and extracting a first segmentation threshold of the pest monitoring image when the pest suspicion is greater than a preset suspicion; The processing module is further used to determine the gradient amplitude of each pixel in the pest monitoring image, construct a two-dimensional amplitude matrix through all the gradient amplitudes, and extract a second segmentation threshold of the two-dimensional amplitude matrix according to a preset image segmentation model; The processing module is further configured to perform dynamic segmentation verification on the pest monitoring image using the first segmentation threshold and the second segmentation threshold to obtain a confidence segmentation threshold of the pest monitoring image; An execution module is used to segment the pest monitoring image based on the confidence segmentation threshold, and determine the degree of pest damage of the target trees in the pest monitoring image according to the segmentation result.
[0012] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a code, and the processor is configured to obtain the code and execute the above-mentioned pest and disease monitoring image recognition method.
[0013] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned pest and disease monitoring image recognition method is implemented.
[0014] The technical solution provided by the embodiments disclosed in this application has the following beneficial effects: In the pest and disease protection system and method for forestry seedling cultivation provided by the present application, first, a pest and disease monitoring image of the target tree is collected; secondly, the pest and disease monitoring image is transformed in the frequency domain to obtain multiple frequency domain coefficients corresponding to the pest and disease monitoring image, and the pest and disease suspicion of the target tree is determined by all the frequency domain coefficients and the grayscale information entropy of the pest and disease monitoring image. When the pest and disease suspicion is greater than the preset suspicion, the first segmentation threshold of the pest and disease monitoring image is extracted; further, the gradient amplitude of each pixel point in the pest and disease monitoring image is determined, a two-dimensional amplitude matrix is constructed by all the gradient amplitudes, and a second segmentation threshold of the two-dimensional amplitude matrix is extracted according to a preset image segmentation model; then, the pest and disease monitoring image is dynamically segmented and verified by the first segmentation threshold and the second segmentation threshold to obtain the confidence segmentation threshold of the pest and disease monitoring image; finally, the pest and disease monitoring image is segmented based on the confidence segmentation threshold, and the degree of pest and disease damage of the target tree in the pest and disease monitoring image is determined according to the segmentation result.
[0015] It can be seen that the present application can segment the foreground area and background area of the pest monitoring image under the influence of the adhesion and similarity of pests and diseases, so as to determine the degree of damage caused by pests and diseases, thereby improving the protection efficiency of pests and diseases in forestry seedling cultivation; first, multiple frequency domain coefficients of the pest monitoring image of the target forest are determined to reflect the characteristic information of the pest monitoring image on different frequency components, and the suspicious degree of pests and diseases of the target forest is obtained through the characteristic information on different frequency components and the grayscale information entropy of the pest monitoring image, so as to identify the target trees in the pest monitoring image. The target trees are suspected of being infested by pests and diseases; secondly, when the target trees are identified to be more likely to be infested by pests and diseases according to the suspicion of pests and diseases, the first segmentation threshold of the pest and disease monitoring image is extracted to quickly divide the pest and disease monitoring image into different areas for the first time, so as to roughly analyze the occurrence range and severity of pests and diseases in the target trees; further, a segmentation threshold (second segmentation threshold) is extracted again from the two-dimensional amplitude matrix constructed by the gradient amplitude of each pixel point in the pest and disease monitoring image, so as to further separate the areas affected by pests and diseases in the image from the areas affected by pests and diseases. Normal healthy areas are distinguished to avoid confusing pest and disease areas with healthy areas; then, the pest and disease monitoring image is dynamically segmented and verified by the first segmentation threshold and the second segmentation threshold, so as to obtain the optimal segmentation threshold (i.e., confidence segmentation threshold) for segmenting the pest and disease monitoring image, so as to more realistically and effectively distinguish the pest and disease area from the normal background area, reduce misjudgment and missed judgment, and thus avoid the adhesion effect caused by the adhesion of pests and diseases to each other or mixing with plant tissues, as well as the effect of the similarity between the color and texture features of pests and diseases and the color and texture features of plant leaves in the background, thereby improving the recognition accuracy of pest and disease damage; finally, the foreground area and background area of the pest and disease monitoring image are segmented based on the confidence segmentation threshold, and the degree of pest and disease damage of the target trees in the pest and disease monitoring image is analyzed according to the segmentation results; in summary, the technical solution provided by the present application can realize the segmentation of the foreground area and background area of the pest and disease monitoring image under the influence of the adhesion and similarity of pests and diseases, so as to determine the degree of damage of pests and diseases, thereby improving the protection efficiency of pests and diseases in forestry seedling cultivation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is an exemplary flow chart of a pest monitoring image recognition method according to some embodiments of the present application; Figure 2 is an exemplary flow chart for determining the suspicious degree of pests and diseases according to some embodiments of the present application; Figure 3 is an exemplary flow chart for determining a gradient magnitude according to some embodiments of the present application; Figure 4is a schematic diagram of the structure of a pest and disease image recognition unit according to some embodiments of the present application; Figure 5 It is a structural schematic diagram of a computer device for implementing a pest monitoring image recognition method according to some embodiments of the present application. DETAILED DESCRIPTION
[0017] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0018] refer to Figure 1 , which is an exemplary flow chart of a pest monitoring image recognition method according to some embodiments of the present application. The pest monitoring image recognition method 100 mainly includes the following steps: In step 101, pest and disease monitoring images of target trees are collected.
[0019] In specific implementation, target trees in forestry seedling cultivation are monitored, and pest and disease monitoring images of the target trees are collected through monitoring cameras. The pest and disease monitoring images are images collected by monitoring the target trees during pest and disease protection.
[0020] It should be noted that the pest and disease protection system used for forestry seedling cultivation in this application is a system that is implemented by combining software and hardware, and mainly achieves protection against forestry pests and diseases through technical means such as sensors, image recognition, data analysis, and artificial intelligence.
[0021] In step 102, the pest and disease monitoring image is transformed in the frequency domain to obtain multiple frequency domain coefficients corresponding to the pest and disease monitoring image, and the pest and disease suspicion of the target trees is determined by all the frequency domain coefficients and the grayscale information entropy of the pest and disease monitoring image. When the pest and disease suspicion is greater than the preset suspicion, the first segmentation threshold of the pest and disease monitoring image is extracted.
[0022] In some embodiments, the frequency domain transformation is performed on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image, specifically by the following steps, namely: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determining the horizontal frequency range and the vertical frequency range of the pest monitoring image by the horizontal scale and the vertical scale respectively; Determine all frequency positions according to the horizontal frequency range and the vertical frequency range; Selecting a frequency position as a selected frequency position, and determining a frequency domain coefficient corresponding to the selected frequency position according to position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest and disease monitoring image; Continue to determine the frequency domain coefficients corresponding to the remaining frequency positions, and then obtain multiple frequency domain coefficients corresponding to the pest monitoring image.
[0023] In specific implementation, the horizontal scale and vertical scale of the pest monitoring image are obtained through the image processing tool OpenCV.
[0024] In a specific implementation, the horizontal frequency range and the vertical frequency range of the pest monitoring image are determined by the horizontal scale and the vertical scale, respectively, that is, the result obtained by subtracting the value 1 from the horizontal scale is used as the upper limit of the horizontal frequency range, the result obtained by subtracting the value 1 from the vertical scale is used as the upper limit of the vertical frequency range, and the value 0 is used as the lower limit of the horizontal frequency range and the vertical frequency range, respectively, and then the horizontal frequency range and the vertical frequency range of the pest monitoring image are obtained according to the corresponding upper limit and lower limit. For example, when the horizontal scale and the vertical scale are M and N respectively, the horizontal frequency range is [0, M] and the vertical frequency range is [0, N].
[0025] It should be noted that the horizontal frequency range in this embodiment represents the frequency range of pixel brightness changes in the pest monitoring image in the horizontal direction, and the vertical frequency range in this embodiment represents the frequency range of pixel brightness changes in the pest monitoring image in the vertical direction.
[0026] In a specific implementation, all frequency positions are determined according to the horizontal frequency range and the vertical frequency range, that is, each horizontal frequency value in the horizontal frequency range is combined with each vertical frequency value in the vertical frequency range, and the combination result is used as the frequency position, so as to obtain all frequency positions. For example, in a horizontal frequency range of [0, M] and a vertical frequency range of [0, N], when the horizontal frequency value is 0 and the vertical frequency value is 1, the composed frequency position is (0, 1). It should be noted that both the horizontal frequency value and the vertical frequency value are integer values, wherein the frequency position represents the position coordinate of the pest and disease monitoring image in the frequency domain, and the frequency position corresponds to position information, that is, the horizontal frequency value is the horizontal coordinate, and the vertical frequency value is the vertical coordinate.
[0027] Among them, in some embodiments, the frequency domain coefficient corresponding to the selected frequency position is determined according to the position information corresponding to the selected frequency position, the horizontal scale, the vertical scale and the pixel value of each pixel point in the pest monitoring image, that is: Extracting a horizontal normalization factor and a vertical normalization factor corresponding to a selected frequency position according to the horizontal scale and the vertical scale respectively; Obtaining a preset frequency domain transformation model; The horizontal normalization factor, the vertical normalization factor, the position information corresponding to the selected frequency position and the pixel value of each pixel in the pest and disease monitoring image are input into the frequency domain transformation model, and the frequency domain transformation model outputs the frequency domain coefficient corresponding to the selected frequency position.
[0028] In a specific implementation, the horizontal normalization factor and the vertical normalization factor corresponding to the selected frequency position are respectively extracted according to the horizontal scale and the vertical scale, that is, the position information of the selected frequency position is obtained, the position information includes the horizontal coordinate coordinate and the vertical coordinate, when the horizontal coordinate is equal to zero, the horizontal scale is inversely calculated and the square root is taken, and the square root result is used as the horizontal normalization factor corresponding to the selected frequency position, when the horizontal coordinate is greater than zero, the horizontal scale is ratioed with the value 2, the ratio calculation result is square rooted, and the square root result is used as the horizontal normalization factor corresponding to the selected frequency position; when the vertical coordinate is equal to zero, the vertical scale is inversely calculated and the square root is taken, and the square root result is used as the vertical normalization factor corresponding to the selected frequency position, when the vertical coordinate is greater than zero, the vertical scale is ratioed with the value 2, the ratio calculation result is square rooted, and the square root result is used as the vertical normalization factor corresponding to the selected frequency position. In addition, in other embodiments, other calculation methods can be used to calculate the horizontal normalization factor and the vertical normalization factor corresponding to the selected frequency position, which will not be repeated here.
[0029] It should be noted that the horizontal normalization factor in this embodiment represents a factor for adjusting a horizontal transformation result, and the vertical normalization factor in this embodiment represents a factor for adjusting a vertical transformation result.
[0030] In specific implementation, the preset frequency domain transformation model can be obtained through the pest and disease image analysis database. The preset frequency domain transformation model in this embodiment is a discrete cosine transform model. In addition, other frequency domain transformation models can also be used in other embodiments, which are not limited here. It should be noted that the pest and disease image analysis database in this embodiment is a database specially used to store, manage and analyze images and data related to plant pests and diseases. It is usually used for pest and disease detection, monitoring, identification and prevention in the fields of agriculture and forestry. The database contains a large number of images related to pests and diseases, as well as corresponding annotations, classifications and feature information to assist in the automatic identification and analysis of pests and diseases.
[0031] In a specific implementation, for example, the frequency domain coefficients corresponding to the selected frequency position are determined according to the position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest and disease monitoring image, and the frequency domain coefficients corresponding to the remaining frequency positions are further determined to obtain multiple frequency domain coefficients corresponding to the pest and disease monitoring image, which will not be repeated here.
[0032] It should be noted that the frequency domain coefficients in the present application represent the coefficients obtained after the pest and disease monitoring image is transformed through the frequency domain. The frequency domain coefficients reflect the characteristic information of the pest and disease monitoring image at different frequency components. The lower frequency domain coefficients represent the overall outline, slowly changing parts and main brightness information of the pest and disease monitoring image, while the higher frequency domain coefficients correspond to the rapidly changing parts such as the details, edges and noise of the image. Therefore, by determining the frequency domain coefficients, it is possible to effectively identify whether there is pest and disease invasion in the pest and disease monitoring image, and then take corresponding protective measures for the target trees.
[0033] In some embodiments, reference Figure 2 As shown, this figure is an exemplary flow chart of determining the suspicious degree of pests and diseases according to some embodiments of the present application. In this embodiment, the suspicious degree of pests and diseases of the target trees can be determined by all frequency domain coefficients and the grayscale information entropy of the pest and disease monitoring image, which can be achieved by the following steps: First, in step 1021, the total number of high-frequency coefficients and the total number of low-frequency coefficients are extracted from all frequency domain coefficients; Next, in step 1022, the spectrum energy ratio of the pest monitoring image is determined according to the total number of high-frequency coefficients and the total number of low-frequency coefficients; Then, in step 1023, the grayscale information entropy of the pest monitoring image is determined; Finally, in step 1024, the suspicious degree of pests and diseases of the target trees is determined by using the spectral energy ratio and the grayscale information entropy.
[0034] In specific implementation, the total number of high-frequency coefficients and the total number of low-frequency coefficients are extracted from all frequency domain coefficients, that is: the preset frequency domain coefficient is compared with each frequency domain coefficient respectively, for each frequency domain coefficient, when the frequency domain coefficient is greater than the preset frequency domain coefficient, the frequency domain coefficient is used as the high-frequency domain coefficient, otherwise it is used as the low-frequency domain coefficient, and then all the high-frequency domain coefficients and all the low-frequency domain coefficients are obtained, the total number of all the high-frequency domain coefficients is calculated to obtain the total number of high-frequency coefficients, and the total number of all the low-frequency domain coefficients is calculated to obtain the total number of low-frequency coefficients. In this embodiment, the high-frequency domain coefficient represents the energy coefficient of the rapidly changing part of the texture feature in the pest and disease monitoring image, and the low-frequency domain coefficient represents the energy coefficient of the slowly changing part of the texture feature in the pest and disease monitoring image.
[0035] It should be noted that the preset frequency domain coefficient in this embodiment is a pre-set standard frequency domain coefficient used to identify high frequency domain coefficients and low frequency domain coefficients, that is, the frequency domain coefficient higher than the preset frequency domain coefficient is used as the high frequency domain coefficient, otherwise it is used as the low frequency domain coefficient.
[0036] In specific implementation, the spectral energy ratio of the pest and disease monitoring image is determined according to the total number of high-frequency coefficients and the total number of low-frequency coefficients, that is, the ratio of the total number of low-frequency coefficients to the total number of high-frequency coefficients is calculated, and the ratio calculation result is used as the spectral energy ratio of the pest and disease monitoring image. In addition, in other embodiments, other calculation methods can also be used to calculate the spectral energy ratio of the pest and disease monitoring image.
[0037] It should be noted that, in this embodiment, the spectral energy ratio is used to measure the overall smoothness of the pest and disease monitoring image in the frequency domain. That is, the larger the spectral energy ratio, the greater the overall smoothness of the pest and disease monitoring image in the frequency domain, indicating that the possibility of the target trees being infested by pests and diseases is greater; when the spectral energy ratio is smaller, the overall smoothness of the pest and disease monitoring image in the frequency domain is smaller, indicating that the possibility of the target trees being infested by pests and diseases is smaller.
[0038] In some embodiments, the grayscale information entropy of the pest monitoring image may be determined by the following steps, namely: Obtaining the grayscale value corresponding to each pixel in the pest monitoring image; Extract all different grayscale values and determine the grayscale proportion of each different grayscale value; The grayscale information entropy of the pest monitoring image is determined according to the grayscale proportions of different grayscale values.
[0039] It should be noted that, in this embodiment, different grayscale values represent different grayscale values.
[0040] In specific implementation, the grayscale proportion of each different grayscale value is determined, that is, the total number of pixels in the pest and disease monitoring image is obtained, the occurrence frequency of each different grayscale value is obtained, for each different grayscale value, the corresponding occurrence frequency is calculated with the total number, and the ratio calculation result is used as the grayscale proportion of the different grayscale value, thereby obtaining the grayscale proportion of each different grayscale value. In addition, in other embodiments, other calculation methods can also be used to calculate the grayscale proportion of different grayscale values, which is not limited here. Among them, the grayscale proportion in this embodiment represents the proportion of different grayscale values in the pest and disease monitoring image, and the grayscale proportion describes the proportion of the number of pixels of each grayscale level in the pest and disease monitoring image to the total number of pixels. By determining the grayscale proportion, the brightness distribution of the pest and disease monitoring image can be effectively analyzed to understand the contrast, brightness and overall visual characteristics of the pest and disease monitoring image.
[0041] In specific implementation, the grayscale information entropy of the pest and disease monitoring image is determined according to the grayscale proportion of each different grayscale value, that is, a preset information entropy model is obtained, the grayscale proportion of each different grayscale value is input as an input parameter into the preset information entropy model, and the information entropy model outputs the grayscale information entropy of the pest and disease monitoring image.
[0042] It should be noted that in this embodiment, the information entropy function in the prior art is used as the preset information entropy model, which will not be repeated here. In addition, in other embodiments, other entropy models can be set according to actual needs, which are not limited here.
[0043] It should also be noted that the grayscale information entropy in the present application represents the degree of uncertainty in the grayscale value distribution in the pest and disease monitoring image, that is, the larger the grayscale information entropy, the greater the degree of uncertainty in the grayscale value distribution in the pest and disease monitoring image, indicating that there are more texture detail features in the pest and disease monitoring image; and the smaller the grayscale information entropy, the smaller the degree of uncertainty in the grayscale value distribution in the pest and disease monitoring image, indicating that there are fewer texture detail features in the pest and disease monitoring image. Therefore, by determining the grayscale information entropy, the degree of damage to the target trees by pests and diseases can be effectively identified.
[0044] In specific implementation, the suspicion degree of pests and diseases of the target trees is determined by the spectral energy ratio and the grayscale information entropy, that is, the spectral energy ratio and the grayscale information entropy are weighted and calculated, and the weighted summation result is used as the suspicion degree of pests and diseases of the target trees. In this embodiment, the weights of the spectral energy ratio and the grayscale information entropy are set to constants between 0 and 1. For example, in this application, the weight of the spectral energy ratio is set to 0.36, and the weight of the grayscale information entropy is set to 0.64. In addition, the weights of the spectral energy ratio and the grayscale information entropy can also be determined according to actual needs, which is not limited here.
[0045] It should be noted that the suspicion degree of pests and diseases in the present application indicates the degree of suspicion of the presence of pests and diseases in the target trees, that is, the greater the suspicion degree of pests and diseases, the greater the suspicion degree of the presence of pests and diseases in the target trees, and the smaller the suspicion degree of pests and diseases, the smaller the suspicion degree of the presence of pests and diseases in the target trees. In the monitoring of target trees, when the target trees are infested with pests and diseases, the leaves will change color, spot, wither, curl, etc., and spots and wormholes will appear on the stems, resulting in complex texture features in the collected monitoring images, and the changes in their texture features are also more prominent. Therefore, the present application determines the suspicion degree of pests and diseases of the target trees through the spectral energy ratio and the grayscale information entropy, which can effectively identify the degree of suspicion of the presence of pests and diseases in the target trees in the pest monitoring image, and further analyze the degree of pest and disease infestation.
[0046] It should also be noted that the preset suspicion level in the present application represents a pre-set standard pest and disease suspicion level, which is used to determine whether the target trees are infested by pests and diseases. If it exceeds this range, it indicates that the target trees are infested by pests and diseases, and further analysis of the pest and disease monitoring images is required to obtain the degree of damage to the target trees. Specifically, the preset suspicion level can be set according to actual needs and is not limited here.
[0047] In some embodiments, the first segmentation threshold of the pest monitoring image may be extracted by the following steps, namely: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determine a sample template for dividing the pest monitoring image based on the horizontal scale and the vertical scale; Dividing the pest monitoring image into a plurality of pest monitoring sub-images by using the divided sample template; The segmentation threshold of each pest monitoring sub-image is extracted, and then the first segmentation threshold of the pest monitoring image is determined by all the segmentation thresholds.
[0048] In specific implementation, the horizontal scale and vertical scale of the pest monitoring image are obtained through the image processing tool OpenCV, which will not be repeated here. The horizontal scale represents the horizontal size of the image, and the vertical scale represents the vertical size of the image.
[0049] In a specific implementation, a division sample template of the pest and disease monitoring image is determined based on the horizontal scale and the vertical scale, that is, a preset number of divisions of the pest and disease monitoring image is obtained, and the horizontal scale and the vertical scale are evenly divided according to the preset number of divisions to obtain a horizontal division scale and a vertical division scale, and then the division sample template of the pest and disease monitoring image is obtained from the horizontal division scale and the vertical division scale. In addition, in other embodiments, other determination methods may be used to obtain the division sample template, which is not limited here.
[0050] In specific implementation, the preset number of divisions of the pest and disease monitoring image can be obtained through the pest and disease image analysis database, and the preset number of divisions represents the number of sub-images into which the pest and disease monitoring image needs to be divided.
[0051] It should be noted that the division sample template in this embodiment represents a division template used as a benchmark size. By determining the division sample template, the pest and disease monitoring image can be divided into multiple sub-images. In addition, the horizontal division scale in this embodiment represents the size used as the horizontal scale of the division sample template, and the vertical division scale in this embodiment represents the size used as the vertical scale of the division sample template.
[0052] In specific implementation, the partitioned sample template divides the pest monitoring image into a plurality of pest monitoring sub-graphs, that is, the partition is performed starting from the upper left corner of the pest monitoring image according to the size of the partitioned sample template to obtain a plurality of pest monitoring sub-graphs, wherein the pest monitoring sub-graph in this embodiment represents a local image area partitioned from the pest monitoring image, and the overall monitoring image may be difficult to clearly display the pest details of each local area due to its large range, therefore, by determining the pest monitoring sub-graph, more accurate monitoring and analysis can be performed on a smaller scale.
[0053] In the specific implementation, the segmentation threshold of each pest and disease monitoring sub-image is extracted, that is: the segmentation threshold of each pest and disease monitoring sub-image can be extracted by the Otsu method in image processing, which will not be repeated here. The Otsu method is a threshold selection method based on maximizing the inter-class variance. It finds a threshold so that the inter-class variance between the segmented foreground and background is maximized, that is, the difference between the two is maximized, thereby obtaining the segmentation threshold. In addition, in other embodiments, other segmentation threshold extraction methods can also be used to extract the segmentation threshold of each pest and disease monitoring sub-image, which is not limited here. In this embodiment, the segmentation threshold represents the value of segmenting the image into background and foreground. In this application, the foreground represents the target information to be extracted, and the background represents the interference information to be separated.
[0054] In specific implementation, the first segmentation threshold of the pest and disease monitoring image is determined by all the segmentation thresholds, that is, all the segmentation thresholds are averaged, and the mean calculation result is used as the first segmentation threshold of the pest and disease monitoring image. In addition, in other embodiments, other determination methods can also be used to determine the first segmentation threshold of the pest and disease monitoring image, which is not limited here.
[0055] It should be noted that the first segmentation threshold in the present application represents the first threshold for foreground and background segmentation of the pest and disease monitoring image, which is used to analyze the degree of pest and disease damage in the target trees in the pest and disease monitoring image. By determining the first segmentation threshold, the pest and disease monitoring image is quickly divided into different areas for the first time, thereby roughly analyzing the occurrence scope and severity of pests and diseases in the target trees.
[0056] In step 103, the gradient amplitude of each pixel in the pest monitoring image is determined, a two-dimensional amplitude matrix is constructed through all the gradient amplitudes, and a second segmentation threshold of the two-dimensional amplitude matrix is extracted according to a preset image segmentation model.
[0057] In some embodiments, reference Figure 3As shown in FIG. 1 , this figure is an exemplary flow chart of determining the gradient amplitude according to some embodiments of the present application. In this embodiment, determining the gradient amplitude of each pixel in the pest monitoring image can be achieved by using the following steps: First, in step 1031, the horizontal gradient component and the vertical gradient component corresponding to each pixel point in the pest monitoring image are determined; Then, in step 1032, a pixel point is selected as a selected pixel point, and the gradient amplitude of the selected pixel point is determined according to the horizontal gradient component and the vertical gradient component corresponding to the selected pixel point; Finally, in step 1033, the gradient amplitudes of the remaining pixel points are continuously determined, thereby obtaining the gradient amplitudes of the respective pixel points in the pest monitoring image.
[0058] In some embodiments, the horizontal gradient component and the vertical gradient component corresponding to each pixel point in the pest monitoring image may be determined by the following steps, namely: Obtaining a preset horizontal convolution kernel and a preset vertical convolution kernel of the pest monitoring image; Extracting local image pixel blocks of each pixel point in the pest monitoring image; For each pixel point, the corresponding local image pixel block is convolved with the preset horizontal convolution kernel and the preset vertical convolution kernel respectively to obtain the horizontal gradient component and the vertical gradient component corresponding to the pixel point, and then the horizontal gradient component and the vertical gradient component corresponding to each pixel point in the pest and disease monitoring image are obtained.
[0059] In specific implementation, the preset horizontal convolution kernel and the preset vertical convolution kernel of the pest and disease monitoring image can be obtained through the pest and disease image analysis database. The preset horizontal convolution kernel is usually: [-1, 0, 1; -2, 0, 2; -1, 0, 1], and the preset horizontal convolution kernel is usually: [-1, -2, -1; 0, 0, 0; 1, 2, 1]. Among them, the preset horizontal convolution kernel in this embodiment represents a preset matrix for detecting horizontal edge information of the image, and the preset vertical convolution kernel in this embodiment represents a preset matrix for detecting vertical edge information of the image.
[0060] In a specific implementation, a local image pixel block of each pixel point in the pest and disease monitoring image is extracted, that is, for each pixel point, the corresponding eight-neighborhood area is extracted with the pixel point as the center pixel point, and the eight-neighborhood area is used as the local image pixel block of the pixel point, thereby obtaining the local image pixel block of each pixel point. In addition, in other embodiments, other methods may be used to extract the local image pixel block of each pixel point in the pest and disease monitoring image, which is not limited here.
[0061] It should be noted that, in this embodiment, the local image pixel block represents the range of the eight-neighborhood area extracted with the pixel point as the center.
[0062] It should also be noted that, in this embodiment, the horizontal gradient component represents a quantity used to describe the degree of change of the pest and disease monitoring image in the horizontal direction, that is, the larger the horizontal gradient component, the greater the degree of change of the pest and disease monitoring image in the horizontal direction, and vice versa. The vertical gradient component in this embodiment represents a quantity used to describe the degree of change of the pest and disease monitoring image in the vertical direction, that is, the larger the vertical gradient component, the greater the degree of change of the pest and disease monitoring image in the vertical direction, and vice versa.
[0063] In a specific implementation, the gradient amplitude of the selected pixel point is determined according to the horizontal gradient component and the vertical gradient component corresponding to the selected pixel point, that is, the square sum of the horizontal gradient component and the vertical gradient component is calculated, and then the square root of the result of the square sum calculation is taken to obtain the gradient amplitude of the selected pixel point.
[0064] In a specific implementation, the gradient amplitude of the remaining pixels can be further determined by "determining the gradient amplitude of the selected pixel according to the horizontal gradient component and the vertical gradient component corresponding to the selected pixel", thereby obtaining the gradient amplitude of each pixel in the pest monitoring image. It should be noted that the gradient amplitude in the present application represents a quantity that describes the degree of change of pixel points in the pest and disease monitoring image, that is, the larger the gradient amplitude, the more drastic the change of pixel points in the pest and disease monitoring image, and vice versa. The edges in the image are usually places where the gradient amplitude is large, because the pixel values at the edges change most drastically. By calculating the gradient amplitude, the edge information in the image can be effectively detected. For example, in the pest and disease monitoring image, the gradient amplitude can be used to identify the edges of leaves, abnormal edges caused by pests and diseases, etc., so as to determine the location and range of the pests and diseases.
[0065] In some embodiments, constructing a two-dimensional amplitude matrix using all gradient amplitudes may specifically be performed using the following steps, namely: Create a two-dimensional matrix with the same size as the pest monitoring image; Each pixel point of the pest monitoring image is traversed, and the gradient amplitude of each pixel point is filled into the corresponding position in the two-dimensional matrix to obtain a two-dimensional amplitude matrix.
[0066] In specific implementation, a data structure in the prior art (such as a NumPy array) is used to create a two-dimensional matrix of the same size as the pest monitoring image, which will not be described here. The two-dimensional matrix represents a two-dimensional array structure composed of rows and columns.
[0067] It should be noted that the number of rows and columns of the two-dimensional matrix in this embodiment corresponds to the number of pixel rows and columns of the pest and disease monitoring image, and each pixel in the pest and disease monitoring image has a corresponding position in the two-dimensional array. In this application, the two-dimensional amplitude matrix represents a two-dimensional data structure composed of amplitude information at each pixel point in the pest and disease monitoring image. Each element in the two-dimensional amplitude matrix stores the gradient amplitude at the corresponding pixel point in the pest and disease monitoring image. By determining the two-dimensional amplitude matrix, the edges and features in the pest and disease monitoring image can be effectively highlighted. In the process of calculating the gradient amplitude, the boundary between the pest and disease area and the healthy area in the image and the specific texture and shape changes caused by the pests and diseases will be expressed as a higher amplitude in the amplitude matrix, which is conducive to more clear identification of the location and range of the pests and diseases.
[0068] In some embodiments, the second segmentation threshold of the two-dimensional amplitude matrix may be extracted according to a preset image segmentation model by using the following steps, namely: Get the preset image segmentation model; The two-dimensional amplitude matrix is input into a preset image segmentation model, and the preset image segmentation model outputs a second segmentation threshold.
[0069] In specific implementation, a preset image segmentation model can be obtained through the pest and disease image analysis database. The image segmentation model described in the present application is processed using a threshold iteration model. In addition, other image segmentation models may also be used for processing in other embodiments, such as a bimodal model and an Otsu model, which are not limited here. The processing principle of the threshold iteration model in the present implementation example is: initially select an estimated threshold value, divide the image into two parts, the target and the background, calculate the average grayscale value of the two parts, update the threshold according to the new average grayscale value, and repeat this process until the threshold converges to obtain the final segmentation threshold.
[0070] It should be noted that the second segmentation threshold in the present application represents the second segmentation threshold used to segment the background and foreground of the pest and disease monitoring image. The segmentation threshold is the key criterion for dividing the pixels in the pest and disease monitoring image into pest and disease areas and healthy areas. By determining the second segmentation threshold, the areas affected by pests and diseases in the image can be further distinguished from the normal healthy areas, avoiding confusion between pest and disease areas and healthy areas, thereby more accurately assessing the scope and severity of pests and diseases.
[0071] In step 104, the first segmentation threshold and the second segmentation threshold are used to perform dynamic segmentation verification on the pest monitoring image to obtain a confidence segmentation threshold of the pest monitoring image.
[0072] In some embodiments, the first segmentation threshold and the second segmentation threshold are used to perform dynamic segmentation verification on the pest monitoring image, and the confidence segmentation threshold of the pest monitoring image is obtained by specifically adopting the following steps, namely: constructing a dynamic segmentation threshold interval by using the first segmentation threshold and the second segmentation threshold; Extract all segmentation threshold samples from the dynamic segmentation threshold interval; For each segmentation threshold sample, the segmentation threshold sample is used to segment the foreground area and the background area of the pest monitoring image, and the average grayscale value of the segmented foreground area is calculated as a ratio to the average grayscale value of the background area, thereby obtaining a relative grayscale ratio of the segmented pest monitoring image by each segmentation threshold sample; Determining the confidence relative grayscale ratio of the pest monitoring image from all relative grayscale ratios; The confidence segmentation threshold of the pest monitoring image is obtained by extracting the confidence relative grayscale ratio from the dynamic segmentation threshold interval.
[0073] It should be noted that, in this embodiment, the calculation result of the ratio of the average grayscale value of the foreground area to the average grayscale value of the background area is used as the relative grayscale ratio.
[0074] In specific implementation, a dynamic segmentation threshold interval is constructed by the first segmentation threshold and the second segmentation threshold, that is: the first segmentation threshold and the second segmentation threshold are numerically compared, the maximum segmentation threshold is used as the upper limit value of the dynamic segmentation threshold interval, and the minimum segmentation threshold is used as the lower limit value of the dynamic segmentation threshold interval, thereby obtaining the dynamic segmentation threshold interval. In this embodiment, the dynamic segmentation threshold interval represents the segmentation threshold range for dynamic segmentation of the pest and disease monitoring image.
[0075] In a specific implementation, all segmentation threshold samples are extracted from the dynamic segmentation threshold interval, that is, starting from the lower limit value of the dynamic segmentation threshold interval, all segmentation thresholds with a value of 1 as a step size are extracted from the dynamic segmentation threshold interval, and each extracted segmentation threshold is used as a segmentation threshold sample, thereby obtaining all segmentation threshold samples. For example, when the dynamic segmentation threshold interval is [112, 117], all segmentation thresholds with a value of 1 as a step size are extracted from the dynamic segmentation threshold interval: 112, 113, 114, 115, 116, 117.
[0076] It should be noted that the segmentation threshold sample in this embodiment represents a sample used to determine the optimal segmentation threshold. In addition, the relative grayscale ratio in this embodiment represents the ratio between the average grayscale value of the foreground and the average grayscale value of the background in the pest and disease monitoring image after segmentation by the segmentation threshold. By determining the relative grayscale ratio, the relative difference in grayscale between the target area and the background area can be effectively evaluated.
[0077] In a specific implementation, the segmentation threshold sample is used to segment the foreground area and the background area of the pest monitoring image, that is, the segmentation threshold sample is compared with the grayscale value corresponding to each pixel in the pest monitoring image, and when the grayscale value corresponding to the pixel is greater than the segmentation threshold sample, the pixel corresponding to the grayscale value is used as an element of the foreground area, otherwise, the pixel corresponding to the grayscale value is used as an element of the background area, thereby obtaining the foreground area and background area of the pest monitoring image. It should be noted that in the present application, the foreground area represents the area in the pest monitoring image where pests and diseases are infested, and the foreground area represents other areas in the pest monitoring image except the area where pests and diseases are infested.
[0078] In specific implementation, the confidence relative grayscale ratio of the pest and disease monitoring image is determined by all relative grayscale ratios, that is, the average value of all relative grayscale ratios is calculated, and the average value calculation result is used as the confidence relative grayscale ratio of the pest and disease monitoring image. In addition, in other embodiments, other calculation methods can also be used to calculate the confidence relative grayscale ratio of the pest and disease monitoring image, which is not limited here.
[0079] It should be noted that the confidence relative grayscale ratio in this embodiment represents the confidence ratio between the average grayscale value of the foreground area and the average grayscale value of the background area in the pest and disease monitoring image, that is, in this application, it is the comprehensive relative grayscale ratio of each segmented sample after segmentation. The true ratio between the average grayscale value of the foreground area and the average grayscale value of the background area in the pest and disease monitoring image can be more accurately identified by the confidence relative grayscale ratio, so as to obtain the optimal segmentation threshold of the pest and disease monitoring image according to the ratio.
[0080] In specific implementation, the confidence segmentation threshold of the pest and disease monitoring image is extracted from the dynamic segmentation threshold interval through the confidence relative grayscale ratio, that is: the segmentation threshold sample corresponding to the confidence relative grayscale ratio is extracted from the dynamic segmentation threshold interval, and the segmentation threshold sample is used as the confidence segmentation threshold of the pest and disease monitoring image.
[0081] It should be noted that the confidence segmentation threshold in the present application represents an effective segmentation threshold that can be used to segment the pest and disease monitoring image. The confidence segmentation threshold can accurately segment the target area and the background area in the pest and disease monitoring image. In the pest and disease monitoring image, the pest and disease monitoring image will be affected by the adhesion of pests and diseases to each other or mixed with plant tissues, as well as the similarity between the color and texture characteristics of pests and diseases and the color and texture characteristics of plant leaves in the background, making it difficult for existing segmentation algorithms to accurately distinguish between foreground areas and background areas, and unable to accurately determine the degree of pest and disease damage. The present application dynamically verifies the segmentation threshold to obtain an effective segmentation threshold for the pest and disease monitoring image, so as to more realistically and effectively distinguish the pest and disease area from the normal background area, reduce misjudgments and missed judgments, and thus avoid the adhesion caused by pests and diseases sticking to each other or mixing with plant tissues, as well as the similarity between the color and texture characteristics of pests and diseases and the color and texture characteristics of plant leaves in the background, thereby improving the accuracy of identifying pest and disease damage.
[0082] It should also be noted that the dynamic segmentation verification in the present application refers to the process of dynamically extracting the optimal segmentation threshold (confidence segmentation threshold) for the pest and disease monitoring image, wherein the first segmentation threshold and the second segmentation threshold are used to perform dynamic segmentation verification on the pest and disease monitoring image, that is: a dynamic segmentation threshold interval is constructed by the first segmentation threshold and the second segmentation threshold; all segmentation threshold samples are extracted from the dynamic segmentation threshold interval; for each segmentation threshold sample, the foreground area and the background area of the pest and disease monitoring image are segmented by the segmentation threshold sample, and the ratio of the average grayscale value of the foreground area after segmentation to the average grayscale value of the background area is calculated, thereby obtaining the relative grayscale ratio of each segmentation threshold sample after segmentation; the confidence relative grayscale ratio of the pest and disease monitoring image is determined by all relative grayscale ratios; the confidence segmentation threshold of the pest and disease monitoring image is extracted from the dynamic segmentation threshold interval by the confidence relative grayscale ratio, thereby completing the dynamic segmentation verification of the pest and disease monitoring image.
[0083] In step 105, the pest monitoring image is segmented based on the confidence segmentation threshold, and the degree of pest damage of the target trees in the pest monitoring image is determined according to the segmentation result.
[0084] In some implementations, the pest monitoring image is segmented based on the confidence segmentation threshold, and the pest damage degree of the target trees in the pest monitoring image is determined according to the segmentation result, specifically by the following steps, namely: Segmenting the pest monitoring image according to the confidence segmentation threshold to obtain a foreground area and a background area corresponding to the pest monitoring image; The pest and disease infestation area of the target trees in the pest and disease monitoring image is analyzed based on the foreground area.
[0085] In a specific implementation, the confidence segmentation threshold is used to segment the pest and disease monitoring image to obtain the foreground area and background area corresponding to the pest and disease monitoring image, that is, the confidence segmentation threshold is compared with the grayscale value corresponding to each pixel in the pest and disease monitoring image. When the grayscale value corresponding to the pixel is greater than the confidence segmentation threshold, the pixel corresponding to the grayscale value is used as an element of the foreground area of the pest and disease monitoring image; otherwise, the pixel corresponding to the grayscale value is used as an element of the background area of the pest and disease monitoring image, thereby obtaining the foreground area and background area of the pest and disease monitoring image.
[0086] In specific implementation, the pest and disease damage area of the target trees in the pest and disease monitoring image is analyzed based on the foreground area, that is, the total number of pixels in the foreground area is obtained, and the total number of pixels is used as the pest and disease damage area of the target trees in the pest and disease monitoring image.
[0087] It should be noted that in this embodiment, the area of pest and disease damage can be used to measure the degree of pest and disease damage to the target trees, that is, the larger the area of pest and disease damage, the greater the degree of pest and disease damage to the target trees, and the smaller the area of pest and disease damage, the smaller the degree of pest and disease damage to the target trees. In specific implementation, the degree of pest and disease damage corresponding to different areas of pest and disease damage can be pre-set, so as to obtain the corresponding degree of pest and disease damage according to the determined area of pest and disease damage of the target trees, which will not be repeated here.
[0088] In addition, in another aspect of the present application, in some embodiments, the present application provides a pest and disease protection system for forestry seedling cultivation, the system comprising a pest and disease image recognition unit, referring to Figure 4 , which is a schematic diagram of exemplary hardware and / or software of a pest image recognition unit according to some embodiments of the present application, the pest image recognition unit 200 includes: a collection module 201, a processing module 202 and an execution module 203, which are described as follows: Collection module 201, in this application, the collection module 201 is mainly used to collect pest and disease monitoring images of target trees; Processing module 202, in the present application, processing module 202 is mainly used to perform frequency domain transformation on the pest monitoring image, obtain multiple frequency domain coefficients corresponding to the pest monitoring image, determine the pest suspicion of the target tree through all frequency domain coefficients and the grayscale information entropy of the pest monitoring image, and when the pest suspicion is greater than the preset suspicion, extract the first segmentation threshold of the pest monitoring image; The processing module 202 is further used to determine the gradient amplitude of each pixel in the pest monitoring image, construct a two-dimensional amplitude matrix through all the gradient amplitudes, and extract a second segmentation threshold of the two-dimensional amplitude matrix according to a preset image segmentation model; In addition, the processing module 202 is further used to perform dynamic segmentation verification on the pest monitoring image using the first segmentation threshold and the second segmentation threshold to obtain a confidence segmentation threshold of the pest monitoring image; Execution module 203, in the present application, the execution module 203 is mainly used to segment the pest monitoring image based on the confidence segmentation threshold, and determine the degree of pest damage of the target trees in the pest monitoring image according to the segmentation result.
[0089] In addition, the present application also provides a computer device, which includes a memory and a processor, the memory stores a code, and the processor is configured to obtain the code and execute the above-mentioned pest and disease monitoring image recognition method.
[0090] In some embodiments, reference Figure 5 , which is a schematic diagram of the structure of a computer device for implementing a pest monitoring image recognition method according to some embodiments of the present application. The pest monitoring image recognition method in the above embodiment can be Figure 5 The computer device 300 shown in the figure is implemented, and the computer device 300 includes at least one processor 301, a communication bus 302, a memory 303 and at least one communication interface 304.
[0091] The processor 301 may be a general-purpose central processing unit (CPU), or an application specific integrated circuit (ASIC) or one or more processors for controlling the execution of the pest monitoring image recognition method in the present application.
[0092] The communication bus 302 may be used to transmit information between the above-mentioned components.
[0093] The memory 303 may be a read only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read only memory (EEPROM), a compact disc read only memory (CD ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.
[0094] The memory 303 is used to store the program code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the program code stored in the memory 303. The program code may include one or more software modules. The determination of the pest monitoring image recognition method in the above embodiment can be implemented by the processor 301 and one or more software modules in the program code in the memory 303.
[0095] The communication interface 304 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0096] In a specific implementation, as an embodiment, a computer device may include multiple processors, each of which may be a single-core (single CPU) processor or a multi-core (multi CPU) processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0097] The above-mentioned computer device may be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the computer device may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device. The embodiment of the present application does not limit the type of computer device.
[0098] In addition, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned pest and disease monitoring image recognition method is implemented.
[0099] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0100] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A pest monitoring image recognition method, used for the pest protection system of forestry seedling cultivation to perform protection and identification of forestry pests, characterized in that: The method comprises the following steps: Collect pest and disease monitoring images of target trees; Performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image, determining the pest suspicion of the target tree through all the frequency domain coefficients and the grayscale information entropy of the pest monitoring image, and extracting a first segmentation threshold of the pest monitoring image when the pest suspicion is greater than a preset suspicion; Determine the gradient amplitude of each pixel in the pest monitoring image, construct a two-dimensional amplitude matrix through all the gradient amplitudes, and extract a second segmentation threshold of the two-dimensional amplitude matrix according to a preset image segmentation model; Performing dynamic segmentation verification on the pest monitoring image using the first segmentation threshold and the second segmentation threshold to obtain a confidence segmentation threshold of the pest monitoring image; The pest monitoring image is segmented based on the confidence segmentation threshold, and the degree of pest damage of the target trees in the pest monitoring image is determined according to the segmentation result.
2. The method according to claim 1, characterized in that Performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image specifically includes: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determining the horizontal frequency range and the vertical frequency range of the pest monitoring image by the horizontal scale and the vertical scale respectively; Determine all frequency positions according to the horizontal frequency range and the vertical frequency range; Selecting a frequency position as a selected frequency position, and determining a frequency domain coefficient corresponding to the selected frequency position according to position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest and disease monitoring image; Continue to determine the frequency domain coefficients corresponding to the remaining frequency positions, and then obtain multiple frequency domain coefficients corresponding to the pest monitoring image.
3. The method according to claim 2, characterized in that Determining the frequency domain coefficient corresponding to the selected frequency position according to the position information corresponding to the selected frequency position, the horizontal scale, the vertical scale, and the pixel value of each pixel point in the pest monitoring image specifically includes: Extracting a horizontal normalization factor and a vertical normalization factor corresponding to a selected frequency position according to the horizontal scale and the vertical scale respectively; Obtaining a preset frequency domain transformation model; The horizontal normalization factor, the vertical normalization factor, the position information corresponding to the selected frequency position and the pixel value of each pixel in the pest and disease monitoring image are input into the frequency domain transformation model, and the frequency domain transformation model outputs the frequency domain coefficient corresponding to the selected frequency position.
4. The method according to claim 1, characterized in that Determining the suspiciousness of pests and diseases of target trees through all frequency domain coefficients and the grayscale information entropy of the pest and disease monitoring image specifically includes: Extract the total number of high-frequency coefficients and the total number of low-frequency coefficients from all frequency domain coefficients; Determining a spectrum energy ratio of the pest monitoring image according to the total number of high-frequency coefficients and the total number of low-frequency coefficients; Determining the grayscale information entropy of the pest monitoring image; The suspicious degree of pests and diseases of target trees is determined by the spectral energy ratio and the grayscale information entropy.
5. The method according to claim 4, characterized in that Determining the grayscale information entropy of the pest monitoring image specifically includes: Obtaining the grayscale value corresponding to each pixel in the pest monitoring image; Extract all different grayscale values and determine the grayscale proportion of each different grayscale value; The grayscale information entropy of the pest monitoring image is determined according to the grayscale proportions of different grayscale values.
6. The method according to claim 1, characterized in that Extracting the first segmentation threshold of the pest monitoring image specifically includes: Obtaining the horizontal scale and vertical scale of the pest monitoring image; Determine a sample template for dividing the pest monitoring image based on the horizontal scale and the vertical scale; Dividing the pest monitoring image into a plurality of pest monitoring sub-images by using the divided sample template; The segmentation threshold of each pest monitoring sub-image is extracted, and then the first segmentation threshold of the pest monitoring image is determined by all the segmentation thresholds.
7. The method according to claim 1, characterized in that The pest and disease monitoring images of the target trees are collected through surveillance cameras.
8. A pest and disease protection system for forestry seedling cultivation, the pest and disease protection system for forestry seedling cultivation comprising a pest and disease image recognition unit, characterized in that: The pest image recognition unit comprises: A collection module is used to collect pest and disease monitoring images of target trees; A processing module, for performing frequency domain transformation on the pest monitoring image to obtain a plurality of frequency domain coefficients corresponding to the pest monitoring image, determining the pest suspicion of the target tree through all the frequency domain coefficients and the grayscale information entropy of the pest monitoring image, and extracting a first segmentation threshold of the pest monitoring image when the pest suspicion is greater than a preset suspicion; The processing module is further used to determine the gradient amplitude of each pixel in the pest monitoring image, construct a two-dimensional amplitude matrix through all the gradient amplitudes, and extract a second segmentation threshold of the two-dimensional amplitude matrix according to a preset image segmentation model; The processing module is further configured to perform dynamic segmentation verification on the pest monitoring image using the first segmentation threshold and the second segmentation threshold to obtain a confidence segmentation threshold of the pest monitoring image; An execution module is used to segment the pest monitoring image based on the confidence segmentation threshold, and determine the degree of pest damage of the target trees in the pest monitoring image according to the segmentation result.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores codes, and the processor is configured to obtain the codes and execute the pest monitoring image recognition method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the pest monitoring image recognition method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Rice disease and pest monitoring method and system
CN112750123A
Rapid detection method for garden plant disease and insect pest area
CN117974989A
Intelligent detection method and system for diseases and insect pests of agricultural crops
CN118762189A
An interpretable device for the detection of leaf diseases (I-LDD)
DE202024103925U1