Returns the internal data pointer of a detected object.


int mira_GetObjDataInt(mrkernelpmr, int entryInd, int** ppObjData);


Parameters:

  • pmr: A pointer to the runtime kernel returned by mira_Init.
  • entryInd: Object index to get the data of, must be less than mira_GetObjCount.
  • ppObjData: A pointer to an integer pointer, should be NULL.


Return value:

MIRA_OK (0) or an error code.


Description:

mira_GetObjDataInt sets a pointer to point to an integer array containing information about the requested object. This array has the following fields available:

  • MIRA_OBJECT_ID (0): The unique object ID.
  • MIRA_OBJECT_FRAME (1): The frame index of the object's centroid.
  • MIRA_OBJECT_POS (2): The spatial pixel of the object's centroid.
  • MIRA_OBJECT_MINFRAME (3): The first frame index of the object, bounding box top.
  • MIRA_OBJECT_MAXFRAME (4): The last frame index of the object, bounding box bottom.
  • MIRA_OBJECT_MINCOL (5): The first spatial pixel of the object, bounding box left.
  • MIRA_OBJECT_MAXCOL (6): The last spatial pixel of the object, bounding box right.
  • MIRA_OBJECT_SIZE (7): The size of the object in pixels.
  • MIRA_OBJECT_CLASS (8): The object's decision index.


NOTE: The runtime keeps ownership of the pointer, therefore it must not be deleted.


Example:

  1. int objectCount = 0;
  2. int* pObjectData = NULL;

  3. while (frameInd < frameCount) {
  4.    mira_ProcessFrame(pmr, pFramePtr);

  5.    objectCount = mira_GetObjCount(pmr);
  6.    for (int i = 0; i < objectCount; i++) {
  7.        mira_GetObjDataInt(pmr, i, &pObjectData);

  8.        printf("obj%d : %d,%d\n",
  9.               pObjectData[MIRA_OBJECT_ID],
  10.               pObjectData[MIRA_OBJECT_FRAME],
  11.               pObjectData[MIRA_OBJECT_POS]);
  12.    }

  13.    pFramePtr += frameSize;
  14. }