The invention discloses a method for detecting the
sugar content in tobacco
processing based on a hyperspectrum and a CARS
algorithm, and belongs to the field of
nondestructive testing of agricultural products. The method comprises the following steps: acquiring original images of tobacco samples in different
processing procedures through a
hyperspectral imaging technology, and carrying out black and white correction on hyperspectral images; extracting a
region of interest to obtain hyperspectral data; determining the
sugar content of each tobacco sample; measuring the
sugar content data of the tobacco and dividing into a modeling set and a prediction set; preprocessing the
spectral data by using an orthogonal
signal correction method, and then selecting a characteristic
wavelength by using a competitive adaptive reweighted sampling
algorithm (CARS); establishing a
partial least squares regression prediction model by taking full-
wavelength spectral information and spectral information obtained by a competitive adaptive reweighted sampling
algorithm (CARS) characteristic
wavelength selection method as prediction variable data; and according to a
model prediction result, evaluating model performance, and selecting a characteristic wavelength
selection method with the best prediction effect. The method has the beneficial effects that the characteristic wavelength is screened for modeling analysis by using an orthogonal
signal correction preprocessing method and a competitive self-adaptive reweighting calculation sampling algorithm, and the accuracy of a model obtained by analyzing a
correlation coefficient is higher. Therefore, the orthogonal
signal correction and competitive self-adaptive reweighted sampling algorithm can improve the model precision in the detection process, and the accurate, rapid, lossless and effective prediction of the tobacco sugar content is realized.