Sei sulla pagina 1di 6

DESENVOLVIMENTO DE UMA INTERFACE GRÁFICA PARA DISPOSITIVO

EMBARCADO DE PUPILOMETRIA

Gustavo C. Santos, Rafael A. da Silva, Antônio C.P Veiga, Bruna M. da Silva


E-mail: gustavocavsantos@gmail.com, rafaelaugustosilva@outlook.com, acpveiga@gmail.com, brunams@ufu.br
Universidade Federal de Uberlândia, Faculdade de Engenharia Elétrica, Uberlândia-MG.

Resumo - A pupila do olho humano é capaz de realizar luminous , has been scientifically approached and automatic
movimentos de acordo com as condições em que ela é systems developed in order to realize it in real time.
submetida. Fatores como luminosidade, uso de
The movements of the pupil consist basically of
substancias químicas e patologias podem causar
mudanças na dinâmica da pupila. Diversos softwares e accommodation , pupil reflex to light (PLR ) and hippus .
dispositivos já foram criados para a realização da Pupilometry analyzes the pupillary movements through the
pupilometria (processo em que se aplicam estímulos de measurement of several components : maximum amplitude (
luz a fim de medir a resposta pupilar), porém são difference between initial and minimum size during PLR ),
escassos os softwares que apresentam interface gráfica e latency , contraction velocity and dilation , maximum and
possibilitam ao usuário a configuração de parâmetros do
minimum pupil sizes.
processo. Portanto, objetiva-se neste trabalho criar uma
interface que facilite o processo de pupilometria para o The pupillary light reflex test (PLR) has already been used
usuário, tornando mais dinâmico o procedimento. in past work in the investigation of conditions such as
alcoholism [2], drug use [3, 4], Down syndrome [5],
Palavras-Chave – Pupila; Softwares; Pupilometria; depression [6,7], poor of Alzheimer 's [6,8], Parkinson 's
Resposta pupilar; Interface gráfica. disease [8,9], heart failure [10], attention deficit, diabetes [11
], AIDS [12], autism [13], among others.
DEVELOPMENT OF A GRAPHIC
Due to the inexistence of low cost and open source devices
INTERFACE FOR PUPILOMETRY BOARD
that perform pupilometry, a pupilometer was developed using
DEVICE
the embedded system Raspberry Pi 2 [14].
Abstract - The pupil of the human eye is able to The mentioned device performs the stage of capturing
perform movements according to the conditions under pupillary cycles using active light control, and is also capable
which it is subjected. Factors such as brightness, use of of performing the video sequence processing , returning the
chemical substances and pathologies can cause changes in measured pupillary response. The joining of all system steps
pupil dynamics. Several software and devices have in a single embedded device provides such advantages as
already been created to perform the pupilometry (a
process in which light stimuli are applied in order to portability and versatility , as well as the low development
measure the pupillary response), but there are few cost of using open tools - software and hardware.
softwares that present a graphical interface and allow the Na ferramenta, parâmetros como raio mínimo, raio
user to configure process parameters. Therefore, the máximo, duração dos estímulos luminosos são
objective of this work is to create an interface that predeterminados no algoritmo, impossibilitando seu ajuste
facilitates the process of pupilometry for the user, making por usuários que não possuam familiaridade com o código
the procedure more dynamic. fonte. Além disso, toda a execução do programa é feita sem
Keywords - Pupil; Software; Pupilometry; Pupillary interface gráfica, apenas usando o terminal de texto do
response; Graphical interface. Raspberry Pi®.
In the tool, parameters such as minimum radius, maximum
I. INTRODUCTION radius, duration of luminous stimuli are predetermined in the
algorithm , making it impossible to adjust by users who are
The human pupil makes movements according to the not familiar with the source code . In addition , all program
conditions to which it is subject . These movements may be execution is done without a graphical interface , only using
contractions (myoses) or dilatations (midríases) stimulated by the Raspberry Pi® text terminal.
the parasympathetic and sympathetic nervous system ,
respectively . Factors such as luminosity , use of chemical
substances and pathologies may cause changes in pupillary
dynamics [1].
Due to clinical interests in the determination of pupillary
characteristics , dynamic pupilometry , which consists of the
analysis of the pupillary reflexes to the stimulus

