Performance Evaluation of the Webcam-Based Contactless Respiratory Rate Monitoring System

Performance Evaluation of the Webcam-Based Contactless Respiratory Rate Monitoring System

Aulia M.T. Nasution* | Ilham A. Ibrahim Putra A.A. Asani | Yusni Anggara

Photonics Engineering Laboratory, Dept. of Engineering Physics, Faculty of Industrial Technologies and System Engineering, Institut Teknologi Sepuluh Nopember (ITS), Surabaya 60111, Indonesia

Embedded and Cyber-Physical Systems Lab., Department of Engineering Physics, Institut Teknologi Sepuluh Nopember, Kampus ITS Sukolilo, Surabaya 60111, Indonesia

Corresponding Author Email:
18 September 2022
2 December 2022
12 December 2022
Available online: 
31 December 2022
| Citation

© 2022 IIETA. This article is published by IIETA and is licensed under the CC BY 4.0 license (



Continuous monitoring of the respiratory rate is necessary, particularly for patients stationed in the hospital’s wards, to assure their physical conditions are medically controlled. We tested the developed webcam-based contactless respiratory rate monitoring system on twenty healthy volunteer human subjects (age 20-25 years old) who provided informed consent to participate in the research. Subjects are asked to breathe with the breath rate following the guiding flash lamps emitted from mobile phones at specific rates. Results show that the developed system is capable of measuring respiratory rate with an average error of 0-2% and with an average coefficient of variance (COV) of 0-5% among all subjects tested and for all ranges of respiratory rates investigated. These results are quite promising for further use of this system as an accurate and precise continuous respiratory rate monitoring system in clinical settings.


human vital signs, respiratory rate, monitoring system, non-contact measurement

1. Introduction

Respiration is a key process in the human lungs for gas exchange between oxygen and carbon dioxide, which is then distributed through a closed circulatory system to the body’s cells. At this cellular level, oxygen and carbon dioxide are further exchanged to maintain cellular metabolism. An adequate amount of oxygen is required to guarantee their normal metabolic needs. Complex contributing organs in the human respiratory system play a beautiful orchestra to manage dynamic changes in the interplay among respiration, circulation, and metabolism activities [1].

The respiratory rate, usually abbreviated as RR, is defined as the number of breaths per minute, and it is one of the important vital signs that are usually used by doctors to assess a patient’s vital functions [2]. They provide clues to possible diseases experienced by patients or for monitoring the progression of a patient’s recovery process during and after the treatment. Normal values of RR for an adult healthy person are between 12 and 20 breaths per minute (normally abbreviated as bpm) [3], and these values vary with age, gender, and health status.

These varying rates of gas exchange are regulated by a network of nerve tissues that send regulatory stimulus signals to respiratory system organs such as the brain, brain stem, respiratory muscles, lungs, airways tubes, and blood vessels [1]. The exchange of gases in the respiratory system affects the body's homeostasis, which is the body's ability to keep things in balance [4]. Changes in pressure as blood flows through capillaries in the alveoli will stimulate changes in pressure gradient, which will in turn facilitate the diffusion process. It also maintains the acid-base balance of the body by changing the breathing rate to compensate for the CO2 concentration in the blood; meanwhile, in hypoxia or hypoxemia conditions, i.e., a lower O2 level in the blood, this will also trigger changes in breathing pattern. These homeostatic actions will restore any imbalance conditions to equilibrium in a short period of time, whereas prolonged ones will indicate abnormalities in the patient's health. In this context the monitoring of breath rate is necessary to be done. Unfortunately, monitoring has been somewhat neglected in many clinical settings [5, 6].

Accurately monitoring RR is beneficial in detecting any physiological changes that may cause deterioration in the patient's clinical signs in order to prevent cardiac arrest, which can result in unexpected deaths. Generally, techniques for measuring RR can be classified into two categories, i.e., in a contact or non-contact way. In the first category, sensing devices are needed to be attached to the body’s surface and connected by cables, or wirelessly transmitted, to the processing and visualization units. Massaroni et al. [7] provided a very good review of various measurement techniques classified as contact modes, which describe them according to transducing mechanisms, type of measurands involved, and how to retrieve RR from measured respiratory-modulated signals (i.e., biopotential and light intensity modulation).

Meanwhile, in the non-contact mode, changes in respiration can be probed remotely without any direct contact with the body. This technique offers many advantages, such as avoiding patient discomfort since the sensor is not attached to the patient’s body and being more preferable for long-term monitoring. Any discomfort in measurements may stimulate a patient’s distress, which can alter RR. It is also more suitable when attaching a sensor to a patient’s skin is not possible due to vulnerable skin, like in the case of neonates or patients with burned skin. Moreover, this measurement mode is also more suitable for remote monitoring of COVID-19 patients, where frequent contacts between patients and nurses are better avoided. A more detailed review of contactless measurement techniques can be found in the study [8].

This paper describes steps to test and evaluate thoroughly the measuring performance of the previously developed simple, low-cost, non-contact webcam-based respiratory rate monitoring system [9]. A Logitech C922 HD 1080 Webcam camera was used as a contactless measurement sensor for recording temporal changes in reflected light intensity captured from areas around the neck. These changes in reflected light are modulated by the regular action of respiratory muscles [10]. A graphical user interface with a dedicated program to calculate the respiratory rate from recorded video images captured by the webcam was developed to make the measurement process by the operator easier. Calculations were carried out from ROI points around the neck, i.e., on the collarbones, neck, and chest (in front of the jugular notch), which are usually uncovered by cloth. For comparison, measurements of sounds from air flows in during inhalation and out during exhalation were parallelly recorded using a head-mounted microphone. The developed system was tested on twenty healthy volunteer human subjects (age 20-25 years old) who provided informed consent to participate in the research. Detailed of the steps done will be described in the following sections.

2. Materials and Methods

2.1 Breathing mechanics during respiration

Lungs, the primary respiratory organs, are a pair of air-filled organs located in the thoracic cavity and protected by the rib cage and bounded by the diaphragm. Anatomically, human lungs are similar in form but asymmetrical, i.e., the right lung consists of three lobes while the left lung consists of only two lobes. Each of these lobes is protected by a thin tissue layer called the pleura, which contains a thin layer of fluid that acts as a lubricant to allow smooth slips between the lungs and the thoracic wall during expansions and contractions [11].

Contraction of the muscles on the rib cage and diaphragm will expand the volume of the thoracic cavity, which will reduce the hydrostatic pressure of the pleural cavity to draw air during the inhalation via the nose [12, 13]. Then the inhaled air will flow through the trachea, bronchi, and bronchioles before being dispersed into alveoli (air sacs) through the alveolar ducts. Each alveolus is surrounded by networks of capillaries, which allow gases in the blood to move around in the alveoli [14].

Breathing is considered as complex rhythmical mechanics of human’s body activities, which circulates ventilation of rich oxygenated (O2) air into lungs and gets rid of carbon dioxide (CO2) out of the body. It is considered an unconscious, involuntary, as well as automatic, process. Signals from sensors (chemo- and mechanoreceptors) [15, 16], which are distributed over the body, will be received and processed by the respiratory neuronal networks in the brain, producing a well-coordinated action of inhalation and exhalation sequences. The chemoreceptors will sense the changes in O2, CO2, and pH levels in blood and body tissues, while the mechanoreceptors will monitor the mechanical changes in the lungs’ expansion, dilation, and constriction of air passage ways, as well as the contraction and extension of other related respiratory muscles.

The rate and duration of breath during inhalations and exhalations (depth of respiration) are coordinated by the medulla and pons of the brainstem. Changes in either CO2 or O2 levels in blood will stimulate different changes in respiratory rate and pattern [17]. In a hypoxic condition, i.e., where inadequate O2 supply in the blood is present, it will stimulate rapid and shallow breaths in order to avoid excessive oxygen utilization by respiratory muscles to maintain the so-called "economical breathing" [18]. Meanwhile, it will react differently to hypercapnia, which is when there is too much CO2 in the blood. This will cause it to breathe deeply and slowly to get rid of the extra CO2 quickly.

2.2 Imaging of vibrating surface

The movements of the thoracic cage during the breathing process can be regarded as a continuously vibrating body at low frequencies. It will modulate the scattered intensity of ambient light, and by capturing these temporal changes in modulated intensity, one can extract vibration properties of the surface being imaged. Using the high dynamic range cameras, one can determine which local regions of the vibrating object are being analyzed, thus providing good observational flexibility [19]. Many extraction algorithms had been developed to analyze the vibration characteristics of the vibrating body, i.e., based on the Digital Image Correlation Technique (DIC) with the Fast Fourier Transform (FFT) algorithm, as described in the studies [20-22].

2.3 Image acquisition and extraction of measured data from acquired images

The dynamic movements during the breathing process were imaged using the C922 HD Webcam from Logitech in video mode for a one-minute duration. For each of the set breathing frequencies, the measurements were repeated three times. The acquired video images were then processed using a developed algorithm, which was written in Phyton. Temporal changes in intensity signals from pixels of the three chosen ROIs on the images will be extracted and filtered out of the contributing noise by using a band-pass filter in the range of 0.15 to 0.7 Hz. These frequency ranges correspond to the typical human respiratory rate, i.e., values between 12 and 40 breaths per minute. This filtered signal was then transformed using the FFT algorithm to convert it into a correlated frequency-domain signal. Figure 1 shows the typical acquired raw signal that is taken from the acquired images, the corresponding filtered signal, and the correlated FFT-transformed signal. The predicted respiratory rate (in breaths per minute) is the value of the frequency, which shows the maximum normalised power spectrum after being multiplied by 60 seconds per minute.

Figure 1. Typical measurement signal acquired from the recorded images: a) Raw signals b) Filtered signals and c) FFT transformed signal

