A novel low-cost design of a digital infrared pupillometer using a web camera

Peyman Mirtaheri

Faculty of Engineering, Oslo University College, P.O.Box4 St. Olavs plass, N-0130 Oslo, Norway

Abstract

Pupillometry has long been used in a research setting to study the autonomic nervous system, drug metabolism, pain responses, psychology, fatigue, and sleep disorders. Pupil size and movement can be measured by either infrared videography or computerized pupillometry. Advances in infrared videography and computerized pupillometry have enabled its use in the clinical realm. The existing instruments on the market are either too large to be a handheld instrument, or expensive. Since these instruments are generally very expensive, it is unfortunately not available to health care services with lower budgets. In this paper, we have implemented a pupillometer based on a modified low cost webcam and an electronic circuit to control few light emitting diodes. In the current system, there are three infrared light diodes (peak wavelenght=850nm) and three multicolor diodes that have peak wavelengths at 627, 565 and 430 nm, respectively. A Labview vision system was applied in order to measure the pupil size based on the infrared pictures. The results show that the system is able to measure the pupil size both at scotopic condition and while stimuli with color LEDÔ€™s occur. This instrument is built with a very modest budget and can be suggested to institutes and services that need such medical instrument and yet have limited financial resources.

1. Introduction

A pupillometer is a device used for accurate measurement of a patient's pupils which can be used in many different applications (Mantry, Banerjee et al. 2005). Pupillometry has long been used in a research setting to study the autonomic nervous system, drug metabolism, pain responses, psychology, fatigue, and sleep disorders.

Pupillometer examinations are frequently conducted on those undergoing physical exams to become firemen, emergency workers, or policemen. The reactions of the pupil can, of course, suggest the use of narcotics, especially when the pupil remains less reactive and small. The pupillometer may also suggest early symptoms of progressive joint or tissue disorders, which would disqualify one to serve as an emergency or law enforcement worker. Another application is that the pupil diameter is recognized as one of the limiting factors for visual outcome in cataract and refractive surgery (Verdon, Bullimore et al. 1996).

Pupil size and movement can be measured by either infrared videography or computerized pupillometry. The advantage of infrared videography is its possibility to measure the pupil size without any background light while its disadvantage is its low resolution picture quality. The advantage of videography and computerized pupillometery is the quality of pictures with much higher resolution, while the system functions with a background light and therefore a fully scotopic conditions may be difficult to achieve(Schnitzler, Baumeister et al. 2000). Such a system has been attempted to be modified with low price camera systems(Patil, Gale et al. 2007), however it still suffers from the high background light and non-scotopic conditions. Most of the available instruments on the market are either as table instruments or handheld instrument with the disadvantage of monocular testing of only one eye while the other eye has to be occluded.

Considering the fact that, only health care services with solid economy can supply these tools to their patientÔ€™s groups. In practice, it would mean that this form of technology would only be available to a certain group of patients which again might be in contradiction of the universal design definition and spirit. By designing an instrument that is easy to be manufactured in addition to be less expensive, it would make the instrument also available for medical systems with lower budgets.

In short, there is a need for a pupillometer, which can measure pupil diameter while having fairly good accuracy, being handheld with a lower price than the existing instruments.

In this paper, we have suggested an infrared based pupillometer instrument by using a modified low-cost webcam and few light emitting diodes (LEDs) which are controlled by the Labview computer program.

2. Pupillometery instrument

2.1 Resolution of the web camera and its modifications

In order to find out the best camera resolution needed in this application, small dots with different diameters was printed on A4 sheets by an inject printer (Canon Pixma iP2600). The diameter of these dots was then measured by a microscope (Olympus, GX71), which had a digital camera (Olympus, DP71), and a picture analyzing software. The camera could be adjusted to resolutions as high as 4080x3072 pixels (12.5Mpixel) and as low as 640x480 pixels.

Diameter of small dots printed by an inkjet printer on an A4 sheet was measured by a microscope.

Figure 1. Diameter of small dots printed by an inkjet printer on an A4 sheet was measured by a microscope.

