| China is a big country in bamboo products manufacturing.In 2020,the output value of the national bamboo industry has reached 300 billion.Bamboo is the raw material for the manufacture of various bamboo products,but in the process of bamboo storage,there will be problems such as wormholes in the bamboo,and mildew in the bamboo.In the process of processing bamboo into bamboo pieces,there will be defects such as bamboo cracks and triangular strips,and the color of the bamboo itself is inconsistent.The surface aesthetics of bamboo products is an important criterion for testing their quality.Therefore,it is necessary to separate the defective bamboo pieces from the non-defective bamboo pieces,and then classify the non-defective bamboo pieces according to the three color standards of black,white and yellow.During production,three types of non-defective bamboo chips are processed into black,white and yellow panels,and defective bamboo chips are processed into middle and bottom plates.At present,the defect detection and color classification of bamboo chips are mainly done manually.This method has low production efficiency and high production cost,which cannot meet the development needs of the bamboo industry.At present,some scholars have proposed a bamboo chip defect detection scheme based on image processing technology,but these schemes detect few types of defects,and each defect is detected by different algorithms,which is less practical.This research mainly applies image processing and deep learning technology to detect eight types of bamboo chip defects,including wire drawing,rupture,borehole,mildew,green bamboo,yellow bamboo,black knot and triangle strip.,white and yellow bamboo chips are classified by color.The main research contents of this paper are as follows:(1)An experimental platform for defect detection and color classification of bamboo chips is designed.In view of the slender characteristics of bamboo slices,an opposite-beam strip light source lighting system is designed to make the illumination uniform in the linear range of the bamboo slices and ensure the uniform brightness of the collected images.Select suitable industrial cameras and lenses and verify that they meet production requirements.A dark box is designed to isolate the influence of light in the factory and ensure the stability of the image acquisition environment.Eight kinds of bamboo chip defect images and non-defective bamboo chip images of black,white and yellow colors were collected,and a bamboo chip sample database was constructed.(2)In this paper,the gray-scale method and the edge method are combined,and a new bamboo chip defect detection algorithm is proposed,which can detect all eight kinds of bamboo chip defects.Firstly,the bamboo chip image is preprocessed,and the grayscale and noise reduction of the image is carried out.Then,the extraction algorithm of the bamboo slice area is designed,and the outline of the bamboo slice area is detected after the image is processed by thresholding and edge detection.Based on the Hough transform,the edges of the bamboo pieces are fitted,and the inclination angle is detected and the inclination correction is performed.The image is cropped according to the edge of the fitted bamboo pieces,and only the bamboo pieces are retained.Finally,the Otsu algorithm is combined with the edge detection algorithm based on Canny operator to detect bamboo defects,and the detected defects are marked by the minimum circumscribed rectangle method.Taking the bamboo chip image database collected in this paper as the experimental sample,the average detection accuracy of bamboo chip defects of the algorithm in this paper is 88.75%.(3)Select two neural network models based on Resnet and Alexnet as the framework,adjust the parameters of the two neural networks,and classify the color of bamboo chips.The neural network is trained with bamboo images with background and bamboo images without background respectively.The highest color classification accuracy of the Resnet neural network after training is 96.8%,using the bamboo image with background as the dataset.After adjusting the Resnet neural network,the background-free bamboo image is used as the data set for training,and the color classification accuracy rate is 99.9%.Using background-free bamboo slice images as the dataset,the color classification accuracy of Alexnet neural network after training is 89.7%.Finally,the Resnet neural network with a color classification accuracy rate of 99.9%is selected as the color classification algorithm in this paper. |