2.4 Camera’s response time measurement

For all the measurements with the volunteer human subjects, a guiding flash that was generated by the strobe LED feature from a smartphone was used to guide the subjects to breathe. It will generate flashes of light according to the set frequency values (flashes per minute), and the C922 HD Webcam camera from Logitech will then record the temporal changes of the generated flashes that are scattered from a diffuse surface. The camera was capable of acquiring 30 fps 1080p images, and temporal changes in intensity from the recorded video images will be compared to the values set on the smart phone in generating the flashes. The difference between these two numbers can be thought of as the bias of the measurements.

The frequencies of flashes are set from 12 to 20 flashes per minute (fpm), as used for normal breathing speed. To check the accuracy and precision levels of the camera in capturing these flashes, preliminary measurements were made with the measurement configuration depicted in Figure 2. Images from a surface that diffusely reflected light were taken for one minute and saved for further study.

Figure 2. Sketch of measurement configuration to check the accuracy and precision levels of the camera

2.5 Design of experiments and recording the respiration of volunteer human subjects

After examining the accuracy and precision levels of the camera in capturing the guiding flashes, the developed RR monitoring system was then applied to measure respiratory rate from the subjects. Figure 3 shows how the respiratory rate data from the subjects were measured. The subjects were between the ages of 20 and 25 years, and they were all male senior undergraduate students at the department. Since our research goal was to test the performance of the previously developed system, which was simultaneously measured using a microphone attached near their exhalation passage, the goal was not specifically intended to compare the breathing rate behaviour among age- and gender-wise human subjects. All volunteer human subjects were asked to sit in a relaxed position on a chair and then to breathe in response to the flashes emitted by the smartphone, which were set at a repetition rate of 12-20 fpm and continued at a higher repetition rate of 25-40 fpm. The moving areas around the neck due to inhalations and exhalations were then recorded by webcam for a duration of 1 minute for each fpm with 5-time measurement repetitions. Parallelly, subjects also used a head-mounted microphone to record their breathing sounds, which will be used as comparisons with the ones using the camera.