1
II. SYSTEM DESCRIPTION It is recommended to use a power supply capable of
supplying a current of 2.5A in order to allow the use of
A. Raspberry Pi 2® peripherals with higher current consumption.
The developed system uses a low cost integrated device The GPIO ports can provide up to 50 mA distributed
known as Raspberry Pi 2®, which was initially developed in among each other, while the HDMI port drains 50mA and the
the UK to promote the teaching of information technology. camera module requires 250mA [16].
O Raspbery Pi 2® é possui o SoC (System on a Chip )
BCM2836 com processador quad-core ARM Cortex -A7 E. LED Circuit
funcionando a 900MHz, uma GPU VideoCore IV a 250MHz By blending the use of the Pi NoIR camera with the use of
com capacidade OpenGL ES 2.0, 1 GB de memória RAM, 40 infrared LEDs , one can obtain clear images from one
pinos GPIO (General Purpose Input Output ) e quatro individual 's eyes in the penumbra synchronously to the
portas stimulus of the other eye with visible light . The pupillary
General Purpose Input Output (GPIO ) ports are used to response to the light stimulus will be obtained by the
control the light stimuli incident to the eyes during the developed software . Two circuits containing one LED in
capture of the pupillary cycle . They can be individually series with a current limiting resistor were used , as can be
configured, offering outputs with 3.3V, 5V and GND voltage seen in figure 2.
levels, also has a port capable of providing gradual variations
through pulse width modulation (PWM).

Fig. 1. Raspberry PI 2®.

B. Câmera Pi NoIR
The image sensor used was the Pi NoIR camera, marketed
Fig. 2. Circuito de controle dos LEDs.
by the Raspberry Pi Foundation [15] and exclusive to the
device. Its features include capturing images at the maximum One of the circuits contains a white LED responsible for
resolution of 2592x1944 pixels (approximately 5 megapixels the luminous stimulus in one of the individual 's eyes under
), videos at the maximum resolution of 1920 x1080 and the pupilometric test. The other circuit employs an infrared
maximum frame rate of 90 frames per second (depending on LED that enables the capture of the images of the other non-
the resolution used). stimulated under total darkness.
The Pi NoIR camera enables the capture of images in the
infrared range of the electromagnetic spectrum and is thus
able to obtain images in the absence of visible light

C. Peripherals: Keyboard, Monitor, Mouse.


The user interface for execution of the software for
pupilometry is set in Linux , and requires the presence of
peripherals such as: Keyboard, monitor and mouse.
Keyboard and mouse are connected via USB interfaces ,
while the monitor is connected to the HDMI port on the
Raspberry Pi 2® device.

D. Alimentação
Fig. 3. Visor contendo câmera e iluminação LED infravermelho.
Raspberry Pi 2® requires 5V DC power supplied
through the micro usb interface.

2
The luminous intensity produced can be controlled using
pulse width modulation (PWM). The two 220Ω resistors used
limit the current in the LEDs in order to avoid excessive
current drainage and component damage.

F.Viewers
The present version of the pupillary tracking device is Fig. 5. Detecção da circunferência pupilar através da
transformada de Hough.
composed of two cylindrical PVC displays , 5cm in diameter
and 5cm in length , as can be seen in Fig. 4. Molded plastic During the location of the circumferences, two parameters
cushions were adapted to the diameter of the displays for are required : Maximum radius and minimum radius , which
greater comfort. and light blocking of ambient light. delimit the range of pupil radius values to be detected during
the pupilometry analysis process . In addition , the rate of
smoothing and binarization are other preset parameters - the
first necessary to reduce noise in the image , allowing to
detect only the pupil as circumference, the second used in the
conversion of the image in grayscale to black and white ,
decreasing the number of edges to be detected.
In figure 6 it is possible to observe that the choice of
different smoothing filters has an influence on the number of
false circumferences detected , making the pupilometry
process difficult [14].

Fig. 4. Protótipo do dispositivo de captura.

The left display is intended for the generation of the


luminous stimulus , while the right display causes the eye to
be filmed under total darkness . The infrared illumination
circuit and the Pi NoIR camera are coupled with a biconvex
lens for focal length correction.

G. Software
Algorithm [17] for localizing the pupillary circumference
comprises the following steps : image acquisition ,
preprocessing (image smoothing ) and recognition (pupil
location through the hough transform). It uses C ++ language,
using the OpenCV open source library [18 ] for image Fig. 6. Diferentes filtros de suavização.
processing. A figura 7 ilustra o software sendo executado ainda sem
The functions implemented for pupil tracking include the interface gráfica. O algoritmo realiza a captura de vídeo e
smoothing - performed by the median filter through the ' processa em tempo real os dados sobre os raios pupilares.
medianBlur' function - and the circumference location by the
Hough method - operated by the 'HoughCircles ' command -
which automatically performs edge detection by the Canny [
19].
The process of detecting forms by the Hough transform is
effected through the sum of an accumulator , also called a
voting [20 ]. This method operates on images after edge
detection . The process described is shown in Fig. 5, where
the resulting Hough space (Fig. 5 (c)) can be observed after Fig. 7. Software sendo executado.
the poll for all the edge pixels seen in Fig. 5 (b).

