> For the complete documentation index, see [llms.txt](https://help.imotions.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.imotions.com/lab/remote-data-collection/getting-started-with-online-data-collection/webcam-respiration-getting-started.md).

# Webcam respiration: getting started

Set up a remote data collection study that records webcam respiration, collect the data and analyze it with R Notebooks.

iMotions can detect respiration from the respondent's webcam in remote data collection (RDC) studies. This article describes study setup, data collection and analysis of webcam respiration data. For a detailed validation of the algorithm, see the [iMotions Web-Respiration Validation white paper](https://www.researchgate.net/publication/385243968_iMotions_Web-Respiration_Validation).

## Setting up your study

Webcam respiration data is collected automatically for all stimuli in RDC studies. The feature must be enabled for your account first. Contact iMotions if you are not sure whether you have access.

The webcam respiration feature is tied to webcam eye tracking, so your study must be created as a webcam eye tracking study to get respiration data. See [RDC Testing with Webcam Eye Tracking](https://help.imotions.com/lab/remote-data-collection/getting-started-with-online-data-collection/rdc-testing-with-webcam-eye-tracking.md) for how to create one.

### Stimulus types

The best results come from stimuli that only require passive viewing, without interaction with mouse and keyboard. This typically means videos and still images. You can use other stimulus types, such as websites and surveys, but data quality will most likely drop for these.

### Instructions for respondents

The algorithm detects respiratory patterns by measuring subtle movements in the chest area of the respondent. Unnecessary movement of torso and arms makes it harder for the algorithm to measure respiratory patterns.

Give the respondents good, clear instructions and encourage them to sit still during the study. A position where the respondent leans against the backrest of the chair works best.

## Data collection

When you have finished designing the study in iMotions Lab, upload it to iMotions Online for distribution to respondents. Follow the steps in [Creating RDC studies](https://help.imotions.com/lab/remote-data-collection/creating-rdc-studies.md), section "Starting data collection in iMotions Online".

## Reviewing the data

For each respondent, you get the following time series data:

| Signal                 | Description                                                                                                                                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Respiration Raw Signal | The raw detection of chest movements. The scale is unitless.                                                                                                                                                 |
| Respiration Signal     | A filtered version of the raw signal. The scale is unitless. The filter is a bandpass for the expected respiratory rate range of 7.5–30 breaths per minute (0.125–0.5 Hz).                                   |
| Respiration Frequency  | Respiratory rate in Hz, calculated for each half-cycle. This signal is a preliminary estimate. When you process the data with the respiration processing R Notebook, the frequency signal is post-processed. |
| Respiration Quality    | Quality score for each half respiratory cycle, from 0 to 1. Generally, a score above 0.5 represents a useful detection of a respiratory cycle.                                                               |

## Analyzing the data

In the dialog where you choose R Notebooks to process the raw data, the default parameters work for many cases. To improve detection accuracy, increase the quality threshold. The higher the quality threshold, the more data is excluded from the analysis.

For some stimuli, especially video stimuli, you can use the aggregation R Notebook to get a moment-to-moment visualization of the average respiratory rate.

### Read more

* [R Notebooks (Respiration): Respiration Processing](https://help.imotions.com/lab/analysis/respiration/r-notebooks-respiration-respiration-processing.md)
* [R Notebooks (Respiration): Moment to Moment Aggregation](https://help.imotions.com/lab/analysis/respiration/r-notebooks-respiration-moment-to-moment-aggregation.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.imotions.com/lab/remote-data-collection/getting-started-with-online-data-collection/webcam-respiration-getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
