# Enhanced Curvature-Based Fabric Defect Detection:
## 4 Gabor Transform-Based Approach  
The regular repeating texture of fabrics can be characterized by dominant spatial frequency and orientation signatures of the underlying textile pattern. Two-dimensional (2-D) Gabor filters have been successfully applied to the analysis of textured images, particularly those with distinct frequency and orientation properties, making them highly suitable for textile fabric defect detection applications [21; 22].  
The 2-D Gabor filters have demonstrated their effectiveness in a wide range of image analysis tasks. They are regarded as one of the most efficient and widely used tools for applications such as texture boundary detection, image segmentation, discrimination, and texture classification [23]. Recently, these filters have also been employed in the analysis of raw textile fabrics [24]. Texture analysis methods utilizing 2-D Gabor filters can be broadly divided into two categories: filter banks and individually tuned/matched filters.  
The filter bank approach requires a large set of filters with predefined parameters to adequately cover the frequency plane, resulting in a correspondingly high-dimensional feature space [25]. While this extensive filter bank can improve segmentation, it may also negatively affect the quality of classification and recognition [26]. In contrast, tuned/matched Gabor filters address the limitations of the filter bank approach [27]. The parameters of the optimized/tuned Gabor filter set are closely aligned with the textural features to be detected, making them particularly suitable for segmentation and classification tasks [28; 29].  
The pseudo code of the described Gabor Transform Algorithm is presented Algorithm 2.  
```
\(\text{image}\ (n\times n)\
eq nonempty\) \(\text{kernel}\gets getGaborKernel((ksize,ksize),sigma,theta,lambda, gamma,phi)\) if Filter selection type then \(filteredimage=filter(image)\) endif \(Gaborimage\gets filter2D(image,kernel)\)\(\triangleright\) Gabor Transform Image while\((n\times n)\leq GaborTransformImage()\)do  Sum the energy density of all pixels. \(\triangleright\) Calculate the energy density endwhile if Energy density is \(\geq\) Threshold Energy then  Image is defected endif
```  
**Algorithm 2** Gabor Transform Algorithm  
Gabor filters can also be utilized in conjunction with techniques such as the co-occurrence matrix and core principal component analysis (PCA) to detect fabric defects. These combined methods have successfully achieved high detection rates in online fabric inspection. The use of Gabor filters facilitates the extraction of features for various defect types, as defect classification is based on the specific filter types employed.  
In this research, defective fabric images were captured using the experimental setup illustrated in Figure 14. Subsequently, Gabor filters were applied to these images, and regional energy densities were examined as a novel approach. The filtered image is shown in Figure 15. Regions with high energy density were identified as faults using our newly designed filter bank. To achieve a high detection accuracy, the filter parameters were optimized to align with the fabric texture. A confusion matrix was constructed based on the detection results, classifying images as either faulty or flawless, with a partial representation shown in Figure 16. The results obtained using this new approach are presented in Table 3.