A method for identifying and tracking pine wilt disease in wood sections
By processing cross-sectional images of infected trees using a deep learning platform, extracting features, and combining them with gray-level co-occurrence matrices, the problem of low efficiency in manual labeling methods is solved, achieving efficient and accurate identification and tracking of infected trees.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, the manual marking method for identifying pine nematode-infected timber is inefficient, costly, and labor-intensive, making it difficult to accurately identify and track infected timber.
A deep learning platform was built to acquire cross-sectional images of infected trees using an industrial CCD camera. The images were then processed to grayscale and binarize them, and image features such as area, perimeter, and HU invariant moments were extracted. By combining the grayscale co-occurrence matrix and Euclidean distance, the identification and tracking of cross-sections of infected trees were achieved.
It improved the efficiency and accuracy of diseased tree identification and tracking, reduced the cost of manual identification, and achieved efficient diseased tree identification and tracking.
Smart Images

Figure CN115294457B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of tree disease and pest control technology, specifically to a method for identifying and tracking cross-sections of wood infected with pine nematode disease. Background Technology
[0002] Pine wilt disease is a major quarantine forest disease. It has caused widespread pine tree death in more than ten provinces and regions of my country, and currently 60 million square meters of pine forest are threatened by a major pine wilt disease outbreak. Currently, the control technologies adopted in my country mainly focus on the following key aspects: disease quarantine, epidemic monitoring, treatment of infected timber (referring to timber infected with pine wilt disease), and vector insect control.
[0003] Among these methods, the removal of infected trees is the most direct and effective way to control disease outbreaks. When infected trees in certain key areas cannot be removed, it is essential to organize the timely clearing of the infected trees and surrounding timber. Other isolated infected trees and newly grown diseased trees must also be eradicated.
[0004] To avoid timber loss, traditional techniques typically involve manually marking diseased timber. However, manual marking methods are limited by low efficiency, high cost, large workload, and susceptibility to measurement conditions. Therefore, achieving accurate identification of diseased trees remains a challenge. Summary of the Invention
[0005] In order to solve the above-mentioned technical problems, this application proposes the following technical solution:
[0006] In a first aspect, embodiments of this application provide a method for identifying and tracking cross-sections of wood infected with pine nematode disease, the method comprising:
[0007] Build a deep learning platform for recognizing cross-sections of infected trees;
[0008] The cross-section of the infected wood is processed using the deep learning platform to obtain an image of the infected wood cross-section;
[0009] The cross-sectional image of the infected wood is subjected to grayscale and binarization processing to obtain grayscale and binarized images of the cross-section of the infected wood;
[0010] Extract the area, perimeter, and 7 HU invariant moments from the binarized image of the infected wood cross-section;
[0011] Calculate the gray-level co-occurrence matrix of the gray-level image of the cross-section of the infected tree, and calculate the normalized frequency matrix of the gray-level co-occurrence matrix.
[0012] The second moment of the image, entropy, contrast, and inverse variance are calculated based on the gray-level co-occurrence matrix.
[0013] The area, perimeter, 7 HU invariant moments, second angular moment, entropy, contrast, and inverse variance of the binarized cross-section image of the infected tree obtained above are combined into a 13-dimensional recognition vector.
[0014] The infected trees at the site of the disease removal and treatment were numbered according to the identification sequence, and the infected tree numbers and corresponding identification vectors were stored in the SQL database.
[0015] After the timber to be treated is transported to the disposal site, the above process is repeated;
[0016] The newly obtained identification vector is then compared with the identification vector in the SQL database. The two infected trees with the smallest distance between their identification vectors are considered to be the same infected tree, thus completing the cross-sectional identification and tracking of infected trees.
[0017] The above implementation method first involves collecting a large number of standard cross-sectional images of infected trees, labeling them using an annotation tool, performing offline augmentation, training a neural network framework, and building a deep learning platform in conjunction with an instance segmentation algorithm. This platform is then used to remove the background from the infected tree images, converting and binarizing the background-removed images, and extracting data such as perimeter and area to form a 13-dimensional recognition vector. The infected trees are then numbered sequentially. The tree numbers and their corresponding Euclidean distances are stored in an SQL database. This process is repeated at the infected tree disposal site, and the data is compared and analyzed to achieve the identification and tracking of infected tree interfaces. This method enables the identification and tracking of a large number of infected trees, improving the efficiency and accuracy of infected tree identification and tracking.
[0018] In conjunction with the first aspect, in the first possible implementation of the first aspect, the construction of the deep learning platform for identifying cross-sections of infected trees includes:
[0019] An industrial CCD camera was used to collect cross-sectional images of infected trees in a standard field area, resulting in true-color original images of infected tree cross-sections with background in 24-bit R, G, B color space.
[0020] The infected trees in the above images were labeled using annotation tools, and the corresponding dataset was obtained.
[0021] Offline data augmentation is performed on the dataset to obtain an augmented dataset.
[0022] In the augmented dataset, 60% is randomly selected as the training set, 20% as the validation set, and the remaining 20% as the test set.
[0023] Deep learning networks are built using pre-installed convolutional neural networks and fully convolutional neural networks in conjunction with instance segmentation algorithms.
[0024] The obtained training and validation sets are input into the deep learning network to obtain multiple generalized models.
[0025] The obtained test set is used to evaluate multiple generalization models, and the model with the smallest generalization error is selected as the generalization model of the deep learning platform, thus completing the construction of the deep learning platform.
[0026] In conjunction with the first possible implementation of the first aspect, in the second possible implementation of the first aspect, the step of processing the cross-section of the infected tree with the deep learning platform to obtain the cross-sectional image of the infected tree includes:
[0027] A true-color original cross-sectional image of the wood with background was obtained using an industrial CCD camera in 24-bit deep R, G, B color space.
[0028] Read in the original cross-sectional image of the infected tree with background;
[0029] The aforementioned deep learning platform was used to process the cross-sectional image of the infected tree with background to obtain a cross-sectional image of the infected tree without background.
[0030] In conjunction with the second possible implementation of the first aspect, in the third possible implementation of the first aspect, the step of performing grayscale and binarization processing on the cross-sectional image of the infected tree to obtain a grayscale image and a binarized image of the cross-sectional image of the infected tree includes:
[0031] The weighted average of the R, G, and B channels of each pixel is calculated using Gray = (0.114*R + 0.587*G + 0.299*B) to obtain the grayscale value of all pixels.
[0032] The obtained gray values are simultaneously assigned to the R, G, and B channels of the corresponding pixels to obtain a grayscale image with the same R, G, and B values for each pixel, and then saved.
[0033] After processing by the deep learning platform, all pixels except the cross-section of the infected wood are white. The global threshold is set to (254, 254, 254). Pixels with a value less than this threshold are assigned a value of 0 and become black, while pixels with a value greater than this threshold are assigned a value of 255 and become white, thus obtaining a binarized image.
[0034] In conjunction with the third possible implementation of the first aspect, in the fourth possible implementation of the first aspect, the extraction of the area, perimeter, and 7 HU invariant moments of the binarized cross-section image of the infected tree includes:
[0035] The binary image is subjected to multiple morphological dilation and erosion operations to eliminate defects in the cross-sectional area of the infected wood caused by overexposure and wear during the capture of the cross-sectional image.
[0036] The obtained image is used in conjunction with the OpenCV library to perform maximum closed contour detection and obtain the coordinates of the maximum closed contour;
[0037] The perimeter and area of the image are calculated using the coordinates of the maximum closed contour.
[0038] Traverse the grayscale image to obtain the total number of pixels and the grayscale value of each pixel, and calculate the second and third central moments;
[0039] The obtained second-order and third-order central moments were used to calculate seven HU invariant moments.
[0040] In conjunction with the fourth possible implementation of the first aspect, in the fifth possible implementation of the first aspect, the calculation of the perimeter and area of the image using the coordinates of the maximum closed contour includes:
[0041] Let there be n coordinates of the largest closed contour, then the perimeter of the infected tree is... When i = n, x n+1 =x1,y n+1 =y1,(x i ,y i ) represents the coordinates of the i-th contour.
[0042] Let S be the area of the image region. Connecting the coordinates of the maximum contour using a polyline yields a closed simple n-gon, which is a simply connected region. Let L be the boundary curve of this simply connected region.
[0043] The area S of the infected region in the image is obtained by calculating the loop integral of the boundary curve of the simply connected region.
[0044] In conjunction with the fourth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, the step of traversing the grayscale image to obtain the total number of pixels and the grayscale value of each pixel, and calculating the second and third central moments, includes:
[0045] First, calculate the 0th order (m) of the grayscale image. 00 ) and first-order geometric moment (m 01 ,m 10 );
[0046] Calculate the 0th order geometric moment (m) using the above geometric moment formula. 00 ) and first-order geometry (m pq (p+q=1) moments, i.e.
[0047] Then the second and third central moments were calculated.
[0048] Second-order center distance:
[0049] Third-order center distance:
[0050] In conjunction with the fourth possible implementation of the first aspect, in the seventh possible implementation of the first aspect, the calculation of the seven HU invariant moments using the obtained second-order and third-section central moments includes:
[0051] First, let's look at the formula η. pq =η pq / η 00 γ The second and third central moments of (γ=(p+q) / 2) are normalized to obtain the corresponding normalized central moments, η. 00 =m 00 The sum of p and q represents the order of the normalized central moments;
[0052] We obtain the normalized second moment (η) 02 η 11 η 20 ) and normalized third-order central moments (η) 03 η 12 η 21 η 30 );
[0053] Use the following formula to calculate the 7 Hu invariant moments:
[0054] Hu_0=η 20 +η 02 ;
[0055] Hu_1=(η 20 -η 02 ) 2 +4*(η 11 ) 2 ;
[0056] Hu_2=(η 20 -3*η 12 ) 2 +3*(η 21 -η 03 ) 2 ;
[0057] Hu_3=(η 30 +η 12 ) 2 +3*(η 21 +η 03 ) 2 ;
[0058] Hu_4=(η 30 +3*η 12 )(η 30 +η 12 )[(η 30 +η 12 ) 2 -3*(η21 +η 03 ) 2 ]+(3*η 21 -η 03 )(η 21 +η 03 )[3*(η 30 +η 12 ) 2 -(η 21 +η 03 ) 2 ];
[0059] Hu_5=(η 20 -η 02) [(η 30 +η 12 ) 2 -(η 21 +η 03 ) 2 ]+4*η 11 (η 30 +η 12 )(η 21 +η 03 );
[0060] Hu_6=(3*η 21 -η 03 )(η 30 +η 12 )[(η 30 +η 12 ) 2 -3*(η 21 +η 03 ) 2 ]-(η 30 -3*η 12 )(η 21 +η 03 [(η 30 +η 12 ) 2 -3*(η 21 +η 03 ) 2 ]).
[0061] In conjunction with any of the fifth to seventh possible implementations of the first aspect, in the eighth possible implementation of the first aspect, the step of calculating the gray-level co-occurrence matrix of the gray-level image of the cross-section of the infected tree and calculating the normalized frequency matrix of the gray-level co-occurrence matrix includes:
[0062] By traversing the grayscale image, the maximum grayscale level of the grayscale image is obtained.
[0063] If the maximum gray level exceeds 16, the grayscale image is compressed, including: traversing all pixels of the grayscale image, using the formula gray new(pixel gray value) = gray(original gray value) * 16 / max Gray Level(maximum gray level) to compress the original grayscale image and save it;
[0064] Construct a 16x16 matrix of all zeros;
[0065] Traverse the compressed grayscale image and perform a 0-degree scan to obtain the grayscale co-occurrence matrix;
[0066] The normalized matrix of the calculated gray-level co-occurrence matrix includes:
[0067] First, calculate the sum of all elements in the gray-level co-occurrence matrix. A(i,j) represents the value of the gray-level co-occurrence matrix in the i-th row and j-th column;
[0068] Create a new 16x16 matrix filled with zeros;
[0069] Calculate the probability value P(i,j) = A(i,j) / sum of each element in the gray-level co-occurrence matrix, and fill the corresponding position of the all-zero matrix in the previous step with P(i,j) to obtain the normalized matrix.
[0070] In conjunction with the eighth possible implementation of the first aspect, in the ninth possible implementation of the first aspect, the step of calculating the second angular moment, entropy, contrast, and inverse variance of the image based on the gray-level co-occurrence matrix includes:
[0071] Second moment of angle (P(i,j) represents the value in the i-th row and j-th column of the normalized matrix;
[0072] entropy
[0073] Contrast (i,j) represents the row and column number of P(i,j);
[0074] Inverse variance: Attached Figure Description
[0075] Figure 1 A flowchart illustrating a method for identifying and tracking cross-sections of pine nematode-infected timber, provided in an embodiment of this application;
[0076] Figure 2 This is a schematic diagram of a cross-sectional image of a diseased tree without a background, provided as an embodiment of this application.
[0077] Figure 3 This is a schematic diagram of a grayscale image of a cross-section of a diseased tree provided in an embodiment of this application;
[0078] Figure 4 This is a schematic diagram of a binarized image of a cross-section of a diseased tree provided in an embodiment of this application;
[0079] Figure 5 This is a schematic diagram of the image region of the infected tree provided in an embodiment of this application. Detailed Implementation
[0080] The present solution will now be described in conjunction with the accompanying drawings and specific embodiments.
[0081] Figure 1 A flowchart illustrating a method for identifying and tracking cross-sections of pine nematode-infected wood, as provided in this application embodiment, is shown below. Figure 1 The method for identifying and tracking cross-sections of pine nematode-infected wood in this application includes:
[0082] S101, a deep learning platform for recognizing cross-sections of infected trees.
[0083] Step S101, building a deep learning platform for identifying cross-sections of infected trees, specifically includes the following steps:
[0084] S1.1: An industrial CCD camera was used to collect cross-sectional images of infected trees in standard field areas, resulting in a large number of true-color original images of infected tree cross-sections with background in 24-bit R, G, B color space.
[0085] S1.2: Use annotation tools to annotate the infected trees in the above images and obtain the corresponding dataset.
[0086] S1.3: Perform offline data augmentation on the dataset obtained in step S1.2 to obtain the augmented dataset.
[0087] S1.4: Select 60% of the augmented dataset described in S1.3 as the training set, 20% as the validation set, and the remaining 20% as the test set.
[0088] S1.5: Use the computer's pre-installed Convolutional Neural Network (CNN) and Fully Convolutional Neural Network (FCN) in conjunction with instance segmentation algorithms to build a deep learning network.
[0089] The working process of deep learning networks is as follows:
[0090] 1) Using a CNN network as the input layer, the image passes through the CNN network and outputs the image's feature map.
[0091] 2) Input the feature map obtained in 1) into the Region Proposal Network and Roi Align (proposed by the instance segmentation algorithm) to obtain proposals (i.e., a region that may contain the infected image).
[0092] 3) Input the proposals obtained in 2) into three parallel FCN networks to generate bounding boxes and corresponding target masks.
[0093] 4) Change the RGB values of the parts of the image outside the mask to (255, 255, 255), leaving only the masked area. At this point, the instance segmentation of the image is complete.
[0094] S1.6: Use the training set and validation set obtained in step S1.4 to input the deep learning network obtained in step S1.5 to obtain multiple generalization models.
[0095] S1.7: Use the test set obtained in step S1.4 to evaluate the multiple generalization models obtained in step S1.6, and select the model with the smallest generalization error as the generalization model of the deep learning platform. At this point, the construction of the deep learning platform is complete.
[0096] S102, the cross-section of the infected wood is processed by the deep learning platform to obtain the cross-section image of the infected wood.
[0097] S2.1: Place the infected wood at a standard distance from an industrial CCD camera to obtain a large number of true-color original cross-sectional images of the infected wood with background in a 24-bit deep R, G, B color space.
[0098] S2.2: Read in the original cross-sectional image of the infected wood with background.
[0099] S2.3: The aforementioned deep learning platform is used to process the cross-sectional image of the infected tree with background, resulting in a cross-sectional image of the infected tree without background (hereinafter referred to as the infected tree cross-sectional image). The background area is all white (RGB value (255, 255, 255)). For example... Figure 2 As shown (all illustrations below are based on this image and have been processed).
[0100] S2.4: Save the processed cross-sectional image of the infected wood.
[0101] S103, perform grayscale and binarization processing on the cross-sectional image of the infected wood to obtain a grayscale image and a binarized image of the cross-section of the infected wood.
[0102] S3.1: Calculate the weighted average of the R, G, and B channels for each pixel using Gray = (0.114*R + 0.587*G + 0.299*B) to obtain the grayscale value of all pixels.
[0103] S3.2: Simultaneously assign the grayscale values from S3.1 to the R, G, and B channels of the corresponding pixels to obtain a grayscale image with the same R, G, and B values for each pixel, and save it. Figure 3 As shown.
[0104] S3.3: After processing by the deep learning platform, all pixels except the cross-section of the infected wood are white. Therefore, a global threshold is set to (254, 254, 254). Pixels with values less than this threshold are assigned a value of 0 and become black, while pixels with values greater than this threshold are assigned a value of 255 and become white, resulting in a binarized image, as shown below. Figure 4 As shown.
[0105] S104, extract the area, perimeter, and 7 HU invariant moments of the binarized image of the cross-section of the infected tree.
[0106] S4.1: Perform multiple morphological dilation and erosion operations on the binary image in S103 to eliminate defects in the cross-sectional area of the infected wood caused by overexposure and wear during the capture of the cross-sectional image.
[0107] S4.2: The image obtained in S4.1 is used with the OpenCV library to perform maximum closed contour detection and obtain the coordinates of the maximum closed contour. This is to further avoid defects in the cross-sectional area of the infected wood caused by overexposure when capturing the cross-sectional image of the infected wood. The maximum contour coordinates are obtained. Figure 5 The outline of the infected tree image area has been drawn (the thin black lines at the edges of the infected tree represent the drawn outline):
[0108] S4.3: Calculate the perimeter and area of the image using the coordinates described in step S4.2.
[0109] The calculation process for the perimeter is as follows:
[0110] Let there be n coordinates of the largest closed contour, then the perimeter of the infected tree is...
[0111] (It is stipulated that when i = n, x n+1 =x1,y n+1 =y1)((x i ,y i () represents the coordinates of the i-th contour.
[0112] The area calculation process is as follows:
[0113] Let S be the area of the image region. Connect the maximum contour coordinates obtained in step S4.2 with a polyline to obtain a closed simple n-gon, and this simple n-gon is a simply connected region. Let L be the boundary curve of the simply connected region.
[0114] Green's Theorem: If functions P(x,y) and Q(x,y) are continuous on a closed region D bounded by one or more smooth curves, and have continuous first-order partial derivatives, then we have:
[0115] Since the boundary curve of the simply connected region is a simple polygon, the area S of the epidemic image region can be obtained by calculating the loop integral of the boundary curve of the simply connected region.
[0116] Let P = 0 and Q = x, then find the area of a simply connected region. Let the i-th P i The coordinates are (x i ,y i ), the (i+1)th point P i+1 The coordinates are (x i+1 ,y i+1 ), then line segment The parametric expression is
[0117] Therefore, The area to be calculated (It is stipulated that when i = n, x n+1 =x1,y n+1 =y1).
[0118] S4.4: Traverse the grayscale image to obtain the total number of pixels and the grayscale value of each pixel, and calculate the second and third central moments.
[0119] The second-order central moment (μ) is briefly described below. 02 ,μ 11 ,μ 20 ), third central moment (μ) 03 ,μ 12 ,μ 21 ,μ 30 The calculation process of )
[0120] First, we introduce the calculation methods for (p+q) order geometric moments and central moments (Note: If calculating the nth order geometric moment, all m-moments satisfying p+q=n...). pq All are nth-order geometric moments; the same applies to nth-order normalized central moments for nth-order central moments.
[0121] Since the image is discrete, the (p+q)th order geometric moments... (p+q) order central moments, Regulation
[0122] In the above two formulas, p,q=0,1,2…,N,M represent the number of pixels in the height and width of the image (for example, if the height and width of an image are a and b in pixels respectively, then N=a and M=b), x,y represent the coordinates of a certain pixel point, and f(x,y) represents the gray value of the image at (x,y).
[0123] First, calculate the 0th order (m) of the grayscale image. 00 ) and first-order geometric moment (m 01 ,m 10 ):
[0124] Calculate the 0th order geometric moment (m) using the above geometric moment formula. 00 ) and first-order geometry (m pq (p+q=1) moments, i.e.
[0125] Then the second and third central moments were calculated.
[0126] Second-order center distance:
[0127] Third-order center distance:
[0128] S4.4: Use the second and third segment central moments obtained from S4.3 and calculate the seven HU invariant moments.
[0129] The calculation process for Hu's invariant moment is as follows:
[0130] First, let's use the formula η pq =η pq / η 00 γ (γ=(p+q) / 2)(η 00 =m 00 (The sum of p and q represents the order of the normalized central moments) The second and third order central moments are normalized to obtain the corresponding normalized central moments.
[0131] At this point, we obtain the normalized second moment (η). 02 η 11 η 20 ) and normalized third-order central moments (η) 03 η 12 η 21 η 30 ).
[0132] Use the following formula to calculate the 7 Hu invariant moments:
[0133] Hu_0=η 20 +η 02 ;
[0134] Hu_1=(η 20 -η02 ) 2 +4*(h 11 ) 2 ;
[0135] Hu_2=(h 20 -3*th 12 ) 2 +3*(h 21 -or 03 ) 2 ;
[0136] Hu_3=(h 30 +n 12 ) 2 +3*(h 21 +n 03 ) 2 ;
[0137] Hu_4=(h 30 +3*h 12 )(or 30 +n 12 )[(or 30 +n 12 ) 2 -3*(h 21 +n 03 ) 2 ]+(3*h 21 -or 03 )(or 21 +n 03 )[3*(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]
[0138] Hu_5=(h 20 -or 02) [(or 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]+4*h 11 (or 30 +n 12 )(or 21 +n 03 )
[0139] Hu_6=(3*h 21 -or 03 )(or 30 +n 12 )[(or 30 +n12 ) 2 -3*(η 21 +η 03 ) 2 ]-(η 30 -3*η 12 )(η 21 +η 03 [(η 30 +η 12 ) 2 -3*(η 21 +η 03 ) 2 ]).
[0140] S105, calculate the gray-level co-occurrence matrix of the gray-level image of the cross-section of the infected wood, and calculate the normalized frequency matrix of the gray-level co-occurrence matrix.
[0141] S5.1: Traverse the grayscale image after step S3 to obtain the maximum grayscale level of the image.
[0142] S5.2: If the maximum gray level exceeds 16, the grayscale image is compressed to reduce the computational load.
[0143] The compression process is as follows:
[0144] Iterate through all pixels of the grayscale image, compress the original grayscale image using the formula gray new(pixel grayscale value) = gray(original grayscale value) * 16 / max Gray Level(maximum grayscale level), and save the compressed image. At this point, there are 16*16 possible combinations of grayscale values for adjacent pixels.
[0145] S5.3: Construct a 16*16 matrix of all zeros.
[0146] S5.4: Traverse the grayscale image obtained in S5.2 and perform a 0-degree scan. A 0-degree scan means the grayscale value of a point (x, y) is f1, and the grayscale value of the point to its right (x+1, y) is f2. Count the occurrences of each (f1, f2) and fill them into the all-zero matrix obtained in S5.3. This yields the Gray-Level Co-occurrence Matrix (GLCM).
[0147] S5.5: Calculate the normalized matrix of the gray-level co-occurrence matrix obtained in step S5.4.
[0148] The calculation process for the normalized matrix is as follows:
[0149] (1) First, calculate the sum of all elements in the gray-level co-occurrence matrix. [This represents the value in the i-th row and j-th column of the gray-level co-occurrence matrix];
[0150] (2) Create a new 16*16 matrix of all zeros;
[0151] (3) Calculate the probability value of each element in the gray-level co-occurrence matrix P(i,j) = A(i,j) / sum[P(i,j) represents], and fill P(i,j) into the corresponding position of the all-zero matrix in step (2) (e.g., P(m,n) is filled into the m-th row and n-th column) to obtain the normalized matrix.
[0152] S106, calculate the second moment of the image, entropy, contrast and inverse variance of the image based on the gray-level co-occurrence matrix.
[0153] S6.1: Second moment of angle: P(i,j) represents the value in the i-th row and j-th column of the normalized matrix, and so on.
[0154] S6.2: Entropy:
[0155] S6.3: Contrast Ratio: (i, j) represents the row and column number of P(i, j), and the same applies below.
[0156] S6.4: Inverse variance:
[0157] S107, combine the area, perimeter, 7 HU invariant moments, second angular moment, entropy, contrast, and inverse variance of the obtained binarized cross-section image of the infected wood into a 13-dimensional recognition vector.
[0158] S108, the infected trees at the site of the diseased tree removal are numbered according to the identification order, and the infected tree number and the corresponding identification vector are stored in the SQL database.
[0159] S109. After the timber to be treated is transported to the treatment site, the above process is repeated.
[0160] S1010, and compare the newly obtained identification vector with the identification vector in the SQL database. The two infected trees with the smallest distance between their identification vectors are considered to be the same infected tree, thus completing the cross-sectional identification and tracking of infected trees.
[0161] As described in the above embodiments, this embodiment provides a method for identifying and tracking cross-sections of pine nematode-infected timber. First, a large number of standard images of infected timber cross-sections are collected, labeled using an annotation tool, and offline augmentation is performed. A neural network framework is trained, and a deep learning platform is built in conjunction with an instance segmentation algorithm. Using this platform, the background of the infected timber images is removed, and the images are then grayscaled and binarized. Data such as perimeter and area are extracted to form 13 sets of identification vectors, which are then sequentially numbered. The infected timber numbers and their corresponding Euclidean distances are stored in an SQL database. The process is repeated at the infected timber treatment site, and the data is compared and analyzed to achieve the identification and tracking of infected timber cross-sections. This method can identify and track a large number of infected timbers, improving the efficiency and accuracy of infected timber identification and tracking.
[0162] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for identifying and tracking cross-sections of wood infected with pine nematode disease, characterized in that, The method includes: Build a deep learning platform for recognizing cross-sections of infected trees; The cross-sectional image of the infected wood is obtained by processing the cross-section of the infected wood using the deep learning platform, including: A true-color original cross-sectional image of the wood with background was obtained using an industrial CCD camera in 24-bit deep R, G, B color space. Read in the original cross-sectional image of the infected tree with background; The aforementioned deep learning platform was used to process the cross-sectional image of the infected tree with background to obtain a cross-sectional image of the infected tree without background. The cross-sectional image of the infected wood is subjected to grayscale and binarization processing to obtain grayscale and binarized images of the cross-section of the infected wood; Extract the area, perimeter, and 7 HU invariant moments from the binarized image of the infected wood cross-section, including: The binarized image is subjected to multiple morphological dilation and erosion operations to eliminate defects in the cross-sectional area of the infected wood caused by overexposure and wear during the capture of the infected wood cross-section image. The obtained image is used in conjunction with the OpenCV library to perform maximum closed contour detection and obtain the coordinates of the maximum closed contour; Calculating the perimeter and area of the image using the coordinates of the maximum closed contour includes: Let there be n coordinates for the largest closed contour, then the perimeter of the infected tree is... When i = n, , , ( () represents the coordinates of the i-th contour point; Let S be the area of the region in the infected image. Connecting the coordinates of the largest contour using a polyline yields a closed simple n-gon, which is a simply connected region. Let L be the boundary curve of this simply connected region. The area S of the infected region in the image is obtained by calculating the loop integral of the boundary curve of the simply connected region; Traverse the grayscale image to obtain the total number of pixels and the grayscale value of each pixel, and calculate the second and third central moments; Seven HU invariant moments were calculated using the obtained second-order and third-order central moments. The process of traversing the grayscale image to obtain the total number of pixels and the grayscale value of each pixel, and calculating the second and third central moments, includes: First, calculate the 0th order geometric moments of the grayscale image. and first-order geometric moments and ; Calculate the 0th order geometric moments using the geometric moment formula. and first-order geometric moments ,Right now , p + q = 1; Then the second and third central moments were calculated. Second-order center distance: = p + q = 2; Third-order center distance: = p + q = 3; The second and third segment central moments obtained are used to calculate seven HU invariant moments, including: First, let's look at the formula. The second and third central moments are normalized to obtain the corresponding normalized central moments. , = The sum of p and q represents the order of the normalized central moments; Obtain the normalized second moment , , With normalized third central moments , , , ; Use the following formula to calculate the 7 Hu invariant moments: Hu0= ; Hu1= ; Hu2= ; Hu3= ; Hu4= ; Hu5= ; Hu6= ; Calculate the gray-level co-occurrence matrix of the gray-level image of the cross-section of the infected tree, and calculate the normalized frequency matrix of the gray-level co-occurrence matrix; The second moment of the image, entropy, contrast, and inverse variance are calculated based on the gray-level co-occurrence matrix. The area, perimeter, 7 HU invariant moments, second angular moment, entropy, contrast, and inverse variance of the binarized cross-section image of the infected tree obtained above are combined into a 13-dimensional recognition vector. The infected trees at the site of the disease removal and treatment were numbered according to the identification sequence, and the infected tree numbers and corresponding identification vectors were stored in the SQL database. After the timber to be treated is transported to the disposal site, the above process is repeated; The newly obtained identification vector is compared with the identification vector in the SQL database. The two infected trees with the smallest distance between their identification vectors are considered to be the same infected tree, thus completing the cross-sectional identification and tracking of infected trees.
2. The method for identifying and tracking cross-sections of pine nematode-infected wood according to claim 1, characterized in that, The deep learning platform for recognizing cross-sections of infected trees includes: An industrial CCD camera was used to collect cross-sectional images of infected trees in a standard field area, resulting in true-color original images of infected tree cross-sections with background in 24-bit R, G, B color space. The infected trees in the above images were labeled using annotation tools, and the corresponding dataset was obtained; Offline data augmentation is performed on the dataset to obtain an augmented dataset; In the augmented dataset, 60% is randomly selected as the training set, 20% as the validation set, and the remaining 20% as the test set; Deep learning networks are built using pre-installed convolutional neural networks and fully convolutional neural networks in conjunction with instance segmentation algorithms. The obtained training and validation sets are input into a deep learning network to obtain multiple generalization models; The obtained test set is used to evaluate multiple generalization models, and the model with the smallest generalization error is selected as the generalization model of the deep learning platform, thus completing the construction of the deep learning platform.
3. The method for identifying and tracking cross-sections of pine nematode-infected wood according to claim 1, characterized in that, The process of performing grayscale and binarization processing on the cross-sectional image of the infected wood to obtain grayscale and binarized images of the cross-section of the infected wood includes: Using Gray=(0.114) R+0.587 G+0.299 B) Calculate the weighted average of the R, G, and B channels for each pixel to obtain the grayscale value of all pixels; The obtained gray values are simultaneously assigned to the R, G, and B channels of the corresponding pixels to obtain a grayscale image with the same R, G, and B values for each pixel, and then saved. After processing by the deep learning platform, all pixels except the cross-section of the infected wood are white. The global threshold is set to 254, 254, 254. Using the global threshold algorithm, pixels with values less than this threshold are assigned 0 and turned into black, while pixels with values greater than this threshold are assigned 255 and turned into white, thus obtaining a binarized image.
4. The method for identifying and tracking cross-sections of pine nematode-infected wood according to claim 1, characterized in that, The calculation of the gray-level co-occurrence matrix of the gray-level image of the cross-section of the infected tree, and the calculation of the normalized frequency matrix of the gray-level co-occurrence matrix, includes: By traversing the grayscale image, the maximum grayscale level of the grayscale image is obtained. If the maximum gray level exceeds 16, the grayscale image is compressed, including: traversing all pixels of the grayscale image and using the formula gray new = gray 16 / max Gray Level compresses and saves the original grayscale image, where: graynew is the grayscale value of a pixel, gray is the original grayscale value, and max Gray Level is the maximum grayscale level. Construction 16 A 16-fold matrix of all zeros; Traverse the compressed grayscale image and perform a 0-degree scan to obtain the grayscale co-occurrence matrix; The normalized matrix of the calculated gray-level co-occurrence matrix includes: First, calculate the sum of all elements in the gray-level co-occurrence matrix, sum= , This represents the value of the gray-level co-occurrence matrix in the i-th row and j-th column; Create a new 16 A 16-element matrix containing all zeros; Calculate the probability of each element appearing in the gray-level co-occurrence matrix. = and through Fill in the corresponding positions of the all-zero matrix from the previous step to obtain the normalized matrix.
5. The method for identifying and tracking cross-sections of pine nematode-infected wood according to claim 4, characterized in that, The calculation of the second angular moment, entropy, contrast, and inverse variance of the image based on the gray-level co-occurrence matrix includes: Angular second moment ASM= , This represents the value in the i-th row and j-th column of the normalized matrix; Entropy ENT= ; contrast= (i,j) represents The row and column number it is in; Inverse variance: IDM = .
Citation Information
Patent Citations
Solid wood panel defect separation method based on compressed sensing
CN104361352A
Large-range pine wood nematode disease dead standing tree intelligent detection method based on unmanned aerial vehicle and CNN
CN112084989A