Automatic Detection and Characterization of Human Veins Using Infra-Red Image Processing ()
1. Introduction
Vein visualization is crucial for various medical procedures, including venipuncture and intravenous therapy. Traditional methods often struggle with accuracy. The evolution of research in fields like Artificial Intelligence, Image Processing has enabled the appearance of revolutionary techniques in many fields of science and technology. In multimedia, for example, work such as [1] [2] has helped optimize visual artifact correction algorithms to continually improve the quality of images and videos. Particularly, the combination of image processing techniques and optimization algorithms specifically applied in medicine has led to the development of medical tools such as the biomedical imaging techniques.
Although several studies [3]-[6] have been carried out in the area of vein detection and many devices have been developed, the major problem lies in the use of a non-invasive technique, characterization and operation of processed data. A portable and efficient infrared non-invasive imaging detection system is much recommended today. Furthermore, burns and other physical injuries make it difficult to locate veins and administer life-saving medication. In such cases, it becomes very necessary to have a device that detects the exact location of the required vein. Meanwhile, in case of blood transfusion or weaning, it is important to know the position of the veins. On the other hand, they are not efficient when used on black skin and not fast enough in use, thereby not compatible with situations like medical emergency where every second counts to save a life. Besides, some of the techniques used are invasive. Therefore, there is the need to offer a non-invasive cheap solution for African countries, so that hospitals in these regions will be able to have vein detection systems capable of producing exploitable results in record time (in a few seconds).
The system to be designed would be able to extract the characteristics of the veins inside images acquired by an on-board camera. The needs of emergency operations have imposed the search of a faster way to identify in real time the most suitable vein for the operation indicated. The main goal of the study is to make a portable and cost-effective vein detection system.
2. Related Works
Biomedical imaging techniques based on wave propagation phenomena in biological tissues are commonly used to detect and treat diseases, but are also used to image non-invasive organs and biological structures inside the body [7]-[9]. Among them, optical tomography is a rapidly growing imaging technique, offering the advantages of being non-invasive, experimentally simple, reproducible and inexpensive. Optical tomography uses light which at specific wavelengths offers a wide variety of interaction phenomena, functions of physiological changes at the cellular and sub-cellular levels, and allows information to be retrieved from biological systems. Over past decades, publications in this domain have reported promising results as well as some truly surprising images of human and animal organs, allowing us to consider the capacities of biomedical imaging using light. Nowadays, finger vein has become one of the major interests in biometric research for automated system due to it attributes in high security and reliability. Accordingly, a lot of new devices and technologies which are related to vein recognition have emerged in the worldwide market [10]-[12].
2.1. In Vivo Characterization Techniques
Biomedical imaging systems are made up of a large part of medical devices used in the medical field. These devices allow clinicians to see things that are not visible to the naked eye. This involves the use of different waves in the electromagnetic spectrum, including ultraviolet rays and x-rays. Imaging technologies are essential for the diagnosis of some diseases that are complex to be diagnosed otherwise. Medicine prefers to use techniques that can provide an in-depth view of the skin, then the evolution of the tissues. These are so-called non-invasive techniques, such as ultrasound, Magnetic Resonance Imaging (MRI), Optical Coherence Tomography, and Con-focal Microscopy, whose two important parameters are resolution and depth of penetration.
Ultrasound imaging is used for the diagnosis, treatment, and visualization of blood vessels during the insertion of venous catheters. Miharu M. et al. [13] are therefore carrying out short and long-term experiments on a sample of patients to determine the diameter of veins using ultrasound imaging. Mendoza E. and Lattimer C.R. [14] use the Doppler technique and ultrasound waves to locate veins and induce blood flow to diagnose vein diseases. In 2003, Peter Kupo et al. [15] worked on ultrasound guidance for femoral venous access in patients undergoing pulmonary vein isolation. In contrast to conventional techniques, ultrasound guidance reduced the risk of complications by 11.63% compared with 2.01% for conventional methods and also reduced the rate of hospitalization.
Magnetic Resonance Imaging (MRI) is an evolving technique, which uses the properties of the body’s hydrogen nuclei (or protons) to emit a signal [16]. Magnetic resonance imaging can also be used to study performance in the diagnosis and evaluation of lower limb venous pathology [17]. Optical Coherence Tomography (OCT) is an emerging biomedical optical imaging technique that provides high resolution and tomographic imaging of the cross section of the microstructural biological system [18]-[20].
2.2. Infrared Ray-Based Technology
Infrared (IR) is a type of electromagnetic radiation, including wavelengths between the 780 nm to 1000 μm. IR is divided into different bands: Near-Infrared (NIR, 0.78 - 3.0 μm), Mid-Infrared (MIR, 3.0 - 50.0 μm) and Far-Infrared (FIR, 50.0 - 1000.0 μm) as defined in standard ISO 20473:2007 Optics and photonics [21]. Nowadays, the poor visibility of subcutaneous vasculature in the visible part of the light spectrum is overcome by near-infrared imaging and a flipped projection of the recognized vasculature onto the patient’s arm [22]. They improved the visibility of veins in imaging by using convolutional neural networks and reinforcement learning for real-virtual image transformation. In [23], infrared radiation is used to visualize subcutaneous veins and even veins deeper in tissue and those in thicker tissue. To achieve this, image processing techniques are used and several factors, such as wavelength, LED characteristics, and the number of LEDs were studied. Gunawan et al. in [24] deployed an algorithm for improving quality of images by using high boost filter and worked on the back projection by utilizing the intersection of the camera and projector image. The NIR technique is used to obtain veins images. High boost filter is used for segmentation and morphology and closing process along with contour region is used to eliminate segmentation noise. 84.62% accuracies have been reported by using these combinations.
One of the main ideas of the present work consists in the connection between vascular blood and infrared radiation. There are two types of blood circulating in the human body in terms of the presence of hemoglobin, Oxyhemoglobin (oxygenated blood) and Deoxyhemoglobin (deoxygenated blood). Oxygenated blood is pumped by the heart after it has passed through the lungs. In the veins, the blood begins to lose oxygen to the surrounding tissues due to cell metabolism. This type of blood is known as deoxygenated blood. Deoxygenated blood has the property of absorbing infrared radiation [25].
3. Basic Stages of Proposed Approach
In this paper is proposed an effective approach for automatic detection of human veins, especially for medical purposes. The functional diagram of the system is presented in Figure 1. When a particular vascular region is illuminated by the IR source, the light is absorbed into the blood and the surrounding tissue reflects the light. This light is captured by an infrared camera and the captured image is sent to a Raspberry Pi board embedded in the system for further processing. The subsequent processing on the image is contrast enhancement. The resulting image is then sent to the screen. Each image is taken separately. When processing is complete, the resulting image is sent to the output for display.
4. Materials and Methods
In the proposed system, the near infrared (NIR) domain is used. In fact, the NIR range is favorable for the identification of typical bands of some chemical groups or ions such as: Fe2+, H2O, OH,
. Therefore, these absorption bands are for qualitative or semi-quantitative analysis of these entities and also determine some elements.
NIR veinous imaging works on the principles of light propagation, absorption, reflection and scattering in different layers of the skin [26] [27]. In the low absorption window, light penetrates deeper into the skin allowing better visualization of the
Figure 1. Functional diagram of the vein detection system.
veins. Based on absorption and reflectance spectra of skin tissue and due to deoxygenated hemoglobin, veins appear darker compared to skin tissue. The reflectance extraction is necessary to obtain spectral responses independent of illumination. In nature, each element reflects a specific amount of energy out of the total energy to which it has been subjected. Reflectance is defined in Equation (1) [28]:
(1)
where:
R(x,y,λ) is the reflectance value at the specific point (x,y) at a specific wavelength λ,
Ereceived(x,y,λ) and Ereflected(x,y,λ) are respectively the Energy received and the Energy reflected by the material.
The raw measurement I(x,y,λ) measured by the imaging ”multi-spectral” system at the point of coordinates (x,y), specific to the wavelength λ can be described by the formula in the Equation (2) below:
(2)
where:
L(x,y,λ) is the illumination (enlightenment);
S(x,y,λ) is the response spectrum of the camera system;
and O(x,y,λ) is the offset which incorporates the dark current of the camera system and the stray light.
The calibration of the imaging system is performed using white and black Lambertian surfaces, with known reflectance values Rw(x,y,λ) = 0.98 and Rb(x,y,λ) = 0.05, respectively. The intensity of the image values of white and black reference surfaces Iw(x,y,λ) and Ib(x,y,λ) can be calculated. Moreover, L(x,y,λ), O(x,y,λ) and S(x,y,λ) can be considered as constants for a certain wavelength and pixel of coordinates (x,y), the product of the illumination and the spectral response of the system, i.e. L(x,y,λ) × S(x,y,λ) can be determined for each wavelength according to Equation (3):
(3)
By substituting the value of L(x,y,λ) × S(x,y,λ) in Equation (2), the offset at each wavelength can be calculated as follows:
(4)
Finally, L(x,y,λ)× S(x,y,λ) and O(x,y,λ) are replaced in Equation (2) in order to obtain the reflectance value for each image:
(5)
With this Equation (5), spectral reflectance images can be extracted for each wavelength.
4.1. Regions of Interest (ROI) Extraction
Regions of interest usually means the meaningful and important regions in the images. The use of ROI can avoid the processing of irrelevant image points and accelerate the processing. It is very often necessary to obtain a region-of-interest from an image for proper recognition. Through in-depth study, researchers gradually reach a consensus that ROI can replace the original image in image processing for the reason the image contained in the ROI images are the main information and key information [29]. Hence, different image segmentation techniques have been implemented with varying degrees of success. These techniques include manual cropping with a combined matched filter and a local binary fitting model to locate tiny boundaries (small veins) in images [30].
4.2. Image Enhancement
Image enhancement is a process which brings out details that are hidden in an image, or to improve the quality of an image, so that it becomes suitable as an input to some specific automated processing system [31]. Many previous studies have developed different enhancement methods for vein images to overcome the performance degradation of hand vein detection and pattern recognition [32]-[35]. The CLAHE method is used to improve the contrast of images. It differs from ordinary histogram equalization in that the adaptive method calculates multiple histograms, each corresponding to a separate section of the image, and uses them to redistribute the brightness values of the image [26]. CLAHE is selected particularly due to a reported result that CLAHE has shown to be superior at enhancing local contrast by reducing the effects of edge shading in both noisy and homogenous areas, especially on medical images. Hence, it is expected to be able to improve the local contrast and details of the vein patterns in this work. Ayoub et al. [36] used a high-resolution infrared camera, vein warmer, and image contrast enhancer (CLAHE) system to improve the visual appearance of vein imaging. It was concluded that the temperature increases positively affected the vein imaging. Yıldız and Boyraz [37] designed a raspberry pi based low-cost vein imaging device in their study. The images captured from the infrared camera were subjected to grey level transformation, CLAHE, median filter, adaptive thresholding, and various morphological processes, respectively. Similarly, in this work, the CLAHE algorithm is chosen for contrast enhancement as it does not over amplify noise. The noise present in the image is automatically removed since the operation is performed in smaller regions, i.e. blocks of images [38]. The CLAHE algorithm is presented in Figure 2.
4.3. Thresholding Algorithm
This is the simplest form of image segmentation. Here, the grayscale image is converted to a binary image, designating a label or number (intensity value) to each pixel in the image, so that the pixels share the same characteristics if they have the same label. The NIR image of the digital vein is always of poor quality, due to the capture device which is sensitive to noise. The global threshold therefore cannot be used. Local thresholding is performed on the characteristics of the local image. The lower the gray value of the pixel, the more likely it is to be in the vein region [39]. The median of the pixel values of the particular block is better than the average values because it gives more precision. The basic rule of the thresholding algorithm is given by the Equation (6).
(6)
4.4. Morphological Operations
Mathematical morphology offers classes of applications in segmentation and image enhancement. Morphological transformations are operations based on the shape of the image [40]. They are usually performed on binary images and need two inputs: one is the original image, the second is called a structuring element or
Figure 2. CLAHE Algorithm.
kernel which decides the nature of the operation. Morphological operations are performed on smaller regions, that is, on small image blocks to remove unwanted parts and help restore missing parts of the image. The morphological operations used are dilation, erosion, and edge detection. The dilation operation makes an object to grow by size. The extent to which it grows depends on the nature and shape of the structuring element. The erosion process is as same as dilation, but the pixels are converted to “white”, not “black”.
Image Processing Algorithms
The most important part of this project is the extraction of veins. The algorithm used for the extraction of the veins is given by the diagram in Figure 3.
5. Experimental Setup
The experimental setup used involved various instruments and equipment to capture and analyze human veins. Python was used as programming language. Its design philosophy implies that the code should be easily readable and it should give programmers complete freedom to express concepts in fewer lines of code compared to C/C ++ or Java. Raspberry pi was used as image processing unit. It is a stand-alone device for embedded system applications. OpenCV as a library of programming functions for computer vision. It is a cross-platform library that
Figure 3. Veins-extracting process.
mainly focuses on image and video processing. Besides, it also contains GUI features for user convenience.
OpenCV-Python, a Python binding library designed to solve computer vision problems and NumPy, a library for the Python programming language were used.
To develop the prototype, an acer aspire 5733 computers equipped with a windows 7 Pro operating system, with a 500 GB hard drive, 4 GB RAM memory and a Core processor i5 intel at 2.4 GHz frequency have been used.
The operating system implemented is Raspbian, from Debian Wheezy which compiles the hard floating code which will be executed on the Raspberry Pi computers.
The infrared camera used is a 5 Megapixel camera with its infrared filter which is used to block visible light, inserted in front of the charge coupled device (CCD) and behind the camera lens.
In order to obtain a complete description of the reflectance for different skin tones in the visible and NIR range, a Raspberry multispectral camera coupled with infrared LEDs was used. The camera has the ability to acquire images in the visible range as well as NIR. Thus, the different skin tones of the subjects were classified according to luminance (L value) into four different classes; that is, fair (normal), light brown, dark brown and dark. Figure 4 shows the different skin tones of the subjects, highlighting the fact that the veins are difficult to locate in the visible spectrum. For comparison, Figure 5 shows the same subjects in the NIR range from 740 to 980 nm (average image). We can see that the veins are more visible. This figure also shows that, even in the NIR range, it is difficult to see the veins of subjects with darker skin tones.
Figure 4. Four classes of skin: (a) Fair, (b) Light brown, (c) Dark brown and (d) Dark.
Figure 5. NIR image for each class: (a) Fair, (b) Light brown, (c) Dark brown and (d) Dark: Extraction of the skin and veins reflectance for all the subjects from multi-spectral images.
6. Experimental Results and Discussion
We concern in the output image projecting into participant’s skin is the shape of the blood vessel segmented from original infrared image obtained by the CCD camera. To do this, we use adapted algorithm to enhance the contrast between blood vessels and others surrounding tissues. The contrast-enhanced images are then converted into binary images by thresholding algorithm. Blood vessel is appeared significantly darker than surrounding tissues. By thresholding, we can segment veins out of the images, mark it by the bright color to ready to display into the volunteer’s skin by the projector. The extraction of ROIs is carried out for database samples by using OpenCV and Otsu’s thresholding.
6.1. Image Acquisition and Analysis
This section discusses the detection of hand vein images from self-acquisition dataset based on the image histograms observation. Figure 6 depicts samples of collected dataset. The study was done with only darker skin tones. The set of images presented in this study was selected from a male and female participant who is having a significantly different visibility of veins in the raw image.
Figure 6. Samples of collected dataset.
This dataset contains 200 grayscale infrared images of forearm veins collected from 21 individuals (15 males and 6 females, aged 18 - 50). The images were acquired using a near-infrared (NIR) vein imaging device. Image acquisition was performed in a low-light setting to avoid additional light source interference. All images are encoded by a resolution of 320 × 240. Each participant’s forearm was scanned multiple times to capture vein patterns under different conditions such as arm rotation, and environmental temperature (ranging from 23˚C to 35˚C). The images are divided into two categories: left forearm and right forearm, each containing 100 images. All individuals gave informed consent prior to image acquisition, and the dataset has been anonymized to protect personal identity. Ethical approval was obtained for data collection and usage in research contexts.
6.2. Image Processing and Findings
Figure 7 shows the results of steps involved in the proposed technique for the forearm vein image database. We have the original forearm vein image and its corresponding histogram.
Figure 7. Original forearm vein images with its corresponding histogram.
Figure 8. Forearm vein images with its corresponding histogram after applying the CLAHE algorithm.
The equalized image after applying the CLAHE technique and its corresponding histogram are shown in Figure 8. The contrast enhancement results of the CLAHE technique provided a good illumination balance. This well-balanced illumination distribution can be clearly seen in this result.
After the execution of the CLAHE algorithm in the ROI, the result obtained is that depicted in Figure 9. The threshold given in Equation 6 was applied and proved effective in highlighting the veins. The threshold divides the image into two segments: the segments above the threshold correspond to veins, while segments below the threshold form the rest of the image region. Some undesirable pixels are visible in the result. This processing phase will be done using the proposed algorithm. To facilitate the extraction of the veins from the forearm image in Figure 9(a), a high contrast between the veins and the skin is necessary.
After detecting the vein, we need to locate the most suitable vein that medical staff can exploit for an eventual injection. Morphological Transformation which involves using a succession of dilations and erosions on the image to remove unwanted edges and close gaps. We use OpenCV functions “dilate()” and “erode()” over multiple iterations leading to the image presented in Figure 10. This action is performed by identifying the area of each vein detected. The one with the highest surface area will be considered as the most suitable vein for the injection. In Figure 10(a), the veins are shown in white; thus, these entire areas
Figure 9. (a) ROI before processing, (b) processed ROI from the CLAHE applied to the image.
Figure 10. (a) Image with veins detected from image, (b) Image acquired with selection of the most suitable vein from.
are potential locations for an eventual future injection. From the figure, it can be seen that all sharp edges are maintained after processing the images using CLAHE. Figure 10 (b) shows the most suitable vein for this acquired image.
6.3. Evaluation Method
This study used accuracy as comparative criteria. Accuracy determines the number of accurately recognized predictions; the formula is provided in Equation (7).
(7)
where T is the correct number of recognition and F is the number of identification errors.
In this work, we compare various methods for vein imaging and highlight their limitations in Table 1. As illustrated, most methods are constrained by high costs and the need for specialized, hospital-based equipment, which limits their portability and real-time capabilities. Additionally, many of these approaches struggle with adaptability to diverse skin tones, impacting their overall versatility.
Many researchers have applied the CLAHE method for vein detection as it delivers exceptional results in vein imaging. Our work stands out for its cost-effectiveness and portability, using a Raspberry Pi setup that makes vein detection
Table 1. Comparison with existing state‑of‑the‑art model.
Reference/
Author(s) |
Method |
Cost |
Accuracy |
Portability |
Skin Tone Adaptability |
Real-time Capabilities |
Miharu M.
et al. (2023) |
Ultrasound imaging for vein diameter measurement |
High |
High (Precision) |
Low (Hospital equipment) |
Moderate |
Limited |
Mendoza E. & Lattimer C.R. (2023) |
Doppler ultrasound for vein disease diagnosis |
High |
High (Precision) |
Low (Hospital equipment) |
Moderate |
Limited |
Peter Kupo
et al. (2003) |
Ultrasound guidance for venous access |
High |
N/A |
Low (Hospital equipment) |
Moderate |
Limited |
Gunawan
et al. (2020) |
NIR imaging, high boost filter for image segmentation |
Moderate |
84.62% |
Moderate |
Limited (Requires optimization) |
Limited |
Hamza M.
et al. (2023) |
Hyperspectral imaging with index images |
High |
90% |
Low (Large equipment) |
Moderate |
Limited |
This work (2024) |
Infrared imaging using CLAHE and Raspberry Pi setup |
Low |
83.25% |
High (Portable) |
High (Optimized for diverse skin tones) |
Promising (Portable, fast response) |
Yildiz & Boyraz (2019) |
Raspberry Pi-based vein imaging with CLAHE |
Low |
85% |
High (Portable) |
Moderate |
Limited |
accessible in low-resource settings. With an accuracy of 83.25%, the system is optimized for diverse skin tones, something many other methods struggle with. Unlike more expensive equipment, this approach offers a low-cost, portable, and potentially real-time solution, making it a valuable tool for medical staff, especially in emergency and low-income setting.
6.4. Discussions
From the acquired images, we note that superficial veins differ from deep veins in terms of their clarity. The information obtained from veins with large diameters near the surface of the skin helps greatly in understanding the relationship between vein diameter and contrast. In [30], Witting et al. showed a linear relationship between the diameter of the vein and its depth. The results of this study demonstrate the feasibility and effectiveness of using a Raspberry Pi-based system for the automatic detection and characterization of human veins using infrared (IR) image processing. The combination of Python programming and the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm proved instrumental in enhancing vein visibility, particularly in challenging imaging conditions where traditional methods often struggle. The application of the CLAHE algorithm significantly improved the contrast of IR images, allowing for clearer distinction between vein structures and surrounding tissues. This enhancement was particularly evident in scenarios with low lighting or varying skin tones, where traditional histogram equalization methods may fail to adequately highlight vein patterns [26]. The system demonstrated a high accuracy in detecting veins, with precise localization and minimal false positives. This was corroborated by quantitative analysis, which showed improved performance metrics compared to baseline methods without CLAHE enhancement [24].
The Raspberry Pi hardware, despite its limited processing power compared to more sophisticated computing systems, successfully handled the image processing tasks in a reasonable timeframe. The system’s performance underscores the potential of using low-cost [5], readily available hardware for practical applications in medical and security fields. However, the processing speed, while sufficient for offline analysis, may need optimization for real-time applications. The Python programming environment facilitated rapid development and testing of the algorithms, demonstrating the flexibility and accessibility of open-source software in prototyping and research.
Despite the success of the approach, several challenges were noted. The system’s sensitivity to environmental factors, such as ambient light and temperature variations, was observed, necessitating careful calibration for consistent results. Additionally, while the CLAHE algorithm effectively improved image contrast, its application needs to be carefully parameterized to avoid over-enhancement, which could lead to artifacts or false vein detections. The limited resolution of the IR camera used in conjunction with the Raspberry Pi also posed challenges in detecting finer vein details, suggesting that higher-resolution imaging sensors could further improve the system’s performance.
When compared with existing vein detection systems [7] [11] [16] and [27], particularly those utilizing more advanced and expensive hardware, the Raspberry Pi-based system showed competitive results in terms of accuracy and reliability. However, it is recognized that the system’s simplicity and affordability come with trade-offs in processing speed and resolution. Nonetheless, the portability and cost-effectiveness of the proposed solution make it highly attractive for specific applications, particularly in resource-limited settings. Future improvements could focus on enhancing the system’s robustness to varying environmental conditions and optimizing the image processing pipeline for real-time applications. Exploring the integration of machine learning algorithms for adaptive vein detection and characterization could further increase accuracy and adaptability. Additionally, expanding the system’s functionality to include multi-spectral imaging could provide more comprehensive vein analysis and broader application potential.
7. Conclusion
In this study, we successfully developed a low-cost and efficient system for the automatic detection and characterization of human veins using infrared image processing, implemented on Raspberry Pi hardware. By leveraging Python programming and the Contrast Limited Adaptive Histogram Equalization (CLAHE) algorithm, the system effectively enhanced the visibility of vein structures in infrared images, even under challenging conditions. Experimental results demonstrated that the system could reliably identify vein patterns, with a performance comparable to more expensive, specialized hardware solutions. Overall, this work highlights the potential of combining affordable hardware, open-source software, and advanced image processing techniques to create practical and scalable solutions for vein detection. Ideally, the database should be enlarged for further research. Since vein and skin alter with age, we plan to conduct similar experiments using large volume dataset that considers a balanced patient’s skin color, age, and gender composition. The vein detection results could be validated and expanded when more data are included. Deep learning techniques, especially Convolutional Neural Networks (CNNs) can also be investigated in future works. These models can learn complex patterns and reduce the dependency on manual feature extraction, making the process more efficient and accurate.