Figure 3. Left and right images illustrate how the configuration for recording of respiration data from subjects

2.6 Measurement data analysis

In physical measurements, the measurements can be statistically analyzed using two quantities, i.e., the mean and the standard deviation. The first reflects the average of repeated N measurements, while the last provides the spread of repeated measurements around the average. Mathematically, both of these quantities can be written using Eqns. (1) and (2), respectively.

$\operatorname{Mean} \overline{\boldsymbol{x}}=\frac{1}{N} \sum_{i=1}^N x_i$       (1)

Standard Deviation $\boldsymbol{S}=\sum_{i=1}^N \frac{\left(x_i-\bar{x}\right)^2}{(N-1)}$      (2)

The goodness of a measuring instrument can be characterized based on two important parameters, i.e., the reliability and validity. The first, i.e., reliability, refers to the ability of a measurement system to produce repeatable measurements, a.k.a. the precision level of the measurement system. In statistics, it can be shown as the relative standard deviation or as the measurements' coefficient of variation.

Coefficient of Variation $(\%)=\left(\frac{s}{\bar{x}}\right) \cdot 100$        (3)

where, $S$ and $\bar{x}$ represent, respectively, standard deviation and mean. The smaller the coefficient of variance, the greater the precision of the measurements taken.

The average mean and average standard deviation among kvolunteer subjects, each with its measurement's standard deviation $s_i$, can be calculated using the Eq. (4) and (5), respectively, i.e.:

