| Customize Help

Cameras and video sources

MIL supports input from any type of video source connected to the hardware associated with an acquisition-type MIL system (such as a MIL Rapixo CXP system or MIL GigE Vision system). Each acquisition-type system has one or more available acquisition paths. MIL refers to the acquisition paths used to grab from one video source as a digitizer.

Note, since most video sources are cameras, they will hereafter be referred to as such.

For a digitizer to be recognized by MIL, it must be allocated on the target system using MdigAlloc() (or MappAllocDefault()). The allocation sets up the digitizer to match your camera's data format. Once you have finished using a digitizer, you should free it using MdigFree().

To make a more portable application, you can allocate and use the default system and digitizer set up when installing MIL or using the MILConfig utility. To allocate the default system and digitizer, use MappAllocDefault(). Alternatively, you can use MsysAlloc() with M_SYSTEM_DEFAULT to allocate the default system. Use the returned system identifier with MdigAlloc() and set the device number and data format both to M_DEFAULT to allocate the default digitizer.

Use MdigGrab(), MdigProcess(), or MdigGrabContinuous() to grab data from a camera through a digitizer. When grabbing from a 2D camera, pass an image buffer with an M_GRAB attribute as the location in which to store grabbed images. The image buffer should have as many bands as the grabbed data has color components. If you need to grab and process concurrently, you can use MdigProcess(). Both the image buffer and digitizer must be allocated on the same system.

If you have a 3D sensor, the basic procedure for grabbing is similar to grabbing from a 2D camera. However, you should typically pass a container with an M_GRAB attribute. For more information, see the Grabbing from 3D sensors overview section of Chapter 36: Grabbing from 3D sensors.

When your application requests a grab, either directly using MdigGrab() or automatically using MdigProcess(), the grab is queued; MIL grabs the next transmitted frame into the specified buffer. It is possible to configure some frame grabbers and cameras to wait for a hardware trigger or timer signal to grab/transmit a frame of data. When developing an application that uses triggers, it is recommended to begin with both your frame grabber and camera configured to grab/transmit frames of data continuously. Once you have implemented core functionality in your application, you can configure your frame grabber or camera to grab/transmit data using triggers. This approach can simplify debugging your application.