3.2.2. Image Segmentation

The adaptive thresholding method was used for segmentation of the bloodstream [13]. The obtained image after thresholding (Figure 5a) corresponded to the bloodstream of large veins. Unfortunately, the image bears plenty of noise, with several unfinished lines, and calls for filtering.

**Figure 5.** Process of bloodstream filtration: (**a**) after thresholding (left), (**b**) after median filtration (middle), and (**c**) after dilatation and erosion (right).

The median filter in combination with a morphologic filter was used. The median filter of 3 pixels mainly removes the small fragments in the image (Figure 5b). Furthermore, dilatation and erosion processes are carried out, so that some sections of the individual parts of veins connect. These were previously not connected due to noise and faults in the image (Figure 5c). The next step in the image processing is the extraction and evaluation of biometric characteristics of the bloodstream results. This is derived by comparing the obtained image and the image of the fingerprint during dactyloscopy, as discussed by Reference [20].

After the smoothening and thinning of the image, the skeletonization of the image is automatically achieved (the skeleton is extracted) [2]. Thinning is a morphologic operation that is responsible for the deletion of selected pixels from the binary images. The process shares similarity to opening and erosion. During thinning, pixels at the edges get deducted from the objects, but not in such a way that disturb the object results. Iterative thinning can be achieved using an algorithm. In 1986, Alberto Martin and colleagues [55] analyzed a few different thinning algorithms. The results of their study indicated that the best outcomes from the point of reliability and effectiveness are achieved by algorithms that are based on the method of samples and the method "sign and delete." One of the representative algorithms of this group that was chosen for this study is the thinning algorithm by Zhang-Suen [56].This thinning

method is simple, and gives room for evaluation even when in low-quality contour objects. Figure 6 shows the process of thinning iterations.

**Figure 6.** Process of thinning: (**a**) 2nd. Iteration (left). (**b**) 6th. Iteration (middle). (**c**) Result (right).

As noticeable on the last image (Figure 6c), due to the faults in the image, parts of the skeleton as well as the points or unfinished lines are still visible. These are veins that, in one place, run deeper into the tissue of the hand. Therefore, they become invisible for the camera. It is often necessary to eliminate such artifacts before the extraction.

For the elimination vein line artefacts, a self-created image filter was used. This filter is based on the number of the pixel connections. This is the combination of the number of individual connections of the examined pixels and the chosen object's pixels. The number of such connections may have values between 0 and 4. Figure 7 shows examples of the surrounding pixels. The filter's algorithm runs through all image pixels and searches for pixels that are at the end of the line (stand-alone pixels). The number of connections is usually 0 or 1 (Figure 8).

**Figure 7.** Examples of the number of pixel connections.

**Figure 8.** Skeleton before and after filtration.