$\bar{x}_{\text {avg }}=\frac{\sum_{i=1}^k \bar{x}_i}{k}$      (4)

$S_{\text {avg }}=\sqrt{\sum_{i=1}^k \frac{\left(s_i^2\right)}{k}}$       (5)

where: $\bar{x}_i$ and $s_i$ are the measurement's mean and standard deviation of the $i$-th volunteer subject, respectively, and $k$ is the number of volunteer subjects involved in the study.

Meanwhile, the second important parameter is the validity of the measurements, which refers to how accurately a measurement system measures what it is intended to measure. It is also known as the measurement's accuracy, and it is used to measure how close a measured value is to the true or expected value. Sometimes it is also expressed as a percentage of error, which measures the bias of the indicated measurement to the expected true value of the measurement, which can be written as in Eq. (6)

Error of Measurement $(\%)=\left(\frac{x_i-x_{\text {expected }}}{x_{\text {expected }}}\right) \cdot 100$       (6)

3. Results and Discussion

3.1 Camera’s response time measurement

Graphics in Figure 4 show how the measurement response of the camera is affected by capturing flashes of light generated from the smartphone's LED. Measurements showed excellent results in terms of linearity, as well as validity (bias or error) and reliability (repeatability). Both the coefficient of variation (relative standard deviation), which measures how good the repeatability of the measurements, and the bias (% error), which measures the deviation from the true value, were below 1%. This can be a good sign that the imaging system used has a good chance of giving good measurement results in the future.

Figure 4. a) Results of camera’s response measurements b) error of measurement (%) and c) respective coefficient of variation (%) of the camera’s response measurements

We utilized the flashes from smartphone to guide the subjects to start breathing with a breath rate following the frequency of the flash light. A webcam camera was directed to acquire region around the subject’s neck, and the dedicated program were developed to extract the frequency from the recorded video images. At the same time a head mounted microphone was also used to record the breath sound during inhalations and exhalations. Results of the measurements can be depicted in Figure 5.

Table 1. Linear fitting results of respiratory measurements

Location of Measurement


Std. Error














Figure 5. a) Measured respiratory rate using webcam vs using microphone b) and c) are the related error and coefficient of variation for all modes of measurement, respectively

It can be seen from Figure 5 that all of the three measurement points, show good linearity to the measurement using microphone, i.e. with slopes of linear fit close to one. The Fitting parameters are given in Table 1.

Meanwhile the error of the average measurements using camera at three points, as well as using microphone, were also fall below 2% (with the ones for microphone tends to be higher). Additionally, the measurements also show a very good repeatability as can be indicated by the coefficient of variation below 5%. Among the three measurement points, extraction of respiratory rate from location of collarbone showed the best accuracy as well as the coefficient of variation.

Figure 6. Variability of measured respiratory rate among volunteer subjects measured a) using webcam vs b) using microphone

Figure 7. a) Plot of the population’s average and standard deviation for all volunteer subjects, and b) comparison of measurement accuracy using microphone and webcam (right)

