Single tiller rice plant phenotype parameter extraction method based on HRNet network
By detecting key points in rice using the HRNet network and selecting suitable key points to construct the rice plant skeleton, the problem of time-consuming, labor-intensive, and environmentally dependent manual measurements in rice breeding is solved. This achieves high-precision, high-throughput acquisition of rice phenotypic parameters and is applicable to multiple rice varieties.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2026-03-31
AI Technical Summary
In rice breeding, manual measurement of phenotypic parameters of single-tillering rice is time-consuming and labor-intensive. Existing image processing methods have strict environmental requirements and are difficult to comprehensively detect the overall parameters of rice. Furthermore, deep learning algorithms are difficult to meet the recognition requirements of single-tillering rice, especially since the curvature of leaves and panicles is greatly affected by gravity under natural conditions, and existing key point detection methods are not effective.
A method based on the HRNet network was adopted to detect key points of rice, select suitable key points, construct the skeleton of rice plants, and perform scale transformation by combining semantic information and scale bar to obtain phenotypic parameters.
It enables automatic identification of key points in rice under natural conditions, reducing labor costs, improving detection accuracy and throughput, and is applicable to a variety of rice varieties. It has strong generalization ability, reduces the impact of environmental interference, and is suitable for operation by non-professionals.
Smart Images

