Implementation of Otsu’s Method in Vein Locator Devices

—In finding the position of the vein for injection process can bring any difficulty particularly for the patient who has too deep vein position under the skin. Sometimes it causes the nurses to do several injections to find the right vein position. This problem will make the patient uncomfortable. The objective of this research tries to solve that patients are scaring through modifying normal IR CCTV camera to become a biomedical device to visualize vein location on a human hand. The normal IR CCTV camera is modified by removing the IR cut filter to allow mid-infrared wavelengths. To find the vein location, a few stages must be done such as remove the background, extracting into the single color plane, reversing the image, filtering, thresholding with Otsu’s method and eroding. This system was named with Vein Scanner System (VSS), which have function look like a scanner. To utilize the scanner recording process, this research used a stepper motor that has a function to perform scanning by


I. INTRODUCTION
In a medical field such as a nurse, the injection process is the most important thing to give some treatments or medicine to the patient.The process of injection close correlated with the vein structure in the human.Every people has a unique pattern and mostly are not the same between one and other people [1].For injection purposes usually, the nurses use a vein on the hand.The vein on hand will be easily found if located not too thick under the skin surface.This condition still possible to find manually by touching of the hand surfaces or directly seen on the skin surface.Some people profoundly challenging to find their vein position which cannot be seen directly by naked eyes and nurse should rely on X-Ray or ultrasound [2] such as the obesity people.Another factor is the anxiety of the patients during needle insertion process [3].In fact, many patients get more than one time in the injection process, and it is become happen and make people uncomfortable to get medical treatment from the hospital.This condition has more challenge to solve and need a precise idea to find the way by technology touched.
Digital Image processing technology brings significant influence and high performance [4] to make a pattern and analyze the image through camera recording.Some researchers have been successfully applied to image processing in their research to utilize their research method.Such as detection of the actual stress by using image processing was successfully investigated [5].Recognizing an object that applied LSM static signs recognition using image processing [6] and also has researchers create a model for improving the performance of the image processing that brings title model-based dynamic scheduling for multicore implementation of image processing systems [4].Another researcher also applied image processing with Otsu's Thresholding in Implementation of Otsu's thresholding process based on FPGA [7].This paper presents a system of existing equipment that uses contactless in discovering the vein position through an infrared camera and combine with Otsu's method for thresholding purposes to remove the noise of the image.The InfraRed camera is generally used to visualize the object in the form of the thermal image which is similar to infrared CCTV that applied in the security system.
The objective of this research is to change the function of the infrared camera that customarily used as CCTV into a biomedical application.This camera later will be applied to detect vein pattern on human hand.This CCTV IR camera is classified in NIR (Near InfraRed) which have wavelength 750nm until 950nm.According to this specification, its makes CCTV IR camera possible to be modified as a medical application.What makes IR camera possible to be seen by eyes is the IR cut filter that leads to visible light [8], [9].Moreover, this is the thing that will be made use in this research.The pattern of the vein will be quickly discovered by using image processing system and can be seen on the screen of the monitor.
This system is also added or equipped with a platform for the CCTV IR which make the camera looks like a scanner.It means that camera will be moved by using motor stepper along with the platform.By using this platform, the system can surface the skin that wants to be analyzed automatically.In controlling process, the platform was facilitated by mini PC of the raspberry PI that processed and considers the movement of the camera through rotated of the stepper motor.In image processing process we used Open Source Computer Vision (OpenCV) that used C and C++ program pattern that most effective use of the basic structure of image processing [10], [11].
The organizer of this paper as follows, Section I explain about the introduction of the paper, Section II Material and methods that applied to get the result, Section III show the result and discussion and conclusion finally distributed in Section IV.

A. Hardware
In capturing the image, we design the camera by modified the IR CCTV capable of taking a picture automatically.Its camera movement process was designed through software in making the shape of the hardware that we want to use.This hardware was dependence on each other in taking pictures of the object that Wants to be analyzed.The hardware consists of motor stepper, Infrared, (IR) CCTV camera and Raspberry Pi.

1) Platform:
The platform mainly used to control the position of the IR CCTV camera to move forward or backward while the recording process happened.The shape of the platform designed using software aims to make it become more precisions.The dimension of this platform is 20 x 21 x 70 cm as shown in Fig. 1a.While for the belt that placed in the green color clearly shown in Fig. 1b that make camera possible to move when capturing image happened.The resolution of the platform movement distance was 0.35 mm per times, and the effective moving distance is 42 cm.Motor Stepper: In the running process of the camera, we use two-phase six wires stepper motor was used to run the belt that will move the camera while capturing the image.Typically, motor stepper has four inputs that capable used as controller position of the object that we want to control.This stepper motor as shown in Figs.2a and 2b that shows the driver circuit of the motor, where this driver capable to applied in controlling the rotation of the motor.This rotation according to the available input from the controller.The full step-driving mode was applied to drive the motor stepper and push into its maximum torque rate.In the program, it has a logic number to drive the stepper motor for full step mode as shown in Table 1.The motor must get two inputs altogether to make the motor is running.

