Development of a Smartphone-based Pupillometer
Development of a Smartphone-based Pupillometer
Journal of the Optical Society of Korea. 2013. Jun, 17(3): 249-254
Copyright ©2013, Optical Society of Korea
  • Received : February 01, 2013
  • Accepted : April 19, 2013
  • Published : June 25, 2013
Export by style
Cited by
About the Authors
Kim Tae-Hoon
Jong-In Youn

In ophthalmology, a pupillometer, a device to measure the diameter of the pupil of the eye, can provide information on the function of the autonomic nervous system. The current pupillometers on the market are either too large to be a handheld instrument, or relatively expensive. In this study, a pupillometer based on a smartphone was designed. Both white and infrared LEDs and a 3M pixel camera of a smartphone were applied for the visual stimuli to an eye and for the acquisition of the eye images, respectively. Contrary to the existing method of pupil measurement that usually observe the variation of pupil diameter, the proposed algorithm in this study was applied to calculate the constriction ratio of the pupillary area in response to pupillary light reflex. The results showed that the constriction ratio of the pupillary area were all in the normal range (above 4.0) from the sixteen healthy participants. It is believed that the approach to pupil measurement used in this study is suitable for a mobile interface, and this system can be applied to clinical research, home-use healthcare, and distributed to some areas which suffer from problems like a lack of medical support.
The pupil is a tiny dark hole located in the center of the iris that regulates the amount of light coming into the eye. Greater intensity light causes the pupil to become smaller (allowing less light in), whereas lower intensity light causes the pupil to become larger (allowing more light in), a mechanism called the pupillary light reflex (PLR). The PLR is governed by the antagonistic actions of the dilator and sphincter muscles of the iris in response to environmental light. Activation of the dilator muscles which causes the pupil to dilate (i.e., mydriasis) is under sympathetic control through superior cervical ganglion controlled by EW nucleus, and the sphincter muscles cause the pupil to constrict (i.e., miosis) under parasympathetic control [1 , 2] . The pupil size for miosis and mydriasis can be measured and compared to each other. The observation of the different pupil size can allow non-invasive diagnosis of many different diseases such as Parkinson’s disease, autism spectrum disorder and diabetes [3 - 6] .
Traditionally the pupil size has been measured by using specially designed millimeter rulers or gauges and a method called the Rosenbaum card, in which the horizontal pupil diameter is matched by the examiner with a series of increasing half-circle diameters, but all the manual methods of pupil measurement are not quantitative and cannot be used in dim light [7 , 8] . Recently, a hand-held Colvard pupillometer, infrared videography and computerized pupillometry have been developed to control the light stimulus and record pupillary movements. These automatic devices allow clinicians to quickly measure the pupil diameter at any illumination level and the infrared videography is capable of describing the dynamics of pupil function. However, these digital devices are costly, big, and only available in the hospital for use by trained examiners [8 - 11] .
In this study, the prototype of the smartphone-based pupillometer was designed with an optical apparatus attached to the smartphone’s camera. This prototype system is small to handle and can not only be easily manufactured at low cost but also distributed to many places such as developing countries, outlying regions, general clinics and private spaces as a home-use healthcare device. Also this study describes a simple method for calculating the constriction ratio of the pupillary area in response to PLR through the proposed algorithm for pupil analysis. This is a different analysis compared with existing pupillometers which usually measure the variation of the pupil diameter, and very suitable for the smartphone application that provides built-in functionality for detecting an object on still images [10 - 12] .
Sixteen healthy college students (Male 7, Female 9) participated in this study. The average age of the participants was 21.6 ± 1.6 yrs. and written informed consent was obtained from all participants. All subjects were Asians and they had dark brown colored irises. During the experiments, the participants remained for 3 minutes in a quiet room (< 0.1 lux) in order to approach the maximum darkness area. Each subject was instructed to look into the device and fixed on the camera lens at a virtual distance of 6 cm.
The prototype system was set with a smartphone (KM-S120, KT Tech, Korea) which had a 3-megapixel main camera on the back panel ( Fig. 1 ). It consisted of a main body, 4 infrared LEDs, 1 white LED, an infrared cut-off filter (IR720, Horusbennu, Korea) and a microcontroller (ATmega 328 based Arduino Uno board). The main body was 6 cm length and 4 cm in diameter. It provided tight occlusion around the subject’s eye so that pupil size could not be influenced by any ambient light. The presence of the infrared LEDs (λ max = 850 nm) allowed taking the mydriasis image under the dark condition. The infrared light does not affect pupil size but is recognized by the charge-coupled device camera in the pupillometer system. The white LED (λ max = 570 nm) shone on the eye (4 lux) was used to cause miosis, and it was placed at a distance of 2 cm in front of the eye. The stimulus duration was less than a few seconds. In front of the camera, the infrared cut-off filter was placed to pass only wavelengths that correspond to the infrared emission, thus the reflected light emanating from the white LED was blocked. Those LEDs were powered by the Arduino microcontroller, an open-source microcontroller based on the ATmega328 that can be simply connected to a computer with a Universal Series Bus (USB) cable to get started.
Figure 2 shows the whole process chart of this study. The raw eye images were processed by the proposed algorithm which extracts only the pupil region, and then the constriction ratio of the pupillary area in response to PLR was calculated and compared to the standard ratio for diagnosis. In this pilot study, all the eye images were transferred to a laptop computer through the smartphone and processed on MATLAB to verify the effectiveness of the proposed algorithm.
PPT Slide
Lager Image
The 3D model of the pupillometer based on a smartphone (left) and the configuration of the measurement system based on the prototype design (right). FIG.
PPT Slide
Lager Image
The flow chart of the whole process including image processing in this study.
There were three major procedures in image processing involving pre-processing, segmentation, and morphological processing. As pre-processing, both the contrast enhancement process and the noise reduction operation by the median filter were applied to the raw eye images. The contrast enhancement was performed to distinguish the regions between the pupil and iris by intensity mapping, which is used to stretch out the intensity values to a wider range. In this operation, both the lowest and highest intensity values were mapped to bottom and top, respectively, while the values between low and high were mapped linearly to values between bottom and top. The main objective of the filtering procedure was to reduce and eliminate possible noise that appeared during eye image acquisition via optical sensors. The rationale behind adaptation of the median filter was used for the important property of edge preserving smoothing that does not shift boundaries [13] .
The pre-processed eye image and the grayscale histogram of this image are shown in Fig. 3 (a) and Fig. 3 (b), respectively. The left side on the histogram was mainly due to the contribution of pupillary area pixels and this part was referred to as a standard point for the threshold. The middle and right sides represent the iris and reflected light
PPT Slide
Lager Image
(a) The contrast enhanced image after pre-processing. (b) The grayscale histogram of the contrast enhanced image (Figure 3a). The left side on the histogram is considered as a pupil region and the middle and right side represent the iris and reflected light regions, respectively.
regions, respectively. The segmentation procedure was then performed by the thresholding operation to convert the contrast-enhanced image from grayscale into a binary image, and thus the pupil region was roughly separated from its background. To completely isolate the pupil region, morphological operations (erosion and dilation) were performed as a following step. These operations not only eliminate unnecessary parts but fill in holes and small gaps on the pupil region. In consequence, the remaining unnecessary parts in the processed images were effectively removed while preserving the pupil region.
The processed images corresponding to the dilated and constricted pupils are shown in Fig. 4 . Although the smartphone’s camera used in this study featured relatively low resolution, and there occurred some noise to the raw eye images, the pre-processing operation efficiently enhanced contrast of the eye images and made edges clear. Thus the pupil region that had the lowest pixel values in the eye images could be separated with intact shape by the segmentation and morphological processes.
From the isolated pupil region, the number of pixels that correspond to the pupillary area was returned as a positive integer value. This value was equated with the size of the pupil region and used for calculating the constriction ratio of the pupillary area in response to PLR. Unlike measuring the pupil diameter, the analyzing method in this study concerned the whole size of the pupillary area. There are some advantages when trying to figure out the variation rate of pupil size. It is explained that the rate of change of the pupillary area was larger than the rate of change of the pupil diameter according to mathematical geometric formulas [14] . It means that the different pupil size between miosis and mydriasis could be much more clearly observed when
PPT Slide
Lager Image
The progress of extracting the pupil region and the number of pixels corresponding to pupillary area is indicated at the end of the progress.
comparing the variation of area to the variation of diameter. In addition, the pupil is not a perfect circle. Thus, by using the existing pupillometers, the measurement of the pupil diameter could be dependent on a reference point by which the pupil diameter is measured [10] . It can be expected that measurement errors among the various existing devices including digital infrared pupillometers could occur. However, the pixel-number based method applied in this study clearly extracted the pupil region and it was capable of calculating the constriction ratio of the pupillary area regardless of any reference points. One required condition is that the pupil has to be placed within the boundary of camera view when the eye image is taken.
Even if the infrared videography can also provide dynamic analysis including constriction velocity, most studies on pupil analysis in ophthalmology and neuroscience have still been focused on the variation of pupil size [15 - 21] . This is because the difference of pupil size (diameter or area) in response to PLR directly reflects the state of the autonomic nervous system resulting from both the sympathetic and parasympathetic influences that can be used for non-invasive diagnosis. Therefore, the prototype system of the smartphone based pupillometer can be used to efficiently observe the variation of the pupil size in terms of pupillary area.
To evaluate the segmentation accuracy, five randomly selected eye images taken with the prototype system were employed. Each of these images was processed by both the proposed algorithm on MATLAB and Adobe Photoshop 7.0 (Adobe Systems Inc., San Jose, California, USA) operation with manual segmentation. In Photoshop, the region of interest can be easily selected by using the brush tool with a high precision because it was attributed to the manual work. Thus, much research including pupil analysis utilized this simple method for evaluating their results [22 , 23] . When the results of the proposed algorithm were compared with the results of the Photoshop operation, the average accuracy rate was 97.7 ± 1.3%. The maximum and minimum accuracy rate was 99.3% and 96.1%, respectively. This was an acceptable rate when comparing to the results of other studies (generally above 95%) in terms of pupil extraction [24] .
The distance change between the pupil and the smartphone’s camera in each measurement step (dilated and constricted pupil) was considered for the system performance evaluation. As the distance between the pupil and the camera varies in each measurement, the number of pixels corresponding to pupillary area becomes changes linearly, which can cause errors. To compensate these variations, the correction coefficient referred to the iris size was multiplied by the results of the constriction ratio of the pupillary area, as shown below:
PPT Slide
Lager Image
where ic and id are the number of pixels for the iris area corresponding to the dilated and constricted eyes, respectively. All the units in the equation are the number of pixels (px).
From the randomly selected six sets of images, the corrected ratios were calculated and compared to the constriction ratio of the pupillary area without using the correction coefficient. The iris region was cropped in fixed 1 by 1 aspect ratio and the results showed that the average error rate was 1.4 ± 0.6% which is equivalent to 3 mm distance variation between the dilated and constricted conditions. Although individual face shape may vary with different participants, the applied apparatus body that tightly fit with the circumocular region limited the subject’s movement.
Figure 5 shows the results of the constriction ratio of pupillary area from 16 healthy participants. All participants had no known diseases which could affect the results and only the right eye was measured. The average constriction ratio of pupillary area in response to PLR was 4.89 ± 0.49 and the maximum and minimum ratios were 5.84 and 4.19, respectively. There was no significant difference between male and female. In this study, a standard ratio value was set for 4.0 because the normal constriction ratio of pupillary area in response to PLR is above 4.0 [25 , 26] .
Since the ultimate goal of the development of the smartphone based pupillometer is to implement the whole process including
PPT Slide
Lager Image
The results of the constriction ratio of the pupillary area in response to PLR from sixteen healthy subjects in twenties.
image processing into the Android mobile operating system, the Android application has been also programmed as depicted in Fig. 6 . The Android platform is very suitable for image processing researching and provides higher flexibility to third parties on development and licensing issues, compared to the closed approach of the iOS platform [27] . The user can take a picture of the eye or load an existing image from the photo library in a smartphone. The image is then either processed or analyzed through the proposed algorithm on the phone, and the results of the constriction ratio of the pupillary area are displayed on the screen. The whole process was not well-organized yet, so the application is still under-developed.
From the results, the pupillometer system based on a smartphone is likely to be a good candidate for pupil analysis. In addition, the accuracy of the proposed algorithm for pupil localization has proved to be reliable with relatively high precision. However, the actual performance of this system should be compared with existing pupillometers since the different diseases may show similar variations in the constriction ratio. It means that the smartphone-based pupillometer needs to be specialized in certain diseases for clinical implementation. Since only healthy humans were recruited in this study, the results only reflected the normal state. It means that abundant data on the constriction ratio from abnormal conditions would be required for utilizing this system in clinical purposes to precisely distinguish abnormal conditions from the normal condition by observing the variation of the pupillary area in response to PLR. Therefore, more subjects with certain diseases which can affect the pupil size will be enrolled to establish a database about the constriction ratio of the pupillary area based on the number of pixels in the future study.
PPT Slide
Lager Image
The interface of the menu based Android application. (a) The splash screen and (b) the menu in this application. (c) The eye image is processed through the proposed algorithm in the processing tab. (d) The results of the constriction ratio of the pupillary area are displayed in the feedback tab.
In this pilot study, the constriction ratio of pupillary area in response to PLR was observed by using the prototype system of the smartphone based pupillometer, and the proposed algorithm was applied to extract the pupil region from the raw eye images taken by the smartphone’s camera. The performance of the proposed algorithm was evaluated by the Photoshop processed results, and the average accuracy rate was 97.7 ± 1.3% which can be considered as a relatively high precision. The results from the sixteen healthy subjects showed that the average constriction ratio of pupillary area in response to PLR was 4.89 ± 0.49, and no one had the constriction ratio under 4.0 which is the standard value for differentiating normal or abnormal conditions. It is expected that the smartphone-based pupillometer could be easily manufactured and distributed to many places such as developing countries, outlying regions, general clinics and private spaces such as a home at low cost. Future studies will assess the applicability and accuracy of this pupillometer based on a smartphone for non-invasive diagnosis.
This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2010-0008977)
Barbur J. L. (2004) “Learning from the pupil - studies of basic mechanisms and clinical applications” The Visual Neurosciences 1 641 - 656
Santis A. D. , Iacovelllo D. (2006) “Optimal segmentation of pupillometric images for estimating pupil shape parameters” Comput. Methods Programs Biomed. 84 174 - 187    DOI : 10.1016/j.cmpb.2006.07.005
Granholm E. , Morris S. , Galasko D. , Shults C. , Rogers E. , Vukov B. (2003) “Tropicamide effects on pupil size and pupillary light reflexes in Alzheimer’s and Parkinson’s disease” Int. J. Psychophysiol. 47 95 - 115    DOI : 10.1016/S0167-8760(02)00122-8
Sugiyama T. , Utsumi T. (1990) “Pupillary dynamics in Parkinson’s disease” Neuroophthalmology 10 1 - 7    DOI : 10.3109/01658109008997254
Martineau J. , Hernandez N. , Hiebel L. , Roche L. , Metzger A. , Bonnet-Brilhault F. (2011) “Can pupil size and pupil responses during visual scanning contribute to the diagnosis of autism spectrum disorder in children?” Journal of Psychiatric Research 45 1077 - 1082    DOI : 10.1016/j.jpsychires.2011.01.008
Pittasch D. , Lobmann R. , Behrens-Baumann W. , Lehnert H. (2002) “Pupil signs of sympathetic autonomic neuropathy in patients with type 1 diabetes” Diabetes Care 25 1545 - 1550    DOI : 10.2337/diacare.25.9.1545
Wachler B. S. B. , Krueger R. R. (1999). “Agreement and repeatability of infrared pupillometry and comparison method” Ophthalmology 106 319 - 323    DOI : 10.1016/S0161-6420(99)90070-2
Twa M. D. , Bailey M. D. , Hayes J. , Bullimore M. (2004) “Estimation of pupil size by digital photography” J. Cataract Refract. Surg. 30 381 - 389    DOI : 10.1016/S0886-3350(03)00619-9
Schnitzler E. M. , Baumeister M. , Kohnen T. (2000) “Scotopic measurement of normal pupils - colvard versus video vision analyzer infrared pupillometer” J. Cataract Refract. Surg. 26 859 - 866    DOI : 10.1016/S0886-3350(00)00486-7
Pop M. , Payette Y. , Santoriello E. (2002) “Comparison of the pupil card and pupillometer in measuring pupil size” J. Cataract Refract. Surg. 28 283 - 288    DOI : 10.1016/S0886-3350(01)01222-6
Wilhelm H. , Wilhelm B. (2003) “Clinical applications of pupillography” Journal of Neuro-ophthalmology 23 42 - 49    DOI : 10.1097/00041327-200303000-00010
Doukas C. , Maglogiannis I. 2010 “A fast mobile face recognition system for android OS based on Eigenfaces decomposition” in Proc. Artificial Intelligence Applications and Innovations Larnaca, Cyprus Oct AICT 339 295 - 302
Koschan A. , Abidi M. 2001 “A comparison of median filter techniques for noise removal in color images” in Proc. Seventh German Workshop on Color Image Processing Erlangen, Germany 69 - 79
Jeffrey A. 1995 Handbook of Mathematical Formulas and Integrals Academic Press
Granholm E. , Morris S. , Galasko D. , Shults C. , Rogers E. , Vukov B. (2003) “Tropicamide effects on pupil size and pupillary light reflexes in Alzheimer’s and Parkinson’s disease” Int. J. Psychophysiol. 47 95 - 115    DOI : 10.1016/S0167-8760(02)00122-8
Prettyman R. , Bitsios P. , Szabadi E. (1997) “Altered pupil size and darkness and light reflexes in Alzheimer’s disease” J. Neurol. Neurosurg. Psychiatry 62 665 - 668    DOI : 10.1136/jnnp.62.6.665
Fan X. , Miles J. H. , Takahashi N. , Yao G. (2009) “Abnormal transient pupillary light reflex in individuals with autism spectrum disorders” Journal of Autism and Developmental Disorders 39 1499 - 1508    DOI : 10.1007/s10803-009-0767-7
Bergamin O. , Zimmerman M. B. , Kardon R. H. (2003) “Pupil light reflex in normal and diseased eyes: diagnosis of visual dysfunction using waveform partitioning” Ophthalmology 110 106 - 114    DOI : 10.1016/S0161-6420(02)01445-8
Pilley S. F. , Thompson H. S. (1975) “Pupillary “dilatation lag” in Horner’s syndrome” Br. J. Ophthalmol. 59 731 - 735    DOI : 10.1136/bjo.59.12.731
Karavanaki K. , Davies A. G. , Hunt L. P. , Morgan M. H. , Baum J. D. (1994) “Pupil size in diabetes” Archives of Disease in Childhood 71 511 - 515    DOI : 10.1136/adc.71.6.511
Wyatt H. J. (1995) “The form of the human pupil” Vision Research 35 2021 - 2036    DOI : 10.1016/0042-6989(94)00268-Q
Francus P. , Keimig F. , Besonen M. (2002) “An algorithm to aid varve counting and measurement from thin-sections” J. Paleolimnol. 28 283 - 286    DOI : 10.1023/A:1021624415920
Lavezzo M. M. , Schellini S. A. , Padovani C. B. , Hirai F. E. (2009) “Evaluation of pupillary diameter in preschool children” Neuro-ophthalmology 33 313 - 317    DOI : 10.3109/01658100903360346
He X. , Shi P. (2007) “A new segmentation approach for iris recognition based on hand-held capture device” Pattern Recognition 40 1326 - 1333    DOI : 10.1016/j.patcog.2006.08.009
Ko B. U. , Ryu W. Y. , Park W. C. (2011) “Pupil size in the normal Korean population according to age and illuminance” J. Korean Ophthalmol. Soc. 52 401 - 406    DOI : 10.3341/jkos.2011.52.4.401
Spector R. 1990 Clinical Methods 3rd ed. Butterworths
Pasha M. F. , Supramaniam S. , Liang K. K. , Amran M. A. , Chandra B. A. , Rajeswari M. (2012) “An android-based mobile medical image viewer and collaborative annotation: development issues and challenges” JDCTA 6 208 - 217