Figure CN116721266B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crop phenotypic parameter acquisition technology, and in particular to a method for extracting phenotypic parameters of single-tillering rice plants based on HRNet network. Background Technology
[0002] Rice is one of the world's most important food crops, with nearly half the world's population relying on it as a staple food. As the world's largest producer and consumer of rice, China's rice production accounts for more than one-third of its total grain output, making rice production issues of paramount importance. Therefore, rice breeding research has become a top priority. In the breeding process, the growth of rice varieties is monitored by measuring the phenotypic parameters of single-tillering rice plants at different stages, thereby assessing the yield of rice varieties. Therefore, research on methods for extracting phenotypic parameters can contribute to rice variety selection and breeding.
[0003] Rice breeding requires cooperation between researchers and farmers. Therefore, it is necessary to collect data close to the paddy fields, where the environment is not too affected, and to make the process simple and easy to operate. This way, even those without research experience can obtain usable images. Secondly, it is necessary to be able to process images quickly and accurately when acquiring parameters, so as to facilitate researchers' subsequent research. Furthermore, it should be applicable to a variety of rice varieties and meet the requirements of high throughput, high precision, and strong generalization ability.
[0004] The most common method currently used is to randomly select single-tillering rice plants and manually measure their phenotypic parameters. Since parameter measurements are required at each stage of rice growth and development, and a large amount of data needs to be processed, this method requires significant manual labor and is often time-consuming and labor-intensive.
[0005] With the rapid development of computer technology, image processing methods have been applied to agricultural production. Grayscale or binarization methods are commonly used to detect the contours of single-tillering rice plants. However, pixel processing of images is highly dependent on environmental conditions; lighting and shadows significantly affect the detection results. Furthermore, different image processing methods are often used for different parameters, frequently detecting only the rice panicle or only the leaves, making it difficult to fully detect the overall parameters of a single-tillering rice image. Additionally, image segmentation algorithms are mostly applicable to specific rice varieties, offering limited scalability.
[0006] Current deep learning algorithms often employ object detection to identify multiple targets within the same area, which is insufficient for identifying single-tillering rice plants. Furthermore, it struggles to pinpoint the precise location of rice plants, performing better for area calculations but less suitable for length detection. In natural conditions, due to gravity, leaves and panicles exhibit greater curvature, making simple object detection ineffective. Constructing a skeleton for single-tillering rice plants is crucial for better understanding plant morphology under varying conditions, and keypoint extraction methods effectively mitigate interference. However, keypoint detection is primarily used for human posture estimation, where the total number of keypoints is relatively fixed, resulting in limited application to crops in existing research. Since the number of leaves varies with growth stages, the total number of keypoints differs among single-tillering rice plants. This invention employs a "detect first, then filter" approach to construct the skeleton for rice plants with a random number of leaves. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the prior art and propose a method for extracting phenotypic parameters of single-tillering rice plants based on the HRnet network. By drawing on human posture detection methods, key points of single-tillering rice are detected, suitable key points are selected by setting conditions, and a skeleton of single-tillering rice plants is constructed based on semantic information. Finally, the actual plant height, stem, leaf and panicle length, leaf angle and other phenotypic parameters are obtained by scaling the plant using a scale bar.
[0008] The technical problem solved by this invention is achieved through the following technical solution:
[0009] A method for extracting phenotypic parameters of single-tillering rice plants based on HRNet network, comprising the following steps:
[0010] 1) Collect images of single-tillering rice, label the dataset, and train the data. The initial training uses 6 leaves and a total of 40 key points.
[0011] 2) The HRNet network was used for training, and the trained model was used to detect key points of rice.
[0012] 3) Based on the distance between the detected leaf key points and the ear key points, false key points are screened out;
[0013] 4) Based on the semantic information of the remaining leaf key points, filter out redundant leaf key points;
[0014] 5) Connect the key points of each leaf according to semantic information to construct the rice skeleton, and return the coordinates of each point;
[0015] 6) Calculate the phenotypic parameters based on the semantic information and coordinate values of each point.
[0016] Furthermore, the background used for image acquisition in step 1) has a black square of actual size 10cm×10cm marked in the lower left corner as a scale, which serves as a scale when calculating various phenotypic parameters.
[0017] Furthermore, the default rule for the 40 key points in step 1) is as follows: the stem is labeled with S_1-S_5 in the direction from root to panicle; the panicle is labeled with P_1-P_5 in the direction from stem to panicle tip; each plant has 6 leaves by default, and each leaf is labeled with Li_1-L_i_5 in the direction from leaf stem connection point to leaf tip, where i represents the i-th leaf of a single-tillering rice plant, and the number of leaves in the dataset is labeled according to the actual situation.
[0018] Moreover, step 2) employs a transfer learning method, using the HRNet-W32 human pose detection model as the pre-trained model weights, and changing the number of output channels to meet the needs of rice key point detection.
[0019] Furthermore, step 3) includes the following steps:
[0020] 3.1) Output the semantic information of each detected key point, and extract 5 key points of the ear and 30 key points of the leaf respectively;
[0021] 3.2) Calculate the distance T between each leaf key point and the 3rd, 4th and 5th key points of the ear, and set the threshold T0 according to the actual situation. If the T of a certain point is less than the threshold T0, delete the key point.
[0022] Furthermore, step 4) includes the following steps:
[0023] 4.1) Organize the key points of each existing blade;
[0024] 4.2) If a leaf retains more than three key points, it is considered a valid leaf, and the five points on the leaf are restored.
[0025] 4.3) If a leaf has only one or two key points, it is considered an invalid leaf, and the five points on the leaf are removed.
[0026] 4.4) If a leaf has three key points, it is necessary to judge the semantic information of each point. Only when points 1, 2 and 5 are present at the same time is it considered a valid leaf and the 5 points on the leaf are restored. Otherwise, it is considered an invalid leaf and the 5 points on the leaf are filtered out.
[0027] Moreover, the specific implementation method of step 5) is as follows: extract the semantic information and coordinates of each existing key point, and connect the ear, stem and each leaf in the order of 1-5 respectively.
[0028] Furthermore, step 6) includes the following steps:
[0029] 6.1) Calculate the plant height: The maximum difference between the highest point of the rice panicle and the lowest point of the stem on the y-axis is defaulted as the height of the rice plant, and the highest key point P of the panicle is taken. max (X max ,Y max ), and for S_1(X0,Y0), the calculation formula for the plant height H is:
[0030]
[0031] 6.2) Calculate the lengths of the leaves, stems, and panicles: Take the key points P1, P2... P on the skeletons of the leaves, stems, and panicles. n , and the coordinates of each key point are (X j ,Y j )(0 < j ≤ n), then the calculation formula for the length L is:
[0032]
[0033] In the formula: X j-1 is the abscissa of the point before the key point to be calculated; Y j-1 is the ordinate of the point before the key point to be calculated.
[0034] 6.3) Calculate the leaf angle: According to the two closest stem points near the intersection of the leaf and the stem of the plant, find the slope m1 of the stem tangent line, and select the first and second points on the leaf to calculate the slope m2 of the leaf tangent line. Then the calculation formula for the leaf angle θ is:
[0035]
[0036] Moreover, the part involving length calculation in step 6) needs to perform scale transformation, and the calculation of the scale transformation includes the following steps:
[0037] 6.4) Perform a blur filtering operation on the original image and perform an hsv separation operation on the image.
[0038] 6.5) Obtain the black area on the picture, set the threshold between [0,0,0] and [180,255,46], and remove the background part.
[0039] 6.6) Obtain the square with the largest area, and extract the largest contour and the circumscribed rectangle.
[0040] 6.7) Calculate the length of the square according to the coordinates, and the calculation formula for the proportional scale K is:
[0041]
[0042] In the formula: L wL is the width of the square ruler in the lower left corner. h L0 represents the length of the square ruler in the lower left corner, and L0 represents the actual length of the ruler during its manufacture.
[0043] The advantages and beneficial effects of this invention are as follows:
[0044] 1. The present invention provides a method for extracting phenotypic parameters of single-tillering rice plants based on HRNet network. Phenotypic parameters of single-tillering rice under natural conditions are very important for detection in the breeding process. However, due to the influence of gravity, the curvature of leaves and panicles is greater. Constructing a single-tillering rice plant skeleton is to better meet the plant morphology under different conditions. The key point extraction method can better avoid interference.
[0045] 2. The present invention provides a method for extracting phenotypic parameters of single-tillering rice plants based on HRNet network. Since current keypoint-based posture detection technology is mostly used for posture estimation of human activities, and the total number of keypoints in human posture is relatively fixed, the total number of keypoints in rice plants varies due to different growth stages and different leaf numbers. Therefore, the present invention adopts a "detect first, then screen" method to construct the skeleton of rice plants with a random number of leaves.
[0046] 3. The present invention provides a method for extracting phenotypic parameters of single-tillering rice plants based on the HRNet network. This method identifies key points of single-tillering rice plants using the HRNet keypoint detection network. The model is trained using deep learning methods, enabling automatic identification of key points without human intervention, effectively reducing labor costs. The choice of key points as the detection target is due to the fact that leaves and rice ears, under natural conditions, are subject to gravity and have significant curvature, making target detection ineffective for parameter calculation. Keypoint detection targets are smaller and less affected by background factors, effectively reducing the impact of the environment on the detection results. Image acquisition can be completed even without research experience or background knowledge; farmers or those without agricultural experience can directly collect and upload images in the field, facilitating image acquisition for researchers. Furthermore, the HRNet keypoint detection network maintains high resolution throughout the feature extraction process, resulting in less loss of key pixels compared to current image processing methods. Therefore, using the HRNet keypoint detection network to identify key points of single-tillering rice plants solves the current requirements for high precision and high throughput in obtaining rice performance parameters.
[0047] 4. The phenotypic parameter extraction method for single-tillering rice plants based on HRNet network of the present invention constructs a skeleton by selecting suitable key points based on semantic information and location, so as to facilitate the calculation of subsequent parameters. The current key point detection network is mainly used for the detection of human posture or fixed structure objects, and has a fixed total number of key points. However, since the number of leaves in rice cannot be fixed during growth, the use of key point detection alone cannot meet the requirements. Therefore, a step of selecting key points based on location and semantic information is designed to reconstruct the single-tillering rice skeleton. This facilitates the calculation of phenotypic parameters in the current rice growth process and makes it easier to expand to the acquisition of other phenotypic parameters. Moreover, the method of extracting key points for calculation is applicable to multiple rice varieties. The model can be regenerated by adjusting the training parameters to be applicable to multi-leaf single-tillering rice plants. It is not limited to the experimental variety and has strong generalization ability. Attached Figure Description
[0048] Figure 1 This is a system flowchart of the present invention;
[0049] Figure 2 This is a flowchart illustrating the skeleton construction process of the present invention;
[0050] Figure 3 This is a flowchart of the parameter acquisition process of the present invention;
[0051] Figure 4 This is a user flowchart of the present invention;
[0052] Figure 5 This is an image of the plant skeleton of the present invention;
[0053] Figure 6 for Figure 5 A magnified view of a portion of the image. Detailed Implementation
[0054] The present invention will be further described in detail below through specific embodiments. The following embodiments are merely descriptive and not limiting, and should not be used to limit the scope of protection of the present invention.
[0055] A method for extracting phenotypic parameters of single-tillering rice plants based on HRnet network, the method comprising the following steps:
[0056] 1. Collect images of single-tillering rice plants, label the dataset, and train the dataset. The initial training uses 40 key points across 6 leaves by default.
[0057] 1.1 Collect images of single-tillering rice plants. The size is approximately 3000 pixels × 4000 pixels, which can be adjusted up or down. Ordinary mobile phones can achieve the shooting level. The background used for collection has a black square with an actual size of 10cm × 10cm marked in the lower left corner as a scale. It serves as a scale when calculating the actual length. The model training rule is set according to the growth pattern of rice, with a default maximum of 6 leaves.
[0058] 1.2 The acquired images are labeled according to the training rules. Initial training uses a default of 40 keypoints for 6 leaves. The default rules for the 40 keypoints in step 1 are as follows: for the stem, labels are S_1-S_5 sequentially from root to panicle; for the panicle, labels are P_1-P_5 sequentially from stem to panicle tip; each plant has 6 leaves by default, and each leaf is labeled Li_1-L_i_5 sequentially from the connection point to the leaf tip, where i represents the i-th leaf of a single-tillering rice plant. If a certain type of rice has a higher upper limit for the number of leaves, the dataset generation model can be retrained by adjusting the parameters without changing the calculation method.
[0059] 2. Use the HRNet network for training, set the existing HRNet-W32 human pose detection model as the pre-trained model weights, and use the trained model to detect key points of rice.
[0060] 2.1 Set the existing HRNet-W32 human pose detection model as the weights of the pre-trained model.
[0061] 2.2 The number of output channels of the HRNet network is changed to meet the needs of key point detection in single-tillering rice. According to actual needs, the number of output channels is selected as 40.
[0062] 2.3 The labeled dataset was fed into the HRNet network for training. The trained model was used to detect 40 key points of single-tillering rice. The loss function was calculated by taking the square of the difference between the predicted value and the standard value, as shown in the following formula:
[0063]
[0064] Finally, OKS was used as the evaluation criterion for model accuracy. The OKS evaluation index formula is as follows:
[0065]
[0066] Based on actual needs, this invention selects the detection model that performs best after 200 training iterations, at which point the loss function is approximately 0.13 and the OKS is approximately 0.68.
[0067] 3. Based on the distance between the detected leaf key points and the ear key points, falsely detected key points are eliminated. For example... Figure 2The upper half of the image shows the first round of screening.
[0068] 3.1 Output the semantic information of each detected key point, and extract 5 key points of the ear and 30 key points of the leaf respectively;
[0069] 3.2 Calculate the distance T between each leaf key point and the 3rd, 4th and 5th key points of the ear, and set a threshold T0 according to the actual situation. If the T of a certain point is less than the threshold T0, delete the key point.
[0070] 4. Based on the semantic information of the remaining leaf key points, remove redundant leaf key points. For example... Figure 2 The lower half of the image shows the second round of screening.
[0071] 4.1 Organize the key points of each existing blade;
[0072] 4.2 If a leaf retains more than three key points, it is considered a valid leaf, and the five points on the leaf are restored.
[0073] 4.3 If a leaf has only one or two key points, it is considered an invalid leaf, and the five points on the leaf are removed.
[0074] 4.4 If a leaf has three key points, it is necessary to judge the semantic information of each point. Only when points 1, 2, and 5 are present at the same time is it considered a valid leaf and the 5 points on the leaf are restored. Otherwise, it is considered an invalid leaf and the 5 points on the leaf are filtered out.
[0075] 5. Connect the key points of each skeleton according to semantic information to construct the skeleton of a single-tillering rice, and return the coordinates of each point.
[0076] The specific implementation method of step 5) is as follows: extract the semantic information and coordinates of each existing key point, and connect the spike, stem and each leaf in the order of 1-5 respectively.
[0077] 6. Calculate the various phenotypic parameters based on the semantic information and coordinate values of each point.
[0078] 6.1 Calculating Plant Height: The maximum difference between the highest point of the panicle and the lowest point of the stem on the y-axis is assumed to be the height of the rice plant. The highest key point P of the panicle is taken. max (X max ,Y max ), and S_1(X0,Y0), the formula for calculating the plant height H is:
[0079]
[0080] 6.2 Calculate the length of leaves, stems, and panicles: Take key points P1, P2...P on the skeleton of leaves, stems, and panicles. n, the coordinates of each key point are (X j , Y j )(0 < j ≤ n), and the formula for calculating the length L is:
[0081]
[0082] In the formula: X j-1 is the abscissa of the previous point of the key point to be calculated; Y j-1 is the ordinate of the previous point of the key point to be calculated.
[0083] 6.3 Calculate the leaf angle: According to the two closest stem points near the intersection of the leaf and the stem of the plant, find the slope m1 of the stem tangent line, and select the first and second points on the leaf to calculate the slope m2 of the leaf tangent line. Then the formula for calculating the leaf angle θ is:
[0084]
[0085] The part involving length calculation in step 6) needs to be scaled. The calculation of the scale transformation includes the following steps:
[0086] 6.4 Perform a blur filtering operation on the original image and perform an hsv separation operation on the image.
[0087] 6.5 Obtain the black area on the picture, set the threshold between [(), ()] to [180, 255, 46], and remove the background part.
[0088] 6.6 Obtain the square with the largest area, and extract the largest contour and the circumscribed rectangle.
[0089] 6.7 Calculate the length of the square according to the coordinates. The formula for calculating the proportional scale K is:
[0090]
[0091] Among them, L0 is the actual length of the square, 10 cm, L w is the width of the detected circumscribed rectangle, and L w is the length of the detected circumscribed rectangle.
[0092] The experimental results selected a single-tillering rice plant for verification experiments:
[0093] 1. According to the above rules, make 1000 datasets according to actual needs and perform 200 iterations of training.
[0094] 2. Through oks screening, it is found that the oks value of the model verification is the largest at the 193rd iteration, about 0.68. At this time, the calculated value of the loss function loss is about 0.13. By selecting the path to input the picture and entering the model for key point detection, 40 key points are detected.
[0095] 3. The first round of screening was conducted, removing 12 key points, including the mistakenly deleted L_3_3 and L_3_4 of the third leaf. The confidence level of the retained points was set to 0, and the confidence level of the deleted points was set to 1. The confidence levels of each leaf key point are as follows:
[0096]
[0097] 4. After the second round of screening, the five key points of the third leaf were recovered, and the other points of the fourth, fifth, and sixth leaves were deleted. The confidence levels of each leaf are as follows:
[0098]
[0099] 5. Connect the keypoints detected on the stem in the order of S_1 to S_5, and the keypoints detected on the panicle in the order of P_1 to P_5. Simultaneously, based on the confidence levels of the keypoints on each leaf, connect the keypoints on each leaf in the order of Li_1 to Li_5, thus constructing a visualized skeleton of a single-tillering rice plant. The skeleton obtained by selecting and connecting keypoints is shown below. Figure 5 , 6 As shown.
[0100] 6. Extract the coordinates of each key point on the skeleton and calculate parameters based on semantic information:
[0101] 1) Plant height: Take the highest key points P_5 and S_1 of the ear, and the plant height H is calculated according to the formula as H = 2519.38 pixels;
[0102] 2) Stem length: Take the key points S_1, S_2, S_3, S_4, and S_5 on the stem, calculate the distance between adjacent points and sum them up. The stem length Ls is calculated according to the formula as Ls = 2128.12 pixels.
[0103] 3) Rice ear length: Take the key points P_1, P_2, P_3, P_4, and P_5 on the rice ear, calculate the distance between adjacent points and sum them up. The length of the rice ear Lp is calculated according to the formula as Lp = 446.12 pixels.
[0104] 4) Leaf length: Take the key points Li_i_1, Li_i_2, Li_i_3, Li_i_4, and Li_i_5 on the stem, calculate the distance between adjacent points and sum them. The stem length Li is calculated according to the formula as follows: Li = 608.48 pixels; Li = 803.13 pixels; Li = 569.58 pixels.
[0105] 5) Blade angle:
[0106] Based on the two stem points closest to the intersection of the plant leaf and stem, calculate the slope of the stem tangent m1 and the slope of the leaf tangent m2 respectively. Then, the leaf angle θ is calculated according to the formula as follows: θ1 = 15.42 degrees; θ2 = 35.09 degrees; θ3 = 20.25 degrees.
[0107] 6) Calculate the scale K = 40.2 based on the scale in the lower left corner of the image, and convert it to the length parameter.
[0108] The actual measured parameters are as follows: plant height = 62.67 cm; stem length = 52.94 cm; ear length = 11.1 cm; leaf 1 length = 15.14 cm; leaf 2 length = 19.98 cm; leaf 3 length = 14.17 cm. Leaf 1 angle = 15.42 degrees; leaf 2 angle = 35.09 degrees; leaf 3 angle = 20.25 degrees.
[0109] Actual measurements yielded the following parameters for plant height: 62.76 cm; stem length: 52.03 cm; panicle length: 11.22 cm; leaf 1 length: 15.23 cm; leaf 2 length: 20.38 cm; leaf 3 length: 13.83 cm; leaf 1 angle: 17.2 degrees; leaf 2 angle: 33.4 degrees; leaf 3 angle: 21.4 degrees. Therefore, this method can effectively measure various parameters of monotillering rice.
[0110] Although the embodiments and drawings of the present invention have been disclosed for illustrative purposes, those skilled in the art will understand that various substitutions, variations and modifications are possible without departing from the spirit and scope of the invention and the appended claims. Therefore, the scope of the invention is not limited to the contents disclosed in the embodiments and drawings.
Claims
1. A method for extracting phenotypic parameters of single tiller rice plants based on an HRNet network, characterized in that: The method comprises the following steps: 1) Collecting single tiller rice image, labeling data set and training, initial training default 6 leaves 40 key points; 2) Using HRNet network for training, the trained model is used to detect rice key points; 3) The detected leaf key points are screened out according to the distance from the key points of the ear; 4) According to the semantic information of the remaining leaf key points, the redundant leaf key points are screened out; 5) Connecting each leaf key point according to the semantic information to construct the rice skeleton, and returning the coordinates of each point; 6) According to the semantic information and coordinate value of each point, calculate each phenotypic parameter; The image collection in step 1) uses a black square with an actual size of 10cm×10cm in the lower left corner of the background board as a ruler, which serves as a scale when calculating the phenotypic parameters; The default 40 key points in step 1) are as follows: the stem is labeled S_1-S_5 from root to ear; The ear is labeled P_1-P_5 from stem to ear tip; Default 6 leaves per plant, each leaf is labeled L_i_1-L_i_5 from the stem connection point to the leaf tip, i represents the i th leaf of single tiller rice plant, and the number of leaves in the data set is labeled according to the actual situation; Step 2) adopts the method of transfer learning, and uses HRNet-W32 human pose detection model as the pre-training model weight, and changes the output channel number to meet the needs of rice key point detection; Step 3) comprises the following steps: 3.1) Output the semantic information of each key point detected, and extract the 5 key points of the ear and the 30 key points of the leaf respectively; 3.2) Calculate the distance T between each leaf key point and the 3rd, 4th and 5th key points of the ear, and set the threshold value T0 according to the actual situation, and delete the key point when the T of a certain point is less than the threshold value T0; Step 4) comprises the following steps: 4.1) Organize the existing key points of each leaf; 4.2) If more than three key points are retained on a leaf, it is considered as a valid leaf, and the five points on the leaf are restored; 4.3) If there is only one or two key points on a leaf, it is considered as an invalid leaf, and the five points on the leaf are screened out; 4.4) If there are three key points on a leaf, the semantic information of each point needs to be judged, only when the 1st, 2nd and 5th points are available, it is considered as a valid leaf, and the five points on the leaf are restored, otherwise it is considered as an invalid leaf, and the five points on the leaf are screened out; The specific implementation method of step 5) is to extract the semantic information and coordinates of the existing key points, and connect the ear, stem and each leaf in the order of 1-5; Step 6) comprises the following steps: 6.1) Calculate the plant height: the maximum difference between the highest point of the rice ear and the lowest point of the stem on the y-axis is the height of the rice plant, taking the highest key point P of the ear max ( X max, Y max ), and S_1( X 0, Y 0 ), the plant height H calculation formula is: 6.2) Calculate the length of leaves, stems and rice ears: take the key points on the leaf, stem and rice ear skeleton P 1 、P 2 ……P n , the coordinates of each key point are X j, Y j ) (0< j ≤n), then the length L The calculation formula is: In the formula: X j-1 is the horizontal coordinate of the previous point of the key point to be calculated; Y j-1 is the vertical coordinate of the previous point of the key point to be calculated; 6.3) Calculate the leaf angle: the slope of the stem tangent is calculated from the two closest stem points near the intersection of the leaf with the stem m 1. Select the first and second points on the leaf to calculate the leaf tangent slope m 2. Then the leaf angle is θ The formula is: .
2. The method of claim 1, wherein the method is based on a HRNet network. The part related to length calculation in step 6) needs to be scaled, wherein the scale transformation calculation comprises the following steps: 6.4) Perform blur filtering operation on the original image and perform hsv separation operation on the image; 6.5) Get the black area on the picture, set the threshold value between [0, 0, 0] and [180, 255, 46], and remove the background part; 6) Get the largest area square, extract the largest contour and the circumscribed rectangle; 6.7) The length of the square is calculated according to the coordinates, and the scale K is calculated according to the formula: In the formula: L w is the width of the square scale at the lower left corner, L h is the length of the square scale at the lower left corner, L 0 is the actual length when the scale is made.