| Customize Help

Multiple cameras

MIL supports applications that require input from different cameras. With most Matrox frame grabbers, you can connect multiple cameras. If each camera connects to an independent acquisition path, then you can allocate a series of independent MIL digitizers and grab from these cameras simultaneously.

Simultaneous acquisition

Simultaneous acquisition is available on Matrox frame grabbers that support multiple independent acquisition paths. To grab from several sources simultaneously, you must allocate multiple digitizers with MdigAlloc() and then call MdigGrab(), MdigGrabContinuous(), or MdigProcess() with the identifiers of the required digitizers. When allocating a digitizer, you are committing one or more acquisition paths to a specific camera, depending on the format of the camera (for example, an RGB color camera uses three acquisition paths). To perform simultaneous acquisition, your digitizers must use different acquisition paths. For more information, see the Device number section earlier in this chapter.

Refer to the MIL Hardware-specific Notes for more information regarding the number of cameras from which you can acquire data simultaneously using your Matrox frame grabber.

The following example shows you how to allocate two digitizers on a system and use them to perform two continuous grabs simultaneously.

Data input channels of acquisition paths

Most acquisition paths have several multiplexed data input channels. This means that they have several data input channels but can only grab from one channel at a time. In this case, the MIL digitizer representing the acquisition path(s) has multiple data input channels. If you have a camera that is connected to a channel other than the first of its digitizer, you must specify the channel, using MdigControl() with M_CHANNEL.

Switching between cameras of the same type

When connecting several cameras of the same data format to different data input channels of a digitizer, allocate a single digitizer with the appropriate DCF for the first camera and use MdigControl() with M_CHANNEL to switch between the others of the same type.

Switching between cameras of different types

When connecting cameras of different data formats to different data input channels of a digitizer, you must use a different DCF for each camera. You could allocate a digitizer, grab the required frame, free the digitizer, and then allocate the digitizer again with the second DCF; this can increase the time required for the operation. MIL can circumvent this problem by using a fast DCF-switching technique which is outlined in the steps below:

  1. Make as many calls to MdigAlloc() as you have cameras, with different formats, from which you want to grab.

  2. Specify the required digitizer settings using MdigControl() and MdigHookFunction() for each allocated digitizer.

  3. Specify the channel to use for the grab using M_CHANNEL.

  4. Call MdigGrab() with an allocated digitizer identifier. Note that if this call uses a digitizer identifier different from the previous call, a DCF switch will occur.

    If there is a grab in progress with one digitizer, calling any of the following functions with any other digitizer will result in an error: MdigGrab(), MdigGrabContinuous(), MdigInquire(), MdigProcess(), MdigAlloc(), and MdigFree(). To synchronize your grabs with different digitizers, use MthrWait().

Ultra-fast channel switching

If you intend to switch channels after grabbing a single field or frame, use the ultra-fast channel switching mode to minimize time between grabs; set the M_CAMERA_LOCK control type to M_ENABLE + M_FAST. This mode is optimized for applications that use several cameras of the same type and it does impose certain restrictions:

Channel locking and unlocking

If the synchronization between a digitizer and a camera is uncertain, enable MdigControl() with M_CAMERA_LOCK to lock the digitizer to the synchronization signal of the camera after a channel-switch. This provides additional stability. In this case, the digitizer is unlocked from the first camera and then locked to the next camera after a channel-switch occurs.

Typically, MIL finds the best balance between the fastest lock and the most reliable lock possible, depending on your camera. On some Matrox frame grabbers, you can control channel locking sensitivity using MdigControl() with M_CAMERA_LOCK_SENSITIVITY and M_CAMERA_UNLOCK_SENSITIVITY. Note that the speed and reliability of a camera lock directly affects the subsequent unlock and vice versa (for example, a fast lock might create an unreliable unlock, or a reliable lock might cause a slow unlock).