IImageRect Interface

<< Click to Display Table of Contents >>

Navigation:  CVB with GenICam > SDK > Supported Interfaces - GenICam Driver >

IImageRect Interface

 

IImageRect Interface description : image resolution changes

 
This interface can be used to change the resolution of the image or to inform the driver for resolution changes made previously in the hardware.
 

Changing Resolution over IImageRect

For cameras allowing to read out a reduced size or parts of the image this can be used with the IImageRect Interface.

The settings can be adjusted with the

ImageOffset and the ImageSize method of the CV Grabber Control or the

corresponding functions of the IImageRect Interface of the Driver Library.

Both approaches are documented in the Common Vision Blox Manual.

For testing, please use the CVB Image Manager Tutorials.

 

Inform the driver about changed  resolution or pixel format

With GenICam compliant cameras settings as resolution, pixel format and - if supported - binning or partial scan, can be changed in the camera directly.

If one of these settings is changed, the image object has to be updated.

You can restart the application or inform the driver about the changed resolution or pixel size.

This is necessary as the underlying image object holds preinitialised buffers where the image stream from the camera is written to.

When the size of the image changes the underlying image object need to be informed and the  buffers need to be reinitialized.

 

To do that you need to:

Change the setting in the camera (PixelType, image size, binning etc.) as described in the Camera Manual.

Call the IRImageSize function of the IImageRect with the IMAGERECT_CMD_RESET parameter.

This function will return a new image handle.

Pass this new handle to all components which reference the original image handle.

The original image handle does not hold a reference to the driver object anymore.
Normally this image is not needed anymore and should be released with the ReleaseObject function.

C# Example Code:

SharedImg imgNew;

int width = 0;

int height = 0;

int bResult = Cvb.Driver.IImageRect.IRImageSize

                (m_cvImage.Image,

                Cvb.Driver.IImageRect.TImageRectCMD.IMAGERECT_CMD_RESET,

                ref width,

                ref height,

                out imgNew);

 

if (bResult >= 0 && imgNew != 0)

{

  // Put new Image into Image and Display Control

  m_cvImage.Image = imgNew;

  m_cvDisplay.Image = m_cvImage.Image;

  m_cvDisplay.Refresh();

 

  // imgNew Object is not needed anymore as it is available in the Image OCX

  // dispose it here.

  imgNew.Dispose();

 

  // Update NodeMap and GenApiGrid

  this.ReadGenICamInfos();

  // Register all Callbacks

  this.RegisterCallbacks();

}

 

For details regarding the IImageRect interface please refer to the description in the Common Vision Blox Manual.