In this work, we present a new direct approach to automatic fabric inspection based on an optical acquisition system and an artificial neural network (ANN) to analyze the acquired data. Defect detection and classification are based both on gray levels and 3D range profile data of the sample. These patterns are simultaneously fed into a feed-forward neural network without further transformation. The ANN is trained to classify three different categories: normal fabric, defect with a marked 3D component, and defect with no 3D component. The good classification rate obtained shows that the double set of patterns acquired basically includes relevant information on the textile sample. Since no further transformation of the data is needed before classification, the response of this system can be very fast and thus suitable for on-line monitoring of fabric defects at a high inspection rate.