| Customize Help

Using Matrox Rapixo CXP with MIL

To use Matrox Rapixo CXP, you must allocate it as a MIL Rapixo CXP system (using MsysAlloc() with M_SYSTEM_RAPIXOCXP). This allocation opens communication with the Matrox Rapixo CXP board and allows MIL to use its resources. You can allocate a MIL Rapixo CXP system for your board in multiple processes (executables). However, different processes cannot allocate a digitizer for the same acquisition paths.

All Matrox Rapixo CXP boards feature 4 quadrature decoders that can decode input from linear or rotary encoders with quadrature output. For information on this feature, refer to the Using quadrature input from a rotary encoder section of Chapter 41: I/O signals and communicating with external devices. This chapter also provides information on how to configure and use the auxiliary I/O signals.

For information on how to use the Processing FPGA of Matrox Rapixo CXP Pro, see Chapter 52: Using MIL with a Processing FPGA.

Refer to the Matrox Rapixo CXP release notes for any additions/modifications to the MIL Hardware-specific Notes in this chapter or in the MIL Reference.

Grabbing and the MIL buffer formats to use for each camera pixel format

The following table outlines which MIL buffer format to use with each supported camera pixel format. Note that these are the officially supported camera pixel formats.

Camera pixel format 3

MIL buffer format (type and attribute)


Mono8, Mono10, Mono12, Mono14, Mono16, Mono32

1-band 8-bit, 1-band 16-bit, 1-band 32-bit, 3-band 8-bit 1 , 3-band 16-bit 2

Data will automatically be bit-shifted to have most-significant bits (MSB) in destination buffer

BayerXX8, BayerXX10, BayerXX12, BayerXX14, BayerXX16 where XX = GR, GB, BG or RG

1-band 8-bit, 1-band 16-bit

Demosaicing followed by RGB to Y (bit shift for MSB)

3-band 8-bit, 3-band 16-bit

Demosaicing (bit shift for MSB)

3-band YUV16 + M_PACKED

Demosaicing followed by RGB to YUV


1-band 8-bit

RGB to Y

3-band 8-bit

Direct copy

3-band YUV16 + M_PACKED


RGB10, RGBA10, RGB12, RGBA12, RGB14, RGBA14, RGB16, RGBA16

1-band 8-bit

RGB to Y (bit shift for MSB)

1-band 16-bit

RGB to Y

3-band 16-bit M_PLANAR

Packed destination buffers are not supported

YUV422_8, YCbCr601_422_8, YCbCr709_422_8

1-band 8-bit

Only Y component

3-band YUV16 + M_PACKED

Direct copy

1 3-band 8-bit buffers can be in any of the following formats: M_RGB24 + M_PLANAR, M_RGB24 + M_PACKED, M_BGR24 + M_PACKED, or M_BGR32 + M_PACKED.

2 3-band 16-bit buffers can be in either an M_RGB48 + M_PLANAR or M_RGB48 + M_PACKED format.

3 All of the values available for RGB are also available in BGR format.

Using the CoaXPress trigger signal on Matrox Rapixo CXP

The CoaXPress trigger signal is an embedded signal transmitted along the physical transport layer connection of your camera. Typically, the CoaXPress trigger signal is reserved for trigger information and is sent with other control and data signals along the same cable. On Matrox Rapixo CXP, the CoaXPress trigger signal is only supported from the frame grabber to the camera (that is, as an output signal).

To use this signal to trigger the camera, use MdigControl() with M_IO_SOURCE + M_TL_TRIGGER set to the appropriate auxiliary input signals (for example, M_AUX_IO4). Note that when you set the camera to capture an image only upon a trigger, you should disable grab triggered mode on the frame grabber (M_GRAB_TRIGGER_STATE set to M_DISABLE). For more information on performing a triggered grab, see the Grabbing with triggers section of Chapter 25: Grabbing with your digitizer.

Performing Bayer color conversion in hardware

When Matrox Rapixo CXP grabs color images from a video source with a Bayer color filter (as specified by the DCF), it performs Bayer color conversion in hardware, as it transfers the images to the Host. If the images require white balancing, Matrox Rapixo CXP can perform this automatically if white balancing is enabled using MdigControl() with M_WHITE_BALANCE set to M_ENABLE. If performing white balancing, you can use the default white balance coefficients, automatically have them calculated (using MdigControl() with M_WHITE_BALANCE set to M_CALCULATE), or set explicit coefficients (M_BAYER_COEFFICIENTS_ID). For information on Bayer color conversion, refer to the Using images acquired with a Bayer color filter section of Chapter 21: Data buffers.

If you don't want to perform Bayer color conversion in hardware, disable it using MdigControl() with M_BAYER_CONVERSION set to M_DISABLE.

The M_BAYER... control types of MdigControl() can only be used when grabbing from a camera that has a Bayer color filter (as specified by the DCF); otherwise, an error will be generated.

Using frame burst with a multi-frame buffer

Matrox Rapixo CXP supports frame burst technology. This technology allows you to grab a group of sequential frames into a multi-frame buffer with one grab command (MdigGrab(), or one grab of MdigProcess()); the defined number of frames are stored contiguously in the same buffer. The end-of-grab event only occurs once the entire group of frames has been grabbed, reducing the number of events that need to be handled. This is useful in cases where you have a high frame rate and need to ensure that no frames are missed. Note that a user-defined function hooked to the end-of-grab event (MdigProcess(), or MdigHookFunction() with M_GRAB_END) is executed only once the entire group of frames has been grabbed. For information on creating a multi-frame image buffer to store sequential frames, see the Specifying the dimensions of a multi-frame image buffer subsection of the Specifying the dimensions of a data buffer section of Chapter 21: Data buffers.

Extracting peaks from an on-board multi-frame image buffer

Matrox Rapixo CXP Pro can perform MimLocatePeak1d() on-board without Host intervention if the specified buffer is an on-board buffer. This functionality is only available if the loaded FPGA configuration contains the Matrox PU that supports this functionality. Supporting this function on-board allows the board to perform sheet of light (laser line) extraction. The sheet of light must appear horizontally in the image. The board can extract more than one peak per lane (up to 3). In addition, the board can operate on a single frame or multi-frame on-board image buffer. For more information on how to use MimLocatePeak1d() for peak extraction from a multi-frame image buffer, see the Extraction of peaks from a multi-frame buffer subsection of the Peak intensity detection and depth maps section of Chapter 5: Specialized image processing.