IMVRegionOfInterest
The IMVRegionOfInterest interface offers methods to control the ROIs (Region Of Interest) of a filters algorithm on a MontiVision image processing filter. Most of the MontiVision image processing filters allow to set a region of interest on the input and output pin. Be sure to set equal input and output ROIs, if you want to see the processed region at its original position. Some filters also support a channel of interest processing. COIs allow to process a selected color channel of an image, for example if you only modify the red pixel in an RGB image. Read the remarks for implementation details.
| GetROISupportInput | Returns information about the input pins ROI support. |
| GetROISupportOutput | Returns information about the output pins ROI support. |
| get_SelectedROIPin | Returns the currently selected ROI pin. |
| put_SelectedROIPin | Sets the selected ROI pin |
| get_ROIPinDirection | Returns the current pin direction (input/output). |
| put_ROIPinDirection | Sets the current pin direction (input/output). |
| GetROI | Returns the ROI on the selected pin. |
| PutROI | Sets the ROI on the selected pin. |
| GetCOISupportInfo | Returns information about the filters COI support. |
| get_COI | Returns the COI. |
| put_COI | Sets the COI. |
| get_CopyBackground | Returns the background copy status. |
| put_CopyBackground | Sets the background copy status. |
Header
file: iMVRegionOfInterest.h
Interface definition language file:
iMVRegionOfInterest.idl
Interface ID:IID_IMVRegionOfInterest
HRESULT GetROISupportInput( [out, retval] int *piSupported );
Returns information about the input pins ROI support.
Parameter:
| piSupported | A pointer to an integer value that receives the information about the ROI support. TRUE (1) signals that the ROI is supported otherwise the method returns FALSE (0). |
HRESULT GetROISupportOutput( [out, retval] int *piSupported );
Returns information about the output pins ROI support.
Parameter:
| piSupported | A pointer to an integer value that receives the information about the ROI support. TRUE (1) signals that the ROI is supported otherwise the method returns FALSE (0). |
HRESULT get_SelectedROIPin( [out, retval] int *piActualPin );
Returns the currently selected ROI pin.
Parameter:
| piActualPin | A pointer to an integer value that receives the number of the current ROI pin. |
HRESULT put_SelectedROIPin( [in ] int iActualPin );
Sets the selected ROI pin.
Parameter:
| iActualPin | The selected ROI pin. |
HRESULT get_ROIPinDirection( [out, retval] int *piPinDirection );
Returns the direction of the ROI pin.
| Value | Description |
| 0 | Output pin. |
| 1 | Input Pin |
Parameter:
| piPinDirection | A pointer to an integer value that receives the direction of the ROI pin. |
HRESULT put_ROIPinDirection( [in ] int iPinDirection );
Sets the direction of the ROI pin.
| Value | Description |
| 0 | Output pin. |
| 1 | Input Pin |
Parameter:
| iPinDirection | The direction of the ROI pin. |
HRESULT GetROI( [out] int *piXOffset, [out] int *piYOffset, [out] int *piWidth, [out] int *piHeight );
Returns the ROI of the image on the selected pin.
Parameter:
| piXOffset | A pointer to an integer value that receives the ROIs X offset. | |
| piYOffset | A pointer to an integer value that receives the ROIs y offset. | |
| piWidth | A pointer to an integer value that receives the ROI width. | |
| piHeight | A pointer to an integer value that receives the ROI height. |
HRESULT PutROI( [in ] int iXOffset, [in ] int iYOffset, [in ] int iWidth, [in] int iHeight );
Sets the ROI of the image on the selected pin.
Parameter:
| iXOffset | ROI X offset. | |
| iYOffset | ROI y offset. | |
| iWidth | ROI width. | |
| iHeight | ROI height. |
HRESULT GetCOISupportInfo( [out, retval] int *piCOI );
Returns information about the filters COI support.
Parameter:
| piCOI | A pointer to an integer value that receives the information about the filters COI support. TRUE (1) signals that the COI is supported otherwise the method returns FALSE (0). |
HRESULT get_COI( [out, retval] int *piCOI );
Returns the COI of the image on the selected info pin..
Parameter:
| piCOI | A pointer to an integer value that receives the COI as MV_COLOR_CHANNEL. |
HRESULT put_COI( [in ] int iCOI );
Sets the COI of the image on the selected info pin..
Parameter:
| iCOI | COI asMV_COLOR_CHANNEL. |
HRESULT get_CopyBackground( [out, retval] int *piBackground );
Returns the information about the background status. If it returns TRUE (1), the background image is copied before the algorithm starts to process the image. Background copy makes sense when only a ROI is processed instead of the full image region.
Parameter:
| piBackground | A pointer to an integer value that receives the background status. TRUE (1) signals thats the original image is coppied otherwise the method returns FALSE (0). |
HRESULT put_CopyBackground( [in ] int iBackground );
Sets the background copy status. Useful if only a ROI of the image is processed.
Parameter:
| iBackground | Background copy status. TRUE (1) enables and FALSE (0) disables the copy function. |
The following sequence is used to set the ROI of an input pin to half the width and half the heigth of the image.
int iNumOfInPins, iWidth, iHeight,
iChannel;
IMVFilterInfo *pIMVFilterInfo;
IMVRegionOfInterest *pIRegionOfInterest;
...
pIMVFilterInfo->get_NumOfInPins( &iInputPins );
if( iNumOfInPins > 0 )
{
pIMVRegionOfInterest->get_ROISupportInput(
&iSupported );
if( iSupported == TRUE )
{
pIMVRegionOfInterest->put_ROIPinDirection( MV_INPUT_PIN );
pIMVRegionOfInterest->put_SelectedInfoPin( 0 );
pIMVFilterInfo->GetImageInfo( &iWidth, &iHeight,
&iChannel );
pIMVRegionOfInterest->PutROI(
0, 0, iWidth/2, iHeight/2 );
}
}