# Rapid Detection of Key Phenotypic Parameters in Wheat Grains Using Linear Array Camera
## 2 Materials and Methods
### Verification Method and Indicator  
A research experiment on the phenotypic parameters of wheat grains was conducted using the image acquisition device and image processing method. The specific details are as follows. Experiment 1: We randomly selected 50 grains from each of the five types of wheat for image acquisition, resulting in 250 images. We compared and analyzed the phenotypic parameters (as shown in Figure 13) extracted by the Halcon software code with the results of manual measurement. The parameter measurement error was used to evaluate the morphological parameters of intact wheat grains. The coefficient of determination (\(R^{2}\)) and the root mean square error (\(RMSE\)) were selected as the evaluation indices. Additionally, the mean absolute error (\(MAE\)) and mean absolute percentage error (\(E_{MAP}\)) were incorporated for further analysis, and the calculation formulas are as follows:  
\[R^{2}=\mathbf{1}-\frac{\sum_{i=1}^{n}(\mathbf{x}_{i}-\mathbf{y}_{i})^{2}}{ \sum_{i=1}^{n}(\mathbf{x}_{i}-\overline{x})^{2}}, \tag{10}\]  
where \(x_{i}\) reflects the true value of the phenotypic parameter of the wheat grain, \(y_{i}\) reflects the predicted value of the phenotypic parameter of the wheat grain, \(\overline{x}\) reflects the average of the true values of the phenotypic parameters of the wheat grains, and n reflects the number of wheat grains. \[RMSE=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}, \tag{11}\]  
where \(y_{i}\) reflects the true value of the phenotypic parameter of the wheat grain, \(\hat{y}_{i}\) reflects the predicted value of the phenotypic parameter of the wheat grain, and n reflects the number of wheat grains. \[MAE=\frac{1}{n}\sum_{i=1}^{n}\lvert x_{i}-y_{i}\rvert, \tag{12}\]  
\[E_{MAP}=\frac{MAE}{\frac{1}{n}\sum_{i=1}^{n}x_{i}}\times 100\%, \tag{13}\]  
where \(x_{i}\) reflects the true value of the phenotypic parameter of the wheat grain, and n reflects the number of wheat grains. The actual parameters were obtained by combining the real pixel values calibrated by the software. The weight-fitting formula was determined for these parameters, including grain length, grain width, and area, and a comparative experiment was conducted on grain length, grain width, and grain weight with the manual detection method (using a vernier caliper and an electronic scale). The manual detection equipment is shown in Figure 14.  
Experiment 2: Based on the bud point determination method, 40 wheat grains of each of five varieties were randomly selected for image acquisition, resulting in 200 images. For the collected images, the bud-point determination code written in Halcon was used to determine the direction of the bud points. The algorithm determines the center coordinates of the wheat grains by identifying the morphological characteristics and edge information  
Figure 13: The Halcon software outputs phenotypic parameter results. of the bud points, as well as their relative positional relationships with the overall shape, and then performs shape fitting. The direction of the bud points is determined by judging the grayscale means of the two ends. To verify the accuracy of the algorithm, the results of the code operation were manually judged. The wheat grains in the above experiment were germinated and cultivated, as shown in Figure 15. After soaking for 1 to 3 days, wheat grains with bud points that could be observed with the naked eye were photographed again. Problematic wheat grains during the germination process were removed, and 120 germination images were collected. After observing the positions of the bud points, we manually marked the positions of the actual bud points in the image in Halcon. We compared the predicted positions of the bud points with the software using the manually marked positions of the actual bud points.