# Object/Scene Recognition Based on a Directional Pixel Voting Descriptor
## 3 The Proposed Algorithm
### Feature Extraction and Description
#### 3.2.2 Segment Generator (Feature Extraction)  
To generate \"robust\" edge segments, we propose an approach inspired on the canonical seed-segmentation method [34; 35]. In this method, a seed is selected to initiate the segmentation process. This seed serves as the starting point for segment expansion. The segmentation algorithm iteratively grows the segment by incorporating neighboring pixels that satisfy certain criteria, such as similarity in color, texture, or intensity. This process continues until the segment reaches a predefined stopping criterion, ensuring that it encompasses a coherent region of interest. By leveraging the canonical seed-segmentation approach, we aim to achieve accurate and reliable edge segments that capture meaningful structures in the image data. This approach offers robustness against noise, variations in lighting conditions, and other sources of interference, making it well-suited for a wide range of image segmentation tasks. Let \(g_{xy}(i,j)\) be the gradient map \((g_{xy}(i,j)=g_{x}(i,j)+g_{y}(i,j))\), \(d(i,j)\) be the direction map computed via Equation (2), as shown in Figure 4(b), and \(f(k)\) denote an anchor point \((i,j)\); these anchor points are grown horizontally or vertically depending on the direction image at anchor point \((i,j)\), as illustrated in Figure 6, where for each anchor \((f(k))\), there are \(5\)\((n)\) possible growth directions. Each direction (marked by a red square) is evaluated using the gradient map \((g_{xy}(i,j))\) as an edge criterion, where \(\text{Crl}(n)\) defines the correlation between the anchor point and the \(n-\text{th}\) growth direction. In practice, the growth direction could change from vertical to horizontal in the same segment, but this is supported by the diagonal element of the grown pattern, \(\{p_{2},p_{4}\}\), \(\{p_{4},p_{2}\}\) Figure 5(a). Therefore, when a change in direction occurs, it is addressed by the current growth pattern, and when the direction changes (in the directions image), the growth pattern is changed. All possible directions are ordered clockwise. This facilitates the software implementation by implementing shift vectors. Notice that all evaluated directions are disabled by resetting their corresponding value to zero. Finally, the segment grows in the direction with the highest edge correlation compared to the anchor, and only if this correlation is always greater than a threshold th. The whole process is lay down in Algorithm 2. For practical purposes, we recommend a threshold value of 32. The whole process is illustrated in Figure 7; when the current pixel does not allow growth, the algorithm returns to the original anchor and starts to grow in the opposite direction. Finally, in Figure 8, the extracted features, 'edge segments', are shown. Figure 5: Image patterns for the feature extraction. On the one hand, a gradient map determines each potential growth direction based on a threshold th (**a**). On the other hand, vertical (red) and horizontal (green) gradient directions are utilized to define the growth direction (**b**). Figure 6: For each anchor \(f_{k}\), there are five possible growth directions \(p_{1}\dots p_{5}\) and two directions patterns, i.e., vertical (**a**) and horizontal (**b**). Each direction is evaluated disabling all evaluated pixels, and if the most similar candidate meets a threshold value, it is considered a valid growth direction; for more details, please see Algorithm 2. Figure 8: The extracted segments via the proposed algorithm. Each segment is represented by a different color. Figure 7: The feature extraction process let \(f_{k}\) be an anchor point. This point grows vertically first from \(f_{k}\) to the top \(1,2,\ldots,12\) and then from \(f_{k}\) to the bottom \(13,14,\ldots,20\). \[\text{match}(i)=\left\{ \begin{array}{ll}1&\text{if argMin}_{i}\text{Crl}(i) \leq\text{th}_{\text{match}}\\ 0&\text{if otherwise}\end{array} \right. \tag{12}\]  
where \(\text{match}(i)\) represents the match status, being zero if the segment \(i\) was not found in the query or 1 otherwise.