Some of the XIMEA cameras are able to deliver multiple regions of interest (ROI) from a captured image.
By skipping the rest of the pixels the frame-rate of a camera can be increased.
Feature related parameters |
XI_PRM_WIDTH |
XI_PRM_HEIGHT |
XI_PRM_OFFSET_X |
XI_PRM_OFFSET_Y |
XI_PRM_REGION_SELECTOR |
XI_PRM_REGION_MODE |
Models |
MQ042xG-CM |
MQ022xG-CM |
MQ003xG-CM |
Selecting a region:
The Multiple ROI visualized:
// 1. Resize the main region - region 0.
xiSetParamInt(xiH, XI_PRM_REGION_SELECTOR,0); // default is 0
xiSetParamInt(xiH,XI_PRM_WIDTH, 200); // This is the width for all regions
xiSetParamInt(xiH,XI_PRM_HEIGHT, 100); // Decrease height (to enable other regions)
xiSetParamInt(xiH,XI_PRM_OFFSET_X, 100); // This is the x_offset for all regions
// 2. Configure another region.
xiSetParamInt(xiH,XI_PRM_REGION_SELECTOR, 1); // Selects region 1.
xiSetParamInt(xiH,XI_PRM_HEIGHT, 200); // This is the new height of region 1
xiSetParamInt(xiH,XI_PRM_OFFSET_Y, 200); // This is th Y-offset of region 1
xiSetParamInt(xiH,XI_PRM_REGION_MODE, 1); // Atcivate (1), or deactivate (0) selected region.
// 3. Start acquisition
xiStartAcquisition(xiH);
xiGetImage(xiH, 5000, &image);
%Multiple ROI myCam.SetParam(xiApi.NET.PRM.REGION_SELECTOR, 0) %Select region 0 (has to be resized first) myCam.SetParam(xiApi.NET.PRM.WIDTH, 200) myCam.SetParam(xiApi.NET.PRM.HEIGHT, 100) % Decrease height of the the region 0 myCam.SetParam(xiApi.NET.PRM.REGION_SELECTOR, 1) % Select region 1 myCam.SetParam(xiApi.NET.PRM.HEIGHT, 200) % Resize this region 1 myCam.SetParam(xiApi.NET.PRM.OFFSET_Y, 200) % Set the offset of region 1 myCam.SetParam(xiApi.NET.PRM.REGION_MODE, 1) % Enable region in multiple ROI % Acquisition StartAcquisition(myCam); bmap=GetImage(myCam,1000);
Example for our OpenCV xiAPI+ library:
// 1. Resize the main region - region 0.
cam.SetRegion_selector(0); // default is 0
cam.SetWidth(200); // This is the width for all regions
cam.SetHeight(100);
cam.SetOffsetX(100); // This is the x_offset for all regions
// 2. Configure another region.
cam.SetRegion_selector(1); // Selects region 1.
cam.SetHeight(200); // This is the new height of region 1
cam.SetOffsetY(200); // This is th Y-offset of region 1
cam.SetRegion_mode(1); // Atcivate (1), or deactivate (0) the selected re gion.
// 3. Start acquisition.
cam.StartAcquisition();
Mat cv_mat_image = cam.GetNextImageOcvMat();
cv::imshow("Image from the camera",cv_mat_image);
You may find more information on multiple ROI support in our API manuals: