A chronic disease which requires frequent venous puncture is hemophilia. In the blood clotting chain, one or more essential enzymes are missing or build in a non-working way due to DNA corruption. This can cause severe bleeding into joints, muscles or inner organs and is potentially live threatening if the rest activity of the clotting factors is below a few percent. Today, most of the clotting factors can be artificially synthesized through biomedical engineering (cell cultures with a changed DNA  produce them), but they still have to be administered externally – injected into the blood stream by venous puncture. Venous blood vessels used for medication are not always easy to recognize and if the needle is not secure in the vein, it must be punctured again at another point. Here our project comes into play: Using NIR (near infrared) Illumination and real-time image processing, we can make the veins more visible, allowing easier Access, less pain and more confidence for medical personell and patients.

The veins are illuminated with IR light (950nm) and the back scattering is captured by the Raspberry Camera (the one without the IR-filter). You can use old analogue film tape as a filter to block visible light and let only pass IR- light. The camera picture is processed in several stages to get an improved distribution of light and dark parts of the image (multistage local adaptive histogram equalization). The reason to use near IR illumination lies in the optical properties of human skin and in the absorbance spectrum of Hämoglobin. 

After several tests (with IR light but also with thermography and different visual wavelength) we we first developed two prototypes for computer-assisted venous localization. One uses a 3d printed case for the Pi and a 7 inch Screen, the other is an add-on module for the Pitop CEED. With these steps we moved the development away from breadboards and proof-of-concept stages to concentrate more on image quality and user handling. Both differ, too, regarding to the camera system used – one works with the PiCAM, the other with a modified webcam. Both have their own pros and cons…

The Raspberry PiCam can be used without further modifications. However, this camera offers only a fixed focus and cannot adjust to the image scene automatically (only brightness etc.).

Another possibility is the modification of a webcam – removing the IR blocking filter. It is a bit tricky, but we have been able to use such a camera from my previous research project (“eye controlled wheelchair”).

The Results:

Figure 9: Results of the filter stages

At the beginning of the program, the graphical user interface is constructed, in which, in addition to the converted video stream, sliders are shown for parameters like Brightness and filter adjustments. In a continuous loop, single images are read by the camera and the filters are applied.

In the first picture, the imported camera image is visible - the vein is already visible in the infrared light, as well as the cannula, which is simulated for the purpose of the puncture. Fig. 2 shows the result of the gray scale conversion since no color information is required and the data needed can be reduced to one third. The next step is to adjust the brightness distribution with an openCV filter. The result is a much clearer visual representation in Fig. 3. The next picture shows the result of the manual filter setting, in which brightness information below and above the threshold value is discarded and the range of brightness is also stretched over the entire range (0-255) from the selected range. The following filter converts the gray scale image into a false color image in which the relevant information is not contained in the brightness but in the color profile. As a result of the discussion with medical professionals, we have installed the last filter stage in which a depicted arm or a hand is marked and "cut out" in the video image in order to be available for further analysis. In this image section we want to automatically recognize veins and mark them by means of the darker structures they form. The cutting is done with the help of masking, the discarded image is black. We have applied this mask to the input image, in order to be able to work with the original values (gray image of veins) only in this area. We search for contours - contiguous areas with similar brightness, around which a wrapping is formed in a further step, so that extraction is possible. These results are drawn into the input image at the end of the program loop, so they can also be seen as green and red lines.

At that stage we discussed our development with the heads of Department for Haemostaseology in Berlin’s Comprehensive Care Center (Vivantes) as well as with the Comprehensive Care Center in Duisburg. In Duisburg they even have a professional mobile vein detection System – for about 4000€, while our System can be build for about 100€.

We were literally shocked to see that the image quality is nearly identical, but the professional System uses a red laser to project the Image back onto the patient’s skin…

Coming back to chronicle diseases like hemophilia, our System can help encouraging patients who are learning to administer the medicine themselves (called home treatment). Especially young children between 7 and 11 learn how to puncture their veins to give themselves the live-saving clottering factors so they become more independent.

Having had only high end and high priced Systems so far, no one has thought about giving a vein identification system to people who need to inject medicine to their veins, simply because of the tremendous costs of professional devices… In the picture you can see the professional one, it projects a red laser image and where the veins are located, it simply does not display anything (no light = dark – there are your veins!) But with our project the veins are at least as good to see.

Finally we tried to reduce costs and complexity even more – and we removed the screen in favor to stream the Image to a tablet or smartphone. This reduces cost and build size and you hardly need to solder…it should be easy to rebuild and adjust to personal needs. All you have to do is to scan a QR Code and the image is displayed on your mobile device (4th stage / 4th build log). As everything is made publically available under the CC license, you are free to adjust and improve the project yourself! You could even add a feature to stream the process of vein puncture to your physician, if you would like to have immediate feedback.