If we look deeper into how each subject responded to the guiding flashes, it shows that spread of variabilities among subjects as can be seen in Figure 6. This figure describes variability of the average bias of the measured breath-per-minute between each volunteer human subjects for different values of guiding bpm set rate. These variations could be due to the different reaction times of each human subject in responding to the observed guiding flashes as a signal to begin breathing. Some subjects reacted almost timely to the set guiding flash, e.g., subjects with low values of standard deviation, while some others show varied delayed reaction times.

The average and standard deviation of the measured respiratory rate among all volunteer human subjects for all of the set values of respiratory rate can be given in Figure 7 a). The measurements show high linearity to the set respiratory rate values, i.e. with the slope (coefficient of determination R2) close to 1. The respective comparison of the measurement accuracy between microphone and webcam is depicted in the graph in Figure 7 b).

Meanwhile, to get a better insight into the plots of standard deviation (Figure 8 a) and coefficient of variation (Figure 8 b) between microphone and webcam measurements, one can see that the measurements using the webcam camera show better precision in comparison to the ones using a microphone.

Figure 8. Insight into the changes in a) standard deviation and b) coefficient of variation for each breath-per-minute set values as measured in Figure 7

Overall, average measurements using a camera show better accuracy as they are closer to the set bpm values, while measurements using a microphone tend to be a bit lower. It is due to the camera tracking the signal changes in reflected intensities around the subject’s neck due to the movement of the thoracic cage during respiratory cycles. These areas are the most accessible from the subjects' normal clothing and are closer to the chest region where the mechanics of respiration were performed. Meanwhile, the measurement with the microphone may be influenced in some way by the condition of obstruction in the nasal flow passage among volunteers.

4. Conclusions

In conclusion, the performance of the previously developed simple and low-cost, non-contact, webcam-based respiratory rate monitoring system has been evaluated. Results were indicated by the respective parameters of accuracy and reliability (a.k.a. repeatability), which were calculated from the measurements done using volunteer subjects. The accuracy of the system, expressed as the bias between the average of the measurements and the "true" set values, falls above 98% for all set values of breathing rates, i.e., 12 to 40 bpm. Meanwhile, the measurement repeatability falls between 1% and 5% for all measurement ranges, which means that the precision level of the measurements is high. These results show very good measuring performance and are promising to be further implemented in clinical settings. Using a HD webcam (priced ca. USD 70) and an Intel Core i3 laptop (the total cost was lower than USD 400), a simple respiratory rate monitoring system with excellent measuring performance can be developed. This simple and low-cost system would be beneficial for fulfilling the shortage of accurate and reliable physiological monitoring faced by hospitals in many remote and rural areas of Indonesia. The future incorporation of Internet of Things (IoT) technologies may be advantageous in increasing its capability with early warning capabilities as well as parallelly monitoring several patients in infectious disease wards or from their homes in order to minimise human involvement during its monitoring operation, as demanded during the last pandemic COVID-19 [23, 24].


This research was funded by the Directorate of Research and Community Services (DRPM), the Institut Teknologi Sepuluh Nopember (ITS) Surabaya.


[1] Cardy, J.D., Jones, J.G. (2003). Pulmonary Physiology and Pathophysiology, Wylie Churchill-Davidson's A Practice of Anesthesia.

[2] Elliott, M., Coventry, A. (2012). Critical care: Eight vital signs of patient monitoring. Br. J. Nurs., 21(10): 621-625.

[3] Flenady, T., Dwyer, T., Applegarth, J. (2017). Accurate respiratory rates count: So should you!. Australasian Emergency Nursing Journal, 20(1): 45-47.

[4] Mighten, J. (Ed.). (2012). Children's Respiratory Nursing. John Wiley & Sons.

[5] Cretikos, M.A., Bellomo, R., Hillman, K., Chen, J., Finfer, S., Flabouris, A. (2008). Respiratory rate: The neglected vital sign. Medical Journal of Australia, 188(11): 657-659.

[6] Loughlin, P.C., Sebat, F., Kellett, J.G. (2018). Respiratory rate: The forgotten vital sign - Make it count!. Joint Commission Journal on Quality and Patient Safety, 44(8): 494-499.

