## 3 Feature Extraction
For each set, thresholds, denoted as \(T_{A}\) and \(T_{B}\), are calculated by averaging pixels values contained in each;
4. The new reference threshold \(T_{1}\) is given by the average between \(T_{A}\) and \(T_{B}\). The algorithm ends if \(T_{1}\) is equal to \(T_{0}\); otherwise, steps 2, 3, and 4 are executed until equal thresholds are obtained in two successive iterations. Binarization results obtained with mean and Ridler's threshold are shown in Figure 5a,b, respectively. Figure 4: Example of pixel value distribution in a B-mode image. Subsequently, a complementary image is derived to have pixels corresponding to the vein with value 1, which is a need in the next operation; some morphological operations [43] are then performed. The selection of the range of the connected components that are a candidate to be recognized as the vein is first performed by removing areas too wide (>1600) and too small (<129). These values were set in a heuristic way by analyzing all the images in the database and by accounting for vein dimension and produced significantly different results from those used in a previous work [38]. If no related component is found, the search range is extended, and the lower threshold is set to 50. Note that upper and lower limits have to be fixed to filter connected regions that are not related to a vein. As can be seen in Figure 5, there are connected regions too wide (see, for example, in the top and the bottom of the image) or too small (almost everywhere) to be considered as a vein. A closing operation is then performed to fill small holes in connected regions. Once connected regions are identified, centroids are calculated. To the authors' best knowledge, this is the first work where hand vein patterns are extracted from greyscale ultrasound images for biometric recognition purposes. The analysis is therefore focused on a single pattern to verify extraction accuracy by comparisons with C-mode images extracted at various depths and to gain confidence in the recognition capability by performing preliminary experiments. In Figure 6, centroids are indicated with red dots. Then, the image from which the pattern begins is opportunely cropped to contain computation time, and the mean point of the new image, indicated in the Figure with a blue dot, is calculated. The starting point of the vascular pattern is the centroid with the smallest Euclidean distance from the midpoint, highlighted with a green circle in Figure 6.  
According to the [PERSON]'s algorithm [37, 44], the 3D vascular pattern is achieved by linking the centroid selected in image \(n\) to the one of image \(n+1\) that has the smallest Euclidean distance from it. However, it may happen that no connected regions, and hence centroids, are found in image \(n+1\) that are sufficiently close to the centroid in image \(n\). To hold this problem, the following strategy has been devised and experimented with: only centroids that are no more than 12 pixels away on the z-axis and 15 on the x-axis from the reference centroid of the previous image are considered valid. If no centroid is found in image \(n+1\), then the XZ coordinates of the one detected in the previous image (\(n\)) are assigned. If this condition occurs for j consecutive images, coordinates of missing centroids are calculated through interpolation from those of centroids in images \(n\) and \(n+j\). Based on a heuristic analysis of the images in the database, a further crop is performed, and only 461 B-mode images are analyzed, from the 200 th to 640 th, which is the central part of the palm where veins are clearly detectable. Figure 5: Binarized image obtained by using (**a**) mean threshold and (**b**) Ridler’s threshold. An example of a pattern obtained is shown in Figure 7. In order to provide a first validation of the accuracy of the method, a 2D pattern is obtained by projecting a 3D pattern on the XY plane (Figure 8a). This 2D pattern can be compared with a C-mode image, i.e., an XZ plane extracted at a depth of 6.28 mm from the acquired volumetric image, shown in Figure 8b.