| With the continuous development of social economy,the demand of wood for social construction is increasing day by day.Wood defects have a significant impact on wood quality and reduce the use value of wood.Therefore,the detection of wood defects is an important part of wood processing.At present,the level of wood processing automation in China is low,and the main reason is that the accuracy of defect identification is not high and the location is not accurate.In order to significantly improve the efficiency of wood use,scholars at home and abroad put forward a variety of wood defect detection methods.However,the color,texture,size and other characteristics of wood defects are quite different,which makes it difficult to identify and segment wood defects.At present,there are still some limitations in the detection methods of wood defects,so it is difficult to achieve a unified segmentation and recognition of wood defects.In this paper,a method based on machine learning is proposed to detect wood defects such as live knots,dead knots,wormholes and holes.First of all,through the training of fast RCNN network,the detection model that can locate and identify wood defects is obtained;secondly,NL means method is used to denoise the image,and the image is enhanced by linear filtering,adjusting contrast and brightness;then the image is binarized,and the defect edge is extracted according to the pixel difference.In order to extract a smooth defect edge curve according to the pixel difference in a short period of time,this paper proposes an iterative outlier removal algorithm which combines linear filtering and threshold classification to eliminate the influence of outliers on the defect edge and reduce the running time of the algorithm.The experimental results show that the algorithm proposed in this paper has better defect location and classification ability,clear and smooth defect contour,and achieves better segmentation effect.In the actual wood processing,generally using the method of manual line drawing to circle and remove the defect area with a box,and then fill the corresponding size of high-quality wood.In order to improve the use efficiency of wood,this paper proposes an ellipse fitting method based on the least square method to fit the edge of the defect.By predigesting the sample points in advance,and then carrying out the iterative calculation of the sample points,the shortcomings that the conventional ellipse fitting method can not include the whole target are improved,the ellipse fitting of the edge of the defect of wood is realized,and a new wood is provided The experimental results show that the algorithm has good fitting effect.It can reduce about 10%wood filling in defect repair. |