Working with Rectangle AOIs

mvIMPACT Go!, mvIMPACT S, mvIMPACT SDK

The reason for the incorrect display of the rectangular AOI is the missing last point of the definition. Rectangular AOIs have to be constructed out of 5 points, whereas the first and the last point contain identical data.

SetAoi(...) has to be modified like shown below to fix the problem:

BOOL __fastcall COcrApp :: SetAoi ( IPL_RECT *paoi )
{
BOOL result = FALSE ;
if ( DISP_ControlOoi ( m_Oois, m_Roi, (DISP_OOICONTROLTYPE)(DISP_OOI_POSINDEX+0), &paoi->left ) )
if ( DISP_ControlOoi ( m_Oois, m_Roi, (DISP_OOICONTROLTYPE)(DISP_OOI_POSINDEX+1), &paoi->right ) )
if ( DISP_ControlOoi ( m_Oois, m_Roi, (DISP_OOICONTROLTYPE)(DISP_OOI_POSINDEX+2), &paoi->top ) )
if ( DISP_ControlOoi ( m_Oois, m_Roi, (DISP_OOICONTROLTYPE)(DISP_OOI_POSINDEX+3), &paoi->bottom ) )
if ( DISP_ControlOoi ( m_Oois, m_Roi, (DISP_OOICONTROLTYPE)(DISP_OOI_POSINDEX+4), &paoi->left ) )
result = TRUE ;
return result ;

Back