# Rapid Detection of Key Phenotypic Parameters in Wheat Grains Using Linear Array Camera
## 2 Materials and Methods
### Detection System
#### 2.2.1 Hardware Build  
* Visual unit  
Linear array cameras have higher pixel precision than area-array cameras; can continuously acquire images, making it easier to achieve uniform lighting; can capture images of moving objects; and have better expandability. The size of wheat grains is relatively small, with a length of approximately 6-9 mm and a width of about 2-3 mm. When the horizontal detection accuracy of the device can reach 0.1 mm, the defects of wheat grains can be better presented. Generally, 2-5 pixels are required to distinguish a pattern with a length or width of 0.1 mm. Here, 3 pixels are selected for representation, and the single-pixel precision is approximately 0.034 mm. Since a 250 mm * 250 mm black hard plate is selected as the bottom plate in the material tray, the width of the field of view is set to 250 mm, and the camera resolution should reach 8 K to meet the detection requirements. Therefore, the Hikvision MV-CL086-91 CC series color CMOS linear array camera is selected, and the pixel calculation formula is as follows:  
\[R=\frac{W_{FOV}}{P}, \tag{1}\]  
where \(R\) represents the number of camera pixels; \(W_{FOV}\) represents the number of pixels in the image width; and \(P\) represents the single-pixel accuracy. The pixel size of the selected MV-CL086-91 CC line-scan camera is 5 \(\upmu\)m, and the resolution is 8192 pixels. The magnification ratio, \(\beta\), is 0.1638 according to the formula used to calculate \(\beta\). The calculation formula is  
Figure 2: Wheat grain image acquisition and detection system. **(a)** Schematic diagram of wheat grain image acquisition and detection system: 1—industrial computer; 2—motion control card; 3—servo drive; 4—light source controller; 5—encoder; 6—servo motor; 7—a limit sensor; 8—double-track timing belt; 9—bar light source; 10—a feeder tray; 11—line-scan camera. **(b)** Wheat grain image acquisition and detection system physical map. \[\beta=\frac{RP_{S}}{W}, \tag{2}\]  
where \(\beta\) represents the magnification ratio; \(W\) represents the field width; and \(P_{S}\) represents the pixel size. The shooting distance of the wheat is 160 mm, and the magnification ratio is 0.1638 according to the above formula. The focal length is 22.5 mm according to the focal length calculation formula, and the MVL-LF2528M-F model lens is selected. The calculation formula of the lens focal length is  
\[f=\frac{\beta\times W_{D}}{1+\beta}, \tag{3}\]  
where \(f\) represents the focal length; \(\beta\) represents the magnification ratio; and \(W_{D}\) represents the working distance. The visual inspection unit adopts a modular design. The dynamic adjustment of the camera and the light source is achieved using a lifting slide table and an adjustable fixture to meet the precision requirements of the application scenarios. Using the MVS software, parameters such as the exposure, bright and dark field correction, and frequency conversion of the trigger signal are optimized to improve the imaging quality. The KW-ELS375F-W strip light source and the KPD-5A1C-24V light source controller (Shanghai Kaiwei Optoelectronic Technology Co., Ltd., Shanghai, China) are selected as the light sources for image acquisition. For the motion module, the CCM-W40-10-L1100-5A double-rail synchronous belt conveying module is chosen. Its effective stroke is 850 mm, and the moving speed ranges from 0 to 1.5 m/s, which can meet the requirements for obtaining wheat images. The design of the visual inspection unit is shown in Figure 2a. * Electronic control unit  
The overall layout of the electronic control unit is shown in Figure 2b, which consists of a power supply part, a motion control part, a servo control part, and a servo control terminal block part. The motion control scheme is shown in Figure 3. In the system, instructions are sent to the image acquisition card and the motion control card through the operation monitor's host computer software.