mira_GetObjDataInt
Returns the internal data pointer of a detected object.
int mira_GetObjDataInt(mrkernel* pmr, 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:
- int objectCount = 0;
- int* pObjectData = NULL;
- while (frameInd < frameCount) {
- mira_ProcessFrame(pmr, pFramePtr);
- objectCount = mira_GetObjCount(pmr);
- for (int i = 0; i < objectCount; i++) {
- mira_GetObjDataInt(pmr, i, &pObjectData);
- printf("obj%d : %d,%d\n",
- pObjectData[MIRA_OBJECT_ID],
- pObjectData[MIRA_OBJECT_FRAME],
- pObjectData[MIRA_OBJECT_POS]);
- }
- pFramePtr += frameSize;
- }