3
III. GRAPHIC INTERFACE DEVELOPED progress of the catch process. Figure 9 illustrates the
interface developed for the capture process.
A. QtCreator
The software chosen to develop the interface was
QtCreator, created by the company Trolltech, Norway. It is a
multiplatform graphical interface development framework ,
including : Android , Blackberry , iOS, Linux and Windows .
Qt is not a programming language, but a framework in C ++.
To extend the C ++ language and use features like 'signals &
slots' a preprocessor, called Meta-Object Compiler (MOC), is
used. From files written in Qt-extend C ++, MOC generates
files in the C ++ standard . Thus , the framework and the
applications that use it can be compiled by any C + +
compiler [21].
QtCreator software was chosen for interface development
because of its ease of use , integration with C ++ libraries ,
cross -platform compatibility - the interfaces created are
easily exported between different platforms - and due to their Fig. 9. Programa de captura sendo executado.
free-use permissions.

B. Capture C. Analysis
Two interfaces were developed that act separately . The Named 'Analysis ' the second interface performs the video
first makes the acquisition of images of the pupil. The second pre-processing and applies the Hough transform to detect the
performs the pre-processing (smoothing ) and recognition of pupillary rays during the frame display . The user is offered
circumferences through the Hough transform and returns the four editable parameters to perform the process : Level of
values of the pupillary rays, velocity and acceleration of the smoothing , minimum radius to be detected, maximum radius
pupillary contraction. to be detected and binarization threshold , as shown in Figure
The first interface , named 'Capture ', makes the video 10.
acquisition of the pupil movement. Provides the user with the
option to select the resolution of the video - '320x 240' or '
640 x480 ' - and allows the choice of the luminous stimulus
duration - 50 to 200 frames of duration with the LED on and
150 to 400 frames with the LED off . The interface with the
capture configuration parameters can be observed in figure 8.

Fig. 10. Opções de parâmetros criadas para análise.

The level of smoothing ranges from 5 to 19 , the


binarization threshold ranges from 30 to 60. The minimum
radius and maximum radius to be detected range from 5 to 50
and 30 to 120 pixels , respectively . The program also offers
the user the option to choose the directory where the file
Fig. 8. Opções de parâmetros criadas para captura. containing the measured values - pupillary radius , velocity
and acceleration of the pupillary contraction - and select the
Therefore , buttons have been created so that the user can
video to be analyzed - generated in the capture program will
interactively choose where the video and text files generated
be saved.
by the capture software will be saved. In this way it became
In Figure 11 we can observe the resulting interface for the
possible to easily choose the directories in which the
second stage of the program, containing the configuration of
generated files are saved
the analysis parameters and the process preview.
The button that initiates the video capture and application
of the luminous stimulus to the pupil was then added . A
progress bar has been created in order to inform the user of
the
4
In Figure 13 it is possible to observe the execution of the
analysis program . Note that, as in the capture interface , the
buttons and letters are larger , making it possible to use the
touch screen.

Fig. 11. Programa de analise sendo executado.

Fig. 13. Programa de analise para tela touchscreen sendo


D. Touch Screen Interface executado.
The need for peripherals such as keyboard , mouse and
monitor makes the use of the integrated device developed
more complex . A touch screen with an optimized interface
IV. CONCLUSION
makes the device simpler , facilitating its mobility and
exploiting its advantages as an embedded device.
The development of this work resulted in the design of a
Two interfaces were then developed with larger dedicated graphic interface that facilitates the process of pupilometry
buttons for the use of a 3.5-inch touchscreen at a resolution due to its easy use and integration of the steps of sample
of 320x480 pixels. The interfaces have the same pattern and collection and pupilometric analysis . This platform allows
elements as previously developed , but adapted for use by users who do not have knowledge about the source code of
touch on a smaller screen , containing larger buttons and the algorithm to configure the desired parameters in a simple,
letters. Figure 12 shows the capture interface. interactive and real time, without the need to recompile the
software.
The interface developed for touch screens allows greater
mobility to the hardware, as it eliminates the use of keyboard,
mouse and monitors . In addition , the software has cross -
platform compatibility , making it easy to migrate between
different systems , including embedded devices and mobile
devices.

REFERENCES
[1] G. L. Ferrari. Pupilometria dinâmica: Aplicação
detecção e avaliação da neuropatia autonômica
diabética e estudo da correlação entre a resposta
temporal da pupila ao estímulo visual e a glicemia.
Fig. 12. Programa de captura para tela touchscreen sendo Universidade Tecnológica Federal do Paraná. 2010.
executado. [2] E. TAN, D. LAMBIE, R. JOHNSON, E.
WHITESIDE, "Parasympathetic denervation of the
iris in alcoholics with vagal neuropathy", Journal of
Neurology, Neurosurgery & Psychiatry, vol. 47, no.
1, pp. 61-64. 1984.
[3] J. GRÜNBERGER, L. LINZMAYER, G. FODOR,
O. PRESSLICH, M. PRAITNER, N. LOIMER,
"Static and dynamic pupillometry for determination
of the course of gradual detoxification of opiate-
addicted patients", European archives of psychiatry