Pulse Phase
2) Infrared(IR) CCTV Camera: Infrared (IR) CCTV Camera was the primary tool that used in capturing an image of the skin.This paper-modified camera with 1080 pi full HD and DVR widely used in capturing an image for security system become a scanner to get the image of the skin.In modified process, we remove the IR cut filter in allowing the mid-infrared wavelengths.The image from this modified camera will be processed in raspberry pi through CSI port as the interface.Those DVR and IR CCTV Camera can be seen in Fig. 3. 3) Raspberry Pi: In data processing, we used type-B of Raspberry pi that facilitated by Raspbian as the operating system, and in programming, the system uses the language python and also be equipped by an opensource library of the OpenCV for image processing program.Fig. 4 give the information about devices were connected to the raspberry pi.
In connectivity system, we used two different kinds of the interfaces that have been provided in this raspberry pi port for connecting to other devices, which are CSI port and GIPO port.CSI port was used to connect to camera and GIPO for controlling the stepper motor through the driver of the stepper motor.While to present the image is used a monitor through HDMI port available in raspberry pi.Besides using a wired monitor, this system also possible to see the result in remote desktop as well as supporting the internet connection.

4) Image Processing
Image processing or most commonly known as Digital Image Processing is one way that can be used to recognize the object through an image.In recognition process, the image will be initialized with extraction process in requiring the individual characteristic of the object that we want to know [12].From the result of the initialization, the image can be used as the representative of the object automatically.
This paper presents the image processing to observe vein position through a captured image.By using captured hand image, the system did the image processing analyzing to get the vein pattern that will be able to use as the indicator for the injection process.To analyze the image, we used OpenCV library in python and Otsu's methods for making some arithmetical function for image processing threshold approach.The image processing has some steps of the process that seen in the following block diagram in Fig. 5.The block diagram illustrates the flow of the system, where the result will be obtained through four steps that begin from capturing an image, creating mask pattern, removal background and finding the pattern of the image [13].Capturing image is the first step in image processing to get the real image that needs to be analyzed.The process of capturing image utilizes the movement of the motor stepper that can bring the camera to the appropriate position or according to the expected position.The movement position of the camera follows the commands obtained from Raspberry Pi.However, this process can make the camera not stable because of the vibration of stepper motor rotation, so the movement process for capturing image has to synchronize to prevent the image being a blur.
The mask pattern for removal background as the second step that was used to separate between background and object from noise before doing the separating process.The purpose of this process is to create mask image to eliminate noise within the background of the image.This process used to make a threshold value in the background and object of the image.The threshold is executed to change the pixel value becomes two conditions only high or low, so the background image previously has a range pixel in the grayscale image and also contain some surrounding noises such light change to the binary image.
The background removal is one of the treatment in image processing to minimalize noise of the background.The background of the image was capable of influencing the object of the image when we do the separating process.This process aims to eliminate the noise in the background of the image.There were some steps of the process in denoising of the background noise.The step was starting by masking the image source, which was the image, must be copied to the new frame that will be used as the image destination.After that, the image will be compared with the image mask.If the pixel value of the image mask equal to zero and the image source also valued zero.When the process is finished, the background pixel turns to black or the pixel value become zero.
Finding the vein pattern is for the primary purposes of this paper.The vein pattern can give cue or direction for the nurses to do the injection process that they are capable of seeing the position of injection that they have to get.In some cases that we have been mention before were the patients that have a vein that cannot directly recognize by using naked eyes such fat people were able to solve with this vein pattern.This vein pattern finder was one of the last image processing steps we use in this research to get correct position from irregular or noises pattern that produced by the shape of the bones and muscle structure [14], where this undesired blood vessel need to solve with image processing acquisition.
For detection of the pattern, this works still applied binary system with invert condition.However, the value that was below from the threshold will be considered to provide the high value indicated with white color, whereas the pixel value higher than threshold was going to produce the zero value and the output picture in this range pixel value become black.
After capturing the image from the camera, make a mask pattern for background removal, removal background, and the original object will be analyzed to find the position of the vein.For finding the position of the vein, in vein pattern finder we used a pattern to make the vein clear and easy to see by an indicator in the picture.The indicator pattern finder that applied in this paper consists of extracting the color of the image into a single-color plane, reversing image threshold by using Otsu's methods, filtering and eroding.

