Skip to content

CamHal Software USB Camera

Important

The Cam Hal is deprecated, consider the iV1 module as a replacement for precisely-timed low-bandwidth frame acquisition.

Important

The CamHal is not compatible with the iPac and SynCon software.

Camera Block Diagram

The Camera HAL captures images from a USB camera directly connected to your computer for general subject behavior monitoring. Frames are captured, stored to disk and timestamped in the data block. Camera frames are saved as a DIVX-encoded AVI file in the same folder as your data block, in the form {TANK}_{BLOCK}_{HalName}.avi. The frame numbers are stored in the data tank as epoch events. The AVI file can be used with the OpenScope Video Viewer and annotation tools.

Only USB cameras that support OpenCV direct operating system camera drivers can be used with the Camera HAL in Synapse. Many industrial cameras (e.g. Basler) don't provide standard driver interfaces for the operating system.

Synapse supports up to two cameras per Rig and frame rates up to 20 fps. For best practice when using two cameras, keep cameras on separate USB Buses. Typically, PCs use separate buses for rear and front accessible USB inputs.

Important

Frame rate is controlled by a software timer and is prone to jitter. For real-time synchronized video capture, use the iV1 module.

Adding the HAL

Cameras are not automatically detected in the Synapse Rig Editor and must be manually added. To add a camera:

  1. Click Menu, then Edit Rig.

  2. In the Rig Editor, Right-click your system's processor (such as RX or RZ devices), then click Add Cam.

  3. Click OK to close the Rig Editor and update the Processing Tree.

Camera Options

Camera Options

Option Description
Status Shows if camera is connected or not
Resolution Select a video resolution
Frame Rate Select desired capture rate in fps
Preview On Shows a live stream from the camera in the Options area. The preview can be used to verify correct Camera placement and connection before recording.

Runtime Interface

The runtime tab displays the raw camera video for online monitoring. Please note that high-demand user interface tasks, like resizing windows, can increase jitter.

Runtime Plot with Camera Set to 5 Frames per Second

A subplot is also added to the main runtime multiplot to preview the frame index alongside other plot data.

Improving Performance

If you are having problems with things like dropped frames, we recommend installing the camera drivers to get access to more settings and controls for your camera. Some features like auto-adjust and "RightLight" can cause problems like increased jitter and dropped frames.