| Tea culture has a long history in China,and the improvement of tea production technology and quality has always been the concern of tea makers.Tea stalks and insects are the main food foreign bodies in refined tea products that are insensitive to X-ray images.Therefore,electromagnetic vibration feeder combined with hyperspectral imaging system was developed to detect mixed tea stalks and insect foreign bodies in tea finishing products.In this study,the characteristic wavelength of hyperspectral images of tea stalks and insect foreign bodies in green tea was selected,and then the corresponding characteristic images were processed and the characteristic variable parameters were extracted.Finally,the discrimination model of green tea and non-tea foreign bodies was established.(1)Using hyperspectral imaging system combined with electromagnetic vibration feeder to collect hyperspectral images of green tea mixed with tea stalks and insects respectively.The average reflectance spectrum of region of interest(ROI)in hyperspectral images was extracted and analyzed by ENVI software.Three characteristic wavelength selection methods,CROME function,principal component analysis(PCA)and maximum spectral line spacing,are used to select the characteristic wavelength that can best represent the difference between green tea and non-green tea foreign matter.Nine sets of characteristic wavelengths were obtained,595.6,673.3,735.8,774.9,785.6,824.9,842.9,853.7 and 871.7 nm,and it was learned that the images of tea stalks and insects foreign bodies in green tea were more easily distinguished at these wavelengths.(2)The feature images at the selected characteristic wavelengths are segmented by double thresholds and analyzed,and the feature images at the wavelengths of 595.6 and 673.3nm are removed.Then,average filtering,global threshold segmentation,open operation,close operation,Bwboundaries function display target boundary,region marking and feature parameter extraction are carried out on the feature images at 735.8,774.9,785.6,824.9,842.9,853.7 and 871.7 nm.Finally,linear discriminant analysis(LDA)and support vector machines(SVM)discriminant models were established by using six characteristic variable parameters:long axis length,short axis length,ratio of long axis to short axis,circularity,area and perimeter in seven groups of data.The results show that the LDA model based on the characteristic parameters extracted from the image at the wavelength of 785.6 nm has the best discrimination effect on green tea,tea stalks and insects.The classification accuracy of green tea,tea stalks and insects is 97.67%,and the prediction accuracy,recall and accuracy of green tea and non-tea foreign bodies are 100%,100% and 100% respectively.The experimental results show that it is feasible to detect foreign bodies in tea online based on hyperspectral images. |