B. Otsu's Method
Otsu's method is an automatic technique for image processing in clustering-based on thresholding process to reduce a gray level of the image [15].After clustering process, the image will change from gray to the binary base.Otsu's provide a technique which classified the two variances of the thresholding in image processing that can represent the level of the pixel value for grayscale image [16].The range of this grayscale image can be counted by {1, 2, 3, ... L} [15], for pixel value, was represented by i that getting from and as some pixels that clearly shown in the following equation [17].
Furthermore, the equation is used to separate between background and object of the image that represents onto through a threshold value.k represented the threshold value as the in [1, .., k], and by adding the k value with 1 [k+1, …., L].The result of the threshold was coming from: According to both of these equations can minimize the variances of the pixels in the following equation: Where the weights of the and illustrate the possibilities number of two groups which isolated by a threshold value that was getting from the variances value of t, and .

III. RESULTS AND DISCUSSION
Taking hand picture was the first process in image processing approach.The Capturing image was facilitated by a platform that makes the IR CCTV camera run automatically.Also, the examining of the subject was carried out by putting the hand in a supine position on the platform, and the camera will move along to the hands.Capturing process was similar to the scanner function, where the camera will take the image from the starting point and be going to stop until the camera reaches the end of the platform, which was signed by the limited switch of the platform, was active as shown in Fig. 6.The process of capturing the image was executed for every step of motor stepper motion then the image will be transferred directly to the computer that will be used as the raw image.The raw image was still in the grayscale image and contains some noises or unexpected pixel value that caused by surrounding light of the platform while capturing process happened.In the monitor will shows the picture as shown in Fig. 7.Even though the original grayscale image from IR CCTV camera has seen the roots of blood vessel indicated by dark color on the hand image but we cannot see where the right position for doing the injection manually.This condition caused by the noises surrounding the object that capable of influent the original image.These noises must be solved by acquisition the pixel of the image through Otsu's methods where the image previously in a grayscale mode that has a range pixel was changed to become a binary image.In binary format, the image will be changed to become two conditions only, which were black and white.The black color represents the background of the image and white as the object.This process makes the image will lose the object because look like in the white color and call as the process of image mask removal as shown in Fig. 8.After doing the background removal that changes the image become two conditions black and white so the next step was doing the amalgamation between background and the object that will be a target in analysis process that shown in Fig. 9.The binary background with black color hopefully capable of removing the noise because all of the pixels in the background have been changing to zero.By using binary image mode that combined the image with the invert of the object image, we can make the vein pattern that shows the vein position in white color.As shown in Fig.Ten the image on vein pattern with the hint is white lines fitted with the original image (source image).Besides the vein pattern, the system also provides the appropriate position cue in injection process through red dot.The red dot was actively useful for nurses to help them to find the position where they have to do an injection.In this paper, this dotted line happened because of the unclear image source.From the image, the noise is still there but not too much (white dot).The examination then is carried out on the different spot or location by moving IR Camera position using a motor stepper.Exposure time is the most important thing that has to concern while moving the camera.Due to the longer exposure, time will produce brighter images.It is important to limit the exposure time to prevent motion blurring.
Fig. 11 shows vein in a different spot on hand.It consists of 4 stages; original image, background mask, an image with background removed and vein location.In this experiment, the image source sometime was affected by light intensity like shows on the 3 rd image.Most of the vein location is found even though the spot is changed.Detection of the vein by using VSS was successfully done and capable of showing the position of the vein.The system was built using modified IR CCTV camera as a scanner to take the hand picture.In image processing approach, this VSS used Otsu's method to consider threshold value of the image.The image processing was used to make the object clearer to detect the position of the vein.Also, the patients will be more comfortable due to it can reduce the possibility of repeated injection.
In the process of recording image, the system facilitated by a platform that can make the capturing picture will run automatically.The IR CCTV will start the scanning process when getting the instruction and will end the recording process when touching the limit switch on the platform.As a result, the system successfully is done by using the algorithm of image processing.

Fig. 3
Fig. 3 IR CCTV camera and DVR system

Fig. 8
Fig. 8 Mask for background removal

Fig. 9
Fig. 9 Image with background removeAfter capturing the image, mask for background removal and combine again between background and object of the image that called amalgamation process, so the next steps are changing the object becomes an inverting the binary image.

Fig. 11
Fig. 11 Vein detection in a different location IV.CONCLUSION

TABLE I THE
LOGIC NUMBER FOR THE STEPPER MOTOR