Moreover, the diameter of the small dots with different photographical resolutions was analyzed by using the Labview Vision system program. What is considered Ô€˜normal' pupil size varies of course with age and gender. The pupil gets smaller with age, and men usually have smaller pupils than women of the same age. Studies show that 67% of refractive surgery patients' pupils at scotopic condition are between 5 to 7 millimeters in diameter (Bar, Boettger et al. 2005). An uncertainty of about 140?m in the analysis of pupil diameter was chosen, which represented about 2% error of the largest expected pupil size.

Resolution with  a) 640x480  b) 1280x960  c)1600x1200

Figure 2. resolution with a) 640x480 b) 1280x960 c)1600x1200.

Based on the requirements for the measurements error and analysis of the microscope camera in figure 2, a webcam with a resolution of 1280x960 pixels would satisfy the criteria.

A USB based webcam (iMicro IM210) with resolution of 1280x960 (1.3Megapixels) was carefully opened and the lens connected to the camera chip was separated. The IR filter which usually is attached at the top of the camera chip was carefully removed by using a scalpel. A piece of developed 35mm film with an ISO100 was cut into the same dimension as the filter and placed on the chip while the lens was re-assembled into its place again. By holding a TV remote control in a distance of about 4 cm, it was possible to adjust the lens in order to achieve an optimal focus.

2.2 Light source for camera and stimuli of the eye

As the pupil light reflex (PLR) does not react to light within infrared (IR) spectrum (Wachler and Krueger 1999), using infrared light LEDÔ€™s (light emitting diodes) as the light source for the camera is advantageous for pupil size measurements without background light. However, the placement of the LEDÔ€™s with regards to the camera lens has to be carefully calculated. If the LEDs are placed close to the center of the lens, a reflection of the IR light would make the analysis of pupil diameter very difficult (see figure 3).

Showing the reflection of IR light in the eye where the LED is placed at the same distance from the eye surface as the distance to the lens of the camera.

Figure 3. Showing the reflection of IR light in the eye where the LED is placed at the same distance from the eye surface as the distance to the lens of the camera.

Three light diodes (Everlight, HIR204/H0) with a light wave of 850nm and a viewing angle of 60┬░ were chosen. The LEDÔ€™s were placed around the camera lens with a distance of 1.5cm. This means that the distance of the LED had to be at least 2.6 cm if the light beam should not directly reflect back to the camera. A distance of 3.6 cm was chosen in order to make sure that the reflection of IR light would not interfere with the picture analysis in Labview Vision systems.

Three light diodes (Everlight, HIR204/H0) with a light wave of 850nm and a viewing angle of 60┬░ were chosen. The LEDÔ€™s were placed around the camera lens with a distance of 1.5cm. This means that the distance of the LED had to be at least 2.6 cm if the light beam should not directly reflect back to the camera. A distance of 3.6 cm was chosen in order to make sure that the reflection of IR light would not interfere with the picture analysis in Labview Vision systems.

Three RGB light emitting diodes (Kingbright, KDA0 198) were also placed in the same distance as the IR LEDs. These diodes contain blue, red and green light chips in one package. The wavelength peak of red, green, and blue are 627nm, 565nm, and 430nm, respectively. There is a slight displacement from the center axis of the chip which may result into a slight different beam angles. However, this is very small changes within the chosen distance and therefore its influence was ignored in this study. When all chips were switched simultaneously, the LED would produce white color for stimulating eye within a broad visual spectrum range.

2.3 Setup of camera and the electronic

Since the light stimuli and camera activation had to be out of phase, a timing module was needed. In order to handle the timing of the system as easy as possible, we applied a USB6008 unit from national instruments.

The unit was programmed as a sub module in the Labview program which was handling an activation sequence in order to light up the LEDÔ€™s with a given modulation frequency. The program was also designed to calculate and place the timing of the camera and IR LEDÔ€™s activation between the light stimuli sequences. The advantage of such a solution is that we can make precise measurements with small time delays after the light stimuli; however the disadvantage is that the bandwidth of the light modulation decreases because the chosen web camera in this study was not fast enough to make several pictures within the higher modulation frequencies than 50Hz. When modulation frequency is selected to be lower than 30Hz, the program could take an average of five pictures and calculate the pupil diameter with a standard deviation value.

The circuit diagram shown in figure 4 was designed to activate the light diodes with a few external reference signals that were controlled by our Labview program from USB6008 unit. In order to simplify the circuit, we chose two multiplexers to handle the activation of light diodes with a sequential timing

