## 2 Materials and Methods
### Hyperspectral Imaging and Processing  
Hyperspectral imaging equipment comprises a combination of Hyspex VNIR-1024 (covering 400-1000 nm, 108 spectral bands) visible near-infrared hyperspectral camera and Hyspex SWIR-384 (covering 1000-2500 nm, 288 spectral bands) short-wave infrared hyperspectral camera, which were made by the Norwegian NEO company. The image data processing method is introduced in this section. Illumination was provided by a fixed artificial light source, and ambient light was shielded through from the darkroom environment. During the hyperspectral imaging of ginseng samples, a white board was placed at the same time. The color of background was black, which can reduce the impact of ambient reflectivity. The imaging effect is shown in Figure 1.  
Hyperspectral images cover nearly 50% of the surface area of ginseng. For each pixel, there are differences caused by the differing reflectance of ginseng reed, body, and fibril, and these differences are also caused by different angles of illumination geometry [21]. In order to comprehensively utilize the overall information of ginseng samples and remove noise, the hyperspectral image of a single ginseng sample was processed into spectral reflectance over 396 spectral bands. Radiometric correction for the pixels of ginseng in the image includes relative and absolute corrections [22; 23]. Along the swath direction, every pixel was under different illuminating geometric conditions. As shown in Figure 1, the middle columns of white board are brighter than the left and right columns. Based on the Lambertian reflective property of a white board, it can be used as a standard reference for absolute correction [24; 25].  
The reflectance is defined as follows:  
\[\rho_{\lambda(i,j)}=\frac{DN_{(i,j)}}{E\Big{(}DN_{wb(;j)}\Big{)}} \tag{1}\]  
Figure 1: True color composite image extracted from hyperspectral image of ginseng sample.  
where \(\rho_{\lambda}\) is the reflectance on wavelength \(\lambda\), (\(i,j\)) are the row and column of pixel in the ginseng subimage, \(E(DN_{wb(;\_j)})\) is the mathematical expectation of all \(DN\)s in the white board in the column \(j\), and \(DN_{(i,j)}\) is the DN positioned at (\(i,j\)) in the ginseng's subimage.  
Therefore, \(\rho_{\lambda}\) is the reflectance that normalized by the white board. When the \(DN\)s of ginseng's subimage had been processed column-by-column using Equation (1), the reflectance image after absolute and relative radiometric corrections was acquired.  
The specific data processing steps are as follows.  
Firstly, according to the significant brightness difference of 3 targets including ginseng, a black background and white board were used in any spectral band. A threshold method was used for image segmentation to distinguish and mark the 3 targets.  
Secondly, ginseng pixels were divided by the mean of white board pixels in the same column to obtain a reflectance image.  
Thirdly, the reflectance of all pixels labeled as ginseng in the same band was averaged to obtain the mean reflectance value of the band.  
Fourthly, after batch processing all hyperspectral bands, 35 spectral curves with good smoothness were obtained, as shown in Figure 2.