In this paper, an online fabric defect detection system that can detect fabric defects which may occur during the fabric product in knitting machines is introduced. This system mainly includes three steps: 1) Construction of a defected/defect-free fabric database; 2) Obtaining and classification of the feature vectors; 3) Online working on embedded system. This study only contains information about the first two stages. In the first stage, 3242 'defected' and '5923' defect-free images were acquired by using a conveyor system which has line scan camera and linear light. In the second stage, filtering, feature extraction (wavelet transform, co-occurrence matrix and CoHOG) and classification (YSA) processes were carried out. As a result, obtaining the feature vectors through wavelet transform has reduced computation cost by 53% and also has successfully provided the classification of the defects by 90%.