5
and clinical neuroscience, vol. 240, no. 2, pp. 109- [15] Raspberry Pi Foundation, Raspicam documentation.
112. 1990. http://www.raspberrypi.org/documentation/hardwar
[4] R. B. ROSSE, T. N. ALIM, S. K. JOHRI, A. L. e/cam era.md. [Web, acessado em 15/07/2017].
HESS, S. I. DEUTSCH, "Anxiety and pupil [16] E. UPTON, G. HALFACREE, "Raspberry pi user
reactivity in cocaine dependent subjects endorsing guide", John Wiley & Sons. 2014.
cocaine-induced paranoia: preliminary report", [17] R. A. Silva, Desenvolvimento de um Sistema
Addiction, vol. 90, no. 7, pp. 981- 984. 1995. Embarcado para pupilometria. 2016. 113 f.
[5] B. SACKS, S. SMITH, "People with down's Dissertação (Mestrado em Engenharia Eletrica) –
syndrome can be distinguished on the basis of Faculdade de Engenharia Eletrica, Universidade
cholinergic dysfunction", Journal of Neurology, Federal de Uberlândia, Uberlândia. 2016.
Neurosurgery & Psychiatry, vol. 52, no. 11, pp. [18] OPENCV, Open source computer vision. Acedido
1294-1295. 1989. em 17 de Julho de 2017, em: http://opencv.org.
[6] F. FOTIOU, K. FOUNTOULAKIS, M. TSOLAKI, [19] G. BRADSKI, A. KAEHLER, "Learning opencv:
A. GOULAS, A. PALIKARAS, "Changes in pupil Computer vision with the opencv library". "O'Reilly
reaction to light in alzheimer's disease patients: a Media, Inc.". 2008.
preliminary report", International journal of [20] S. J. K. PEDERSEN, "Circular hough transform",
psychophysiology, vol. 37, no. 1, pp. 111-120. Aalborg University, Vision, Graphics, and
2000. Interactive Systems. 2007.
[7] K. N. SOKOLSKI, E. M. DEMET, "Increased [21] Página Oficial Qt. About Qt. Acedido em 11 de
pupillary sensitivity to pilocarpine in depression", Maio de 2017, em: https://www.qt.io.
Progress in Neuro-Psychopharmacology and
Biological Psychiatry, vol. 20, no. 2, pp. 253-262.
1996.
[8] E. GRANHOLM, S. MORRIS, D. GALASKO, C.
SHULTS, E. ROGERS, B. VUKOV, "Tropicamide
effects on pupil size and pupillary light reflexes in
alzheimer's and parkinson's disease", International
Journal of Psychophysiology, vol. 47, no. 2, pp. 95-
115. 2003.
[9] G. RIZOS, C. TSALAMAS, D. FOTIOU, A.
TZAMBATZAKIS, A. GOULAS, I. TSIPTSIOS, F.
FOTIOU, "Pupillometry in parkinson's disease
correlations with neuroimaging techniques", In: .
c2004. vol. 54. pp. 41-42. 2004.
[10] A. KEIVANIDOU, D. FOTIOU, C.
ARNAOUTOGLOU, M. ARNAOUTOGLOU, F.
FOTIOU, A. KARLOVASITOU, "Evaluation of
autonomic imbalance in patients with heart failure:
a preliminary study of pupillomotor function",
Cardiology journal, vol. 17, no. 1, pp. 65-72. 2010.
[11] P. EUSTACE, S. MURNAGHAN, M. DRURY,
"Pupil constriction to dilute pilocarpine: a useful
clinical sign of autonomic involvement in diabetic
neuropathy", Neurogenetics and Neuro-
Ophthalmology, pp. 247-250. 1981.
[12] H. MACLEAN, B. DHILLON, "Pupil cycle time
and human immunodeficiency virus (hiv)
infection", EyeTransactions of the OSUK, vol. 7,
no. 6, pp. 785{786. 1993.
[13] X. FAN, J. H. MILES, N. TAKAHASHI, G. YAO,
"Abnormal transient pupillary light reflex in
individuals with autism spectrum disorders",
Journal of autism and developmental disorders, vol.
39, no. 11, pp. 1499-1508. 2009.
[14] R. A. Silva, A. C. P. Veiga , “Low Cost Portable
Travking System Embedded In Raspberry Pi 2”
Nome do periódico, Local de publicação, volume,
número ou fascículo, paginação, data de publicação
do periódico.

Potrebbero piacerti anche