## 2 Materials and Methods
### Feature Extraction Quadrants  
The proposed method divides the images to obtain local and global features from them. The method consists of four stages: firstly, the images in the database are divided into images to be used in training and those to be used in testing. In the second stage, color and texture features are extracted from the training images on both global and local scales. In the third stage, color and texture features are fused to become the inputs to the SVM classifier, and the last stage is a post-processing stage that uses bagging with the test images for classification. These stages are summarized in the block diagram of Figure 1.  
To be able to compare the performance of our method with previously published results, we used the same partition, into training and testing sets, in each database. In the case of the Brodatz database, as in Reference [1], each colored texture image was partitioned into nine sub-images, using eight for training, and one for testing. An example of this partition is shown in Figure 2a-c. The Brodatz Colored Texture (CBT) database has 111 images of \(640\times 640\) pixels. Each image in the database has a different texture. For the Vistex database, the number of training and testing images was eight as in Reference [4]. In the case of the Outex database, the number of training and testing sub-images was 10 as in References [4; 9; 47]. The KTH-TIPS2b database was already partitioned into four samples, and we performed a cross-validation as in References [7; 48]. In each case, we subdivided the training database and the test database using two parameters: n is the number of images divided by side, and r is the times we take n\({}^{2}\) local images from each sample. We  
Figure 1: Block diagram of the proposed method. Figure 2: (**a**) The Brodatz image (D88) is used to create the training image (**b**) and test images (**c**). (**d**) The Vistex image (Food0007) is used to create the training images (**e**) and test images (**f**). (**g**) The Outex image (Canvas002) is used to create the training images (**h**) and test images (**i**). can take \(r\times n^{2}\) local images to extract features from all the samples in each database. Figure 3 shows the image subdivision scheme for the training images. It can be observed that the partitioning scheme allows obtaining features from different parts of the image, at a global and local level. The method was designed to follow this approach so that no relevant information would be lost from the image. BQMP and Haralick (without using co-occurrence matrices) are invariant to translation and rotation; the same features are obtained if an exchange of the position of two pixels is made in the image [3; 6; 47]. This suggests that there is spatial information present in the image that is not extracted by these features. In our proposed method, we use the two-scale scheme, local and global, to add spatial information to the extracted features. This is shown in Figure 4, and explained in detail in Section 2.4. The BQMP and Haralick features are extracted in each quadrant. The test images can be subdivided into local images from which the features are extracted. This allows the creation of a post-processing stage in which a bagging process can be performed. Our method is invariant to translation because of the randomness of the local image positions, but it is partially invariant to rotation because the features are concatenated in an established order. However, color features, as well as Haralick texture features, are invariant to rotation. There are problems where orientation dependency is desirable [49]. Figure 4: Example of (**a**) the original image. (**b**) The four local partitions and (**c**) the global partition. These five images generate two spatial scales: four local (**b**) and one global, adding spatial information to the extracted features. Figure 3: (**a**) A sample image from Vistex (Food0007) and the subdivision process. (**b**,**e**) Image is divided into \(n^{2}\) images.