In the textile industry, cloth inspection machine plays an increasingly important role in the process of fabric production,with the improvement of the efficiency of weaving machine and the requirement of the quality of fabric are more and more strict,human eye test method has exposed defects:the improvement of labor cost,low efficiency and so on.So the use of machine vision instead of artificial visual defect detection is imperative. This paper studied the feature extraction of fabric defect detection,designed the defect system syste of GLCM feature extraction.Firstly,images were preprocessed,secondly,denoising the noise images,lastly,The glcm is obtained according to the gray image.We can get six characteristic values:deficit moment, entropy, contrast, correlation, two - order distance and difference.Using 60% images for training samples for BP neural networks and designing BP neural network.The simulation experiment of this method is carried out using MATLAB.The experimental results show that this method is useful.