# Configure the cameras

## Aim

<span style="color: rgb(0, 0, 0);">To adjust settings in a Basler GigE camera or USB 3.0 camera, like the video frame rate, video frame resolution, and exposure time, within the camera software.</span>

**<span class="FM_All_caps">NOTE</span>** Settings are stored in the camera software, not on the PC. When you work with multiple cameras, repeat the procedure for each camera.

## Procedure (general)

1. Make sure MediaRecorder (and EthoVision XT, when present on the computer) is not running.
2. Start the **<span class="FM_Bold">Basler Pylon Viewer</span>** software that comes with the GigE cameras. [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/HCxaq6pIj0cFSIWS-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/HCxaq6pIj0cFSIWS-image.png)
    
    **<span class="FM_All_caps">NOTE</span>**  The Basler Pylon Viewer software is installed automatically when you install the camera drivers.
3. In the **<span class="FM_Bold">Devices</span>** panel, under **<span class="FM_Bold">GigE</span>**, double-click the **Basler camera**. [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/FDHaWV9A4oBnGS3E-image.png)`](https://bookstack.noldus.com/uploads/images/gallery/2023-12/FDHaWV9A4oBnGS3E-image.png)
4. To preview the camera image, click the **<span class="FM_Bold">Continuous</span> <span class="FM_Bold">Shot</span>** button on the toolbar. [![preview camera image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/nh9KaWaNWwkFplSG-preview-camera-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/nh9KaWaNWwkFplSG-preview-camera-image.png)
    
    **<span class="FM_All_caps">NOTE</span>** To be able to adjust the settings, click the **<span class="FM_Bold">Stop</span>** button first. [![adjust settings_configure cameras.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/EZMozOwpKLuGnknR-adjust-settings-configure-cameras.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/EZMozOwpKLuGnknR-adjust-settings-configure-cameras.png)
5. Follow the instructions below that apply.

## To center the camera view

With this procedure you make sure the camera view is centered.

**<span class="FM_All_caps">IMPORTANT</span>** If you center the camera view in MediaRecorder, the settings may not be stored in the camera drivers. Here in Pylon viewer you make sure that the settings are stored in the drivers, also for future recordings.

1. In the **<span class="FM_Bold">Features</span>** panel, open the **<span class="FM_a_TheSansBold_Plain">Basler camera</span>** item and then the **<span class="FM_Bold">AOI Controls</span>** item (<span class="FM_Bold">**Image Format** Control </span>for USB 3 cameras).
2. Select both options **<span class="FM_Bold">Center X</span>** and **<span class="FM_Bold">Center Y</span>.**[![kép.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/08Q3wCzg3dIDuqLs-kep.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/08Q3wCzg3dIDuqLs-kep.png)
3. Save the settings.  
    See [To save the camera settings](https://bookstack.noldus.com/link/494#bkmrk-to-save-the-camera-s)

## To set the pixel format

**<span class="FM_All_caps">NOTE</span>** This option applies to black and white digital cameras.

1. In the **<span class="FM_Bold">Features</span>** panel, open the **<span class="FM_a_TheSansBold_Plain">Basler camera</span>** item and then double-click **<span class="FM_Bold">Image Format Controls</span>**.
2. Set the **<span class="FM_Bold">Pixel Format</span>** to **<span class="FM_Bold">Mono 8</span>**.
3. Save the settings.

See [To save the camera settings](https://bookstack.noldus.com/link/494#bkmrk-to-save-the-camera-s)

**<span class="FM_All_caps">IMPORTANT</span>** This corresponds to the option Y800 in MediaRecorder. In Pylon viewer you make sure that the settings are stored in the drivers, also for future recordings.

## To adjust the camera exposure time

The exposure time (or shutter time) is the time the camera shutter is kept open to let light in. The exposure time limits the maximum achievable frame rate. If the sum of the exposure time and the time needed for reading the chip (readout time) is greater than the time between consecutive video frames, the next frame may be dropped, resulting in a lower frame rate, and missed samples during tracking.

To adjust camera exposure that matches a frame rate:

1. In the **<span class="FM_Bold">Features</span>** panel, open the <span class="FM_a_TheSansBold_Plain">Basler camera</span> item and then double-click **<span class="FM_Bold">Acquisition Control</span>s**.
2. Make sure that **<span class="FM_Bold">Exposure</span> <span class="FM_Bold">mode</span>** is **<span class="FM_Bold">Timed</span>**, and **<span class="FM_Bold">Exposure</span> <span class="FM_Bold">Auto</span>** is **<span class="FM_Bold">Off</span>**.
3. Next to **<span class="FM_Bold">Exposure Time (Abs)</span> <span class="FM_Bold">\[us\]</span>**, enter the exposure time you require, in microseconds.  
    For Zebrafish larvae, enter 4000 or 2000, depending on the video resolution chosen.  
    In all other cases, you may choose a higher value. For rodents a value below 20000 is fine. Faster animals require shorter exposure times.  
    Press **<span class="FM_Bold">Tab</span>** or click another field to confirm.
4. To check that the exposure time is compatible with your frame rate, click the **<span class="FM_Bold">Continuous Shot</span>** button on the toolbar. [![kép.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/CtMW6DIFaMsQadp3-kep.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/CtMW6DIFaMsQadp3-kep.png)
    
    At the bottom of the live video window, locate the frame rate resulting with the new exposure time. This should be the same as the one next to **<span class="FM_Bold">Acquisition Frame Rate (Abs) \[Hz\]</span>**.[![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/cvIKavepYRlKLgmm-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/cvIKavepYRlKLgmm-image.png)If the resulting frame rate is lower than **<span class="FM_Bold">Acquisition Frame Rate (Abs) \[Hz\]</span>**, then either lower the exposure time (this will make the video image darker; open the lens diaphragm to compensate for this), or lower the video resolution. Do this until you see the expected frame rate.  
    [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/2IlKX40yfG1nERmv-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/2IlKX40yfG1nERmv-image.png)
5. <span style="font-family: 'Open Sans', 'Trebuchet MS', Helvetica, sans-serif;">Save the settings.</span>

See [To save the camera settings](https://bookstack.noldus.com/link/494#bkmrk-to-save-the-camera-s)

## To adjust the camera gain

This applies to both color and black/white Basler cameras.

**<span class="FM_All_caps">IMPORTANT</span>** Increasing gain also increase image noise. Do this only if no other option is left to improve the image brightness. For example, make sure that the lens aperture is maximal, and increase lighting.

1. In the **<span class="FM_Bold">Features</span>** panel, click **<span class="FM_Bold">Analog Controls</span>**.
2. From the **<span class="FM_Bold">Gain Auto</span>** list, select **<span class="FM_Bold">Off</span>**.
3. Next to **<span class="FM_Bold">Gain (Raw)</span><span class="FM_Bold"> (</span><span class="FM_Bold">Gain \[dB\]</span><span class="FM_Bold"> for USB 3.0 cameras)</span>**, select the value you require. A higher Gain results in a brighter image, but also more noise and a grainy image.  
    [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/LC9KnDofaZcZADbi-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/LC9KnDofaZcZADbi-image.png)
4. Save the settings.

See [To save the camera settings](#XREF_87731_To_save_the_camera)

<a name="IX_White_balance"></a>To adjust white balance

If you have a color camera, you also need to adjust its white balance.

1. Click <span class="FM_Bold">**Color Improvements Control**.</span>[![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/60avk6hMaNZ93pvr-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/60avk6hMaNZ93pvr-image.png)
2. Point the camera at a piece of white paper, so that the camera image is entirely white. Click in the field next to **<span class="FM_Bold">Balance White Auto</span>** and select **<span class="FM_Bold">Once</span>** from the list. [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/QxAWoOPeFW4E9AS4-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/QxAWoOPeFW4E9AS4-image.png)
3. Save the settings (see below).

## To save the camera settings

1. Click the <span class="FM_Bold">Stop</span> button. [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/HbWy2ajqqPIzvwos-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/HbWy2ajqqPIzvwos-image.png)
2. In the **<span class="FM_Bold">Features</span>** panel, open the **<span class="FM_Bold">Configuration</span> <span class="FM_Bold">Sets</span>** item (**<span class="FM_Bold">User Set Control</span>** for USB 3 cameras).
3. From the **<span class="FM_Bold">Configuration</span> <span class="FM_Bold">Set</span> <span class="FM_Bold">Selector</span>** list (**<span class="FM_Bold">User Set Selector</span>** for USB 3 cameras), select **<span class="FM_Bold">User Set 1</span>**.
4. Next to **<span class="FM_Bold">User Set Save</span>**, click **<span class="FM_Bold">Execute</span>**. The camera settings set in the previous steps are now saved under User Set 1.
5. From the **<span class="FM_Bold">Default</span> <span class="FM_Bold">Startup Set</span>** list (**<span class="FM_Bold">User Set Default</span>** for USB 3 cameras), select **<span class="FM_Bold">User Set 1</span>**.  
    For GigE cameras:
    
    [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/KmzthRKlZzOUotaL-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/KmzthRKlZzOUotaL-image.png)
    
    For USB 3 cameras:
    
    [![image.png](https://bookstack.noldus.com/uploads/images/gallery/2023-12/scaled-1680-/8EJ7dbxWTPGhfZ20-image.png)](https://bookstack.noldus.com/uploads/images/gallery/2023-12/8EJ7dbxWTPGhfZ20-image.png)
6. Close Pylon Viewer.


These settings will be used each time you start up MediaRecorder.

**<span class="FM_All_caps">TIP</span>** You can also save different settings for the same camera in User Set 2 and User Set 3. Under **<span class="FM_Bold">Default</span> <span class="FM_Bold">Startup Set</span> (<span class="FM_Bold">User Set Default</span>**), select which you want MediaRecorder to use.