# Person Re-Identification by Low-Dimensional Features and Metric Learning
## 3 The Proposed Method
### Hand-Crafted Feature Extraction  
The image resolution of person Re-ID images is quite low (mostly less than \(300\times 300\)); these images contain much less information than those of normal resolution, and many appearance details are lost [31]. Therefore, color becomes the most important feature for describing person images. At the same time, the classification of colors is a manifestation of human knowledge, and compared with other characteristics, colors are not easily affected by changes in posture and viewing angle, so they have relatively better robustness in person Re-ID. In this section, we will introduce in detail the color feature with spatial information proposed in our model.  
Based on the bag of feature algorithm (BoF) [32; 33; 34], where the main idea is to quantify the disordered set of local descriptors, we use another widely used color space, the so-called \"hue, saturation, value (HSV)\" color space, instead of the \"red, green, blue (RGB)\" color space to sharpen color images. We divide the HSV color space into 15 color categories, including three achromatic colors (black, white, gray) and twelve colors (blue, green, yellow, etc.). Then, as shown in Figure 3, the basic features of all pixels in the ROI are extracted in turn and classified according to 15 colors.  
For all pixels in each color category \(\varphi=\left\{\text{P}_{1}\text{,P}_{2}\text{,...P}_{\text{s}}\right\}\), if the longitudinal relative difference between two adjacent pixels exceeds the threshold \(\text{T}_{\text{h}}\), then the set is divided into \(\phi_{1}=\left\{\text{P}_{1}\text{,P}_{2}\text{,...P}_{\text{t}}\right\}\), \(\phi_{2}=\left\{\text{P}_{i+1}\text{,P}_{i+2}\text{,...P}_{\text{s}}\right\}\). After several longitudinal splits, we obtain \(\varphi_{\text{h}}=\left\{\phi_{1},\phi_{2},\ldots,\phi_{\text{h}+1}\right\}\), where h is the number of times that adjacent pixels exceed the threshold. Later, each set in the set \(\varphi_{\text{h}}\) is divided horizontally. Finally, \(\varphi_{\text{w}}=\left\{\phi_{1},\phi_{2},\ldots,\phi_{\text{t}+1}\right\}\), where t is the sum of the number of vertical and horizontal divisions. Fifteen color categories are separated in turn and finally T original pixel materials are obtained, namely, \(\varphi_{\text{T}}=\left\{\phi_{1},\phi_{2},\ldots,\phi_{\text{T}}\right\}\).  
To allow the T original pixel materials obtained in the previous section to fully express the information they contain, we convert each original pixel material in \(\varphi_{\text{T}}\) into a feature vector, as shown in Figure 4. Each vector is 14-dimensional, which is the variance and mean of the H, S, and V of all pixels in the original pixel material, and the ratio of the number of  
Figure 3: The pixel material extraction process description. \(h_{i},~{}s_{i},~{}v_{i},~{}rp\_h_{i},~{}rp_{w_{i}},i=1\ldots N\) indicate hue, saturation, value of the pixel, height distance from the origin, and width distance from the origin of the pixel, respectively. \(N\) is the total number of ROI pixels.  
original pixel materials to all pixels in the ROI. In addition, relative spatial information is incorporated, as shown in Figure 4. Each pixel includes not only the HSV color feature but also the spatial position information of the pixel relative to the origin, which is the lower left corner of the image. Then, we can calculate the relative spatial information contained in the original pixel materials.  
Taking the longitudinal relative spatial information as an example, the average relative height (\(AR_{h}\)) and relative height standard deviation (\(SDR_{h}\)) are defined as (2) and (3), respectively.  
\[rp\_h_{i}=\frac{Pixel_{i}-RoI_{min}}{RoI_{max}-RoI_{min}} \tag{1}\]  
\[AR_{h}=\frac{\sum_{i}^{n}rp\_h_{i}}{n} \tag{2}\]  
\[SDR_{h}=\sqrt{\frac{\sum_{i}^{n}(rp\_h_{i}-AR_{h})^{2}}{n-1}} \tag{3}\]