Read information on segmented out objects

int mira_GetObjDataInt(mrkernel* pmr, int entryInd, int** ppObjData);


  • Runtime environment pointer
  • entryID - zero-based index of an object
  • ppObjData - pointer to a pointer to a table with object information

Output: Result (MIRA_OK or error)


mira_GetObjDataInt returns details on a specific object found. The first parameter is a zero-based object index (0..number of objects found -1). The second parameter represents an object table. The example below illustrates that we declare a pointer to int called pObjData and initialize its value to NULL. In an acquisition loop, after processing a frame, if an object is found, we call mira_GetObjDataInt in a for loop extracting object information. Note, that we pass address of the pObjData to the mira_GetObjDataInt.

The object table:

MIRA_OBJECT_ID          Unique object identifier

MIRA_OBJECT_FRAME     1  Frame index for the object centroid

MIRA_OBJECT_POS       2  Position of the object centroid across the belt

MIRA_OBJECT_MINFRAME  3  Bounding box coordinates:




MIRA_OBJECT_SIZE      7  Object size in pixels

MIRA_OBJECT_CLASS     8  Object class index


   int objCount=0;

   int* pObjData=NULL; /* pointer to object table data */

   while( frameInd<frameCount ) {



       if( objCount>0 ) {

           for(int i=0;i<objCount;i++) {

               /* we pass address of a pointer to receive object table

                  allocated by the runtime */


               /* pObjData allows us to access object details */

               printf("\n obj%d : %d,d ",


                      pObjData[MIRA_OBJECT_FRAME],   /* along the belt */

                      pObjData[MIRA_OBJECT_POS] );   /* across the belt */

                  } /* end of for loop */

        } /* end of if objects */

   } /* end of frame acquisiion */