Binning and ROI

This chapter shows how to handle a video capture device that supports binning and ROI on the sensor.

Setting a Video Format with Binning and ROI

In case your video capture device supports binning and ROI, then the most simple way to set a binning and ROI using video format is:

cGrabber.setVideoFormat("RGB32 (640x188) [Binning 4x]");

Enumerate Video Format Descriptions

The available binning mode and corresponding ROI ranges are described by the device's collection of VideoFormatDescs. The following sample code shows how to enumerate the video format descriptions:

Grabber::tVidFmtDescListPtr DecriptionList;
DecriptionList = cGrabber.getAvailableVideoFormatDescs();
for( Grabber::tVidFmtDescList::iterator pDescription = DecriptionList->begin(); pDescription != DecriptionList->end(); pDescription++ )
{
    printf("%s\n", (*pDescription)->toString().c_str());
}

The loop will give a result like this (the exact output depends on the video capture device):

RGB32 (96x96-2592x1944)
RGB32 (96x96-1296x972) [Binning 2x]
RGB32 (96x96-648x484) [Binning 4x]
Y800 (96x96-2592x1944)
Y800 (96x96-1296x972) [Binning 2x]
Y800 (96x96-648x484) [Binning 4x]
BY8 (96x96-2592x1944)
BY8 (96x96-1296x972) [Binning 2x]
BY8 (96x96-648x484) [Binning 4x]
RGB24 (96x96-2592x1944)
RGB24 (96x96-1296x972) [Binning 2x]
RGB24 (96x96-648x484) [Binning 4x]

In this example, the text RGB32 (96x96-1296x972) [Binning 2x] means that when using the pixel format RGB32 and binning 2x, the device supports a resolution from 96x96 up to 1296x972.

<< Programmer's Guide