> For the complete documentation index, see [llms.txt](https://portalgraphvr.gitbook.io/portalgraph-document-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portalgraphvr.gitbook.io/portalgraph-document-en/how-to-use-portalgraph-app/camera-tracking-guide.md).

# Camera Tracking Setup Guide

This guide explains the configuration steps for using a webcam for head tracking.

## Portalgraph Settings

Run the application created with Portalgraph and open the settings menu (usually by pressing F12). The settings screen has two tabs, **Camera** and **Tracker** — select the **Camera** tab to track with a webcam.\
(The screenshots below are from the version before the tab split; the steps have been rewritten for the current Camera tab.)

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FV23DMN0CiQe3c8ThdWUT%2Fimage.png?alt=media&amp;token=795042c0-e288-4db4-b50e-5356b71d2460" alt=""><figcaption></figcaption></figure>

If you are using a built-in webcam positioned just above a standard 16:9 monitor, enter the screen size (in inches) on the Camera tab — that's all you need to do (it takes effect automatically once you move focus out of the field). Tracker App Auto Start and the tracker position (equivalent to **EyeCenter**) are also configured automatically at this point, so there's no need to set those separately.

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FddtomI2Ap9WnBhjznKC2%2Fimage.png?alt=media&amp;token=beada9a1-7867-46e4-a810-a3c433a22109" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2Fwgec6HhNvI5M6WbYzqXe%2FScreenshot%202024-11-09%20160124.png?alt=media&amp;token=a517fff8-a5dd-496e-94c9-bedc5ee970ef" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FQfCTc4qX6BC9Bjgl4KJ5%2FScreenshot%202024-11-09%20160131.png?alt=media&amp;token=7df38b0b-2cea-4c75-a62a-e0287fd5bc0c" alt=""><figcaption></figcaption></figure>

If this is not the case, check **Advanced Mode**, then manually enter the screen size and specify the camera’s coordinates and angles. For the XYZ axes, positive directions are upward, to the right, and foward, respectively, relative to the screen. The same Camera tab also lets you switch the 3D display mode (Anaglyph, Side-By-Side, etc.), though Anaglyph is fine for most setups.

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FsWeiep93qPWIgXiMy3EG%2FScreenshot%202024-11-09%20160142.png?alt=media&amp;token=4554f660-d53e-4782-9bed-77c8f65938d4" alt=""><figcaption></figcaption></figure>

## Camera tracking Application Setting

The camera tracking app is pre-configured for a standard built-in PC webcam, so if you are using an internal camera, simply select the camera and click **Apply** to complete the setup.

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FA1nDXLosPt4BWl9WlCsx%2FcameraEn.png?alt=media&amp;token=9d7d8056-a3c7-4143-b84f-eecf1e202a95" alt=""><figcaption></figcaption></figure>

If you are using a specialized camera, click **Calibration** to start a countdown. During this countdown, use a measuring tool to position your face so that your eyes are exactly 50 cm in front of the camera. Once the countdown finishes, the camera’s field of view and focal length will be adjusted accordingly.

<figure><img src="https://1057988615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR4jDeJrvuIogaygztZi7%2Fuploads%2FqCY3PFx4uBpvcvIy5lsh%2Fspaces_aJCTlOkQcgkhVMLcuHBm_uploads_CB72gJJtC3gZNAc2iyek_image.webp?alt=media&amp;token=7b0386ee-7b7e-489b-8166-fe6392c8fb07" alt=""><figcaption></figcaption></figure>

Here are some tips to enhance your experience:

* **Lower Camera Resolution:** Set the camera resolution lower to reduce CPU load (640×360 is sufficient).
* **High-FPS Camera:** A high-FPS camera improves responsiveness.
* **Wide-Angle Camera:** A wide-angle camera allows for more movement within the frame but may introduce distortion towards the edges of the field of view.
* **Recommended Camera:** The developer uses a camera with a 120-degree field of view and 60fps.
* **Check Camera Specs:** You can verify the camera’s supported resolution and FPS in the Windows Camera app under "Video Settings."