The circuit diagram for controlling the light emitting diodes.

Figure 4. The circuit diagram for controlling the light emitting diodes.

Shows a) the de-assembled welding goggles and b) the camera and electronic inside a black plastic cover is mounted on the welding goggles.

Figure 5. Shows a) the de-assembled welding goggles and b) the camera and electronic inside a black plastic cover is mounted on the welding goggles.

To place the light diodes and the electronic in a compact assembly, an old welding goggle (Norweld,USA) was chosen for this solution. Due to improvement of ambient light influence, all glasses and air filters at the front and the sides of the goggle were carefully removed (see figure 5a) and the built electronic circuit board with the webcam was mounted in place with a black plastic cover on top (see figure 5b). The only disadvantage of this solution was that the goggle had to be placed on the face of the subject as tight as possible in order to minimize any influence of the ambient light. To make the project as simple as possible, we only made the system with one stimulation and measuring unit on right eye. However, it is fully possible to add another unit on the goggle to enable measurements on both eyes.

2.4 Measuring pupil diameter

The assembled system was tested on a 25 years old subject who gave his written agreement for this test. The test subject wore the goggle for about 15 seconds before the measurements started and reference pupil diameter was measured. A stimulus started thereafter with 38% of total light intensity of the blue color (430nm) which responded to about 5.6mcd. The stimulus time was about 10sec with a modulation frequency of 25Hz. Then we stimulated the subject with 100% total light intensity which is equal to 20mcd. Figure 6. shows the reaction of pupil due to the light stimulation.

Eye stimulation within 10 seconds with blue color (430nm) and a modulation frequency of 25Hz at (a) 5.6 and (b) 20mcd each with its respected control at scotopic condition .

Figure 6. Eye stimulation within 10 seconds with blue color (430nm) and a modulation frequency of 25Hz at (a) 5.6 and (b) 20mcd each with its respected control at scotopic condition .

The pubil size at both conditions had an average value of 4.4┬▒0.3mm. When stimuli of 5.6mcd was applied for a duration of 10 seconds, the pupil size changed to 3.8┬▒0.2mm. The stimuli of 20mcd resulted to a diameter of 2.2┬▒0.1mm.

3. Discussions and conclusions

Galileo was probably the first to document measurement of pupil diameter and almost 300 years later, the significance of this in medical applications such as refractive surgery has been realized in recent years (Helgesen, Hjortdal et al. 2004).

Human pupils are difficult to measure in all conditions of light due to pupillary unrest and because of dynamic constant motion. Rosen et al (Rosen, Gore et al. 2002) reported that this motion was highest under low mesopic illumination. The results from mesopic and photopic light conditions may reflect a decrease of standard deviation under scotopic and light stimuli conditions.

The monocular testing instruments may result to a larger pupil diameter (Wachler and Krueger 1999) and therefore during the measurements the patients other eye has to be occluded. This might be a rather difficult solution for fast measurements while in this goggle design both eyes are in the same environment inside the welding goggle. In addition this design facilitates the possibility of having two cameras to simultaneously measure pupil diameter at both eyes.

The results from existing devices such as Colvard pupillometer(Colvard 1998) and Nidek autoreflector (AR-700A) with the same conditions show a pupil diameter of about 4.8┬▒0.9mm and 3.9┬▒0.8mm(Wachler and Krueger 1999; Mantry, Banerjee et al. 2005). With the instrument built in this study, it was possible to measure the pupil size around 4.4┬▒0.3mm. This may indicate that the suggested instrument has measured the pupil diameter with an error of 8% compared to those professionally made and expensive instrumentations, however the variation in measrurements for this webcam based instrument design is 1/3 of the measruements achieved by the existing instruments. The total budget for the components needed to make the suggested pupillometer was about Ô‚Č206, which compared to the price of other available instruments on the market is quite modest budget. Thus, this instrument would be suggested to institutes and services that need such medical instrument and yet have limited financial resources.

Acknowledgement

This project was partly carried out by our electrical and electronic engineering students at bachelor level. The author would like to use the opportunity to thank Jon Fredrik V├ąle, Alexander Stams├Ş og Reza Sharkanloo to contribute to this project.

References