[7] Massaroni, C., Nicolò, A., Lo Presti, D., Sacchetti, M., Silvestri, S., Schena, E. (2019). Contact-based methods for measuring respiratory rate. Sensors, 19(4): 908-908.

[8] Massaroni, C., Nicolo, A., Sacchetti, M., Schena, E. (2020). Contactless methods for measuring respiratory rate: A review. IEEE Sensors Journal, 21(11): 12821-12839.

[9] Ibrahim, I.A., Nasution, A. (2021). Estimation of respiratory rate based on image processing using camera with pixel value analysis method. In Fourth International Seminar on Photonics, Optics, and Its Applications (ISPhOA 2020), 11789: 17-24.

[10] Troyer, A., Moxham, J. (2020). Chest Wall and Respiratory Muscles, In: Maynard, R.L., Pearce, S.J., Nemery, B.N., Wagner, P.D., and Cooper, B.G. (Eds), Cotes’ Lung Function, 7th ed., John Wiley & Sons Ltd, 149-176. 10.1002/9781118597309

[11] Tomashefski, J.F., Farver, C.F. (2008). Anatomy and histology of the lung. In Dail and Hammar’s pulmonary pathology, 20-48.

[12] Lai-Fook, S.J. (1987). Mechanics of the pleural space: Fundamental concepts. Lung, 165(1): 249-267.

[13] Charalampidis, C., Youroukou, A., Lazaridis, G., Baka, S., Mpoukovinas, I. (2015). Physiology of the pleural space. Journal of thoracic disease, 7(Suppl 1): S33-S37.

[14] Townsley, M.I. (2012). Structure and composition of pulmonary arteries, capillaries and veins. Comprehensive Physiology, 2: 675-675.

[15] Guyenet, P.G. (2014). Regulation of breathing and autonomic outflows by chemoreceptors. Comprehensive Physiology, 4(4): 1511-1511.

[16] Widdicombe, J.G., Sant’Ambrogio, G. (1992). Mechanoreceptors in respiratory systems. Comparative Aspects of Mechanoreceptor Systems, 111-135.

[17] Moosavi, S.H., Golestanian, E., Binks, A.P., Lansing, R.W., Brown, R., Banzett, R.B. (2003). Hypoxic and hypercapnic drives to breathe generate equivalent levels of air hunger in humans. Journal of Applied Physiology, 94(1): 141-154.

[18] Zakynthinos, S., Roussos, C. (1991). Oxygen Cost of Breathing, In Gutierrez, G. and Vincent, J.L. (Eds.) Tissue Oxygen Utilization, Berlin - Heidelberg: Springer-Verlag, 171-184.

[19] Clark, F.O., Penny, R., Pereira, W., Kielkopf, J., Cline, J. (2014). Passive optical detection of a vibrating surface. Spectral Sciences Inc Burlington Ma.

[20] Grebenyuk, A.A., Ryabukho, V.P. (2011). Digital image correlation with fast Fourier transform for large displacement measurement. In Saratov fall meeting 2010: Optical technologies in biophysics and medicine XII, 7999: 68-72.

[21] Zhang, D., Guo, J., Lei, X., Zhu, C. (2016). A high-speed vision-based sensor for dynamic vibration analysis using fast motion extraction algorithms. Sensors, 16(4): 572-572.

[22] Neri, P., Paoli, A., Razionale, A.V., Santus, C. (2022). Low-speed cameras system for 3D-DIC vibration measurements in the kHz range. Mechanical Systems and Signal Processing, 162: 108040-108040.

[23] Paganelli, A.I., Velmovitsky, P.E., Miranda, P., Branco, A., Alencar, P., Cowan, D., Endler, M., Pelegrini Morita, P.P. (2022). A conceptual IoT-based early-warning architecture for remote monitoring of COVID-19 patients in wards and at home, Internet of Things, Volume 18: 100399.

[24] Thippeswamy, V.S., Shivakumaraswamy, P.M., Chickaramanna, S.G., Iyengar, V.M., Das, A.P., Sharma, A. (2021). Prototype development of continuous remote monitoring of ICU patients at home. Instrumentation Mesure Métrologie, 20(2): 79-84.