Perception Tool Kit (PTK) API Guide
PTK Stereo OG Map creation process

Introduction

Data Structures

struct  PTK_Alg_StereoOG_BoxProp
 Stereo OG Map creation process - 3D bounding box property. More...
 
struct  PTK_Alg_StereoOG_obs3DBox
 Stereo OG Map creation process - 3D bounding boxes. More...
 
struct  PTK_Alg_StereoOG_CreateOGConfigParams
 Stereo OG Map creation process - config Parameters. More...
 
struct  PTK_Alg_StereoOG_CreateOGCamParams
 Stereo algorithm - camera Parameters. More...
 
struct  PTK_Alg_StereoOG_CreateOGParams
 Stereo OG Map creation process - OG Parameters. More...
 
struct  PTK_Alg_StereoOG_CreateOGAllParams
 Stereo OG Map creation process - All algorithm Parameters. More...
 
struct  PTK_Alg_StereoOG_GridProp
 Stereo OG Map creation process - Grid Property struct. More...
 
struct  PTK_Alg_StereoOG_OccupancyGrid
 Stereo OG Map creation process - OG struct. More...
 
struct  PTK_Alg_StereoOG_Object
 Stereo OG Map creation process - Object struct. More...
 
struct  PTK_Alg_StereoOG_OGConn
 Stereo OG Map creation process - OGConn struct. More...
 
struct  PTK_Alg_StereoOG_CreateOGObj
 Stereo algorithm - OG Map creation context. More...
 

Functions

PTK_Alg_StereoOG_BoxPropPTK_Alg_StereOG_get3DBB (PTK_Alg_StereoOG_obs3DBox *obsBB)
 Get bounding box pointer. More...
 
void PTK_Alg_StereoOG_CreateOGSetParams (PTK_Alg_StereoOG_CreateOGAllParams *params, PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Initialize OG Map creation parameters. More...
 
int32_t PTK_Alg_StereoOG_CreateOGConfig (PTK_Alg_StereoOG_CreateOGAllParams *params, PTK_Api_MemoryReq *memReq)
 Computes the memory requirements based on the given algorithm configuration parameters. More...
 
PTK_AlgHandle PTK_Alg_StereoOG_CreateOGInit (PTK_Alg_StereoOG_CreateOGAllParams *params, const PTK_Api_MemoryRsp *memRsp)
 Initializes the library based on the given algorithm configuration parameters and allocated memory blocks. More...
 
void PTK_Alg_StereoOG_createOG (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_PointCloud *pc, PTK_Alg_StereoOG_obs3DBox *obsBB)
 Root function to create OG map from point clouds. More...
 
int32_t PTK_Alg_StereoOG_CreateOGGetMem (PTK_Alg_StereoOG_CreateOGObj *cntxt, uint8_t *memPtr)
 Get memory size. More...
 
int32_t PTK_Alg_StereoOG_getGridPropMem (PTK_Alg_StereoOG_CreateOGObj *cntxt, uint8_t *memPtr)
 Get memory size for GridProp mem. More...
 
int32_t PTK_Alg_StereoOG_getOGMem (PTK_Alg_StereoOG_CreateOGObj *cntxt, uint8_t *memPtr)
 Get memory size for OG map. More...
 
int32_t PTK_Alg_StereoOG_getObjMem (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_Alg_StereoOG_Object *obj, uint8_t *memPtr)
 Get memory size for OG objects. More...
 
int32_t PTK_Alg_StereoOG_getOGConnMem (PTK_Alg_StereoOG_CreateOGObj *cntxt, uint8_t *memPtr)
 Get memory size for connected component analysis. More...
 
uint32_t PTK_Alg_StereoOG_getObsBBSize (const PTK_Alg_StereoOG_CreateOGParams *ogParams)
 Get memory size for object 3D bounding box on image without allocating memory. More...
 
PTK_Alg_StereoOG_obs3DBoxPTK_Alg_StereoOG_initObsBB (uint8_t *memPtr)
 Initialize bouning box structure using the given chunk of memory. More...
 
void PTK_Alg_StereoOG_addPoints (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_Point *points, int32_t numPoints)
 Add point clouds to OG map. More...
 
void PTK_Alg_StereoOG_CCA (PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Connected component analysis. More...
 
int16_t getNeighbor8Idx (PTK_Alg_StereoOG_CreateOGParams *ogParams, PTK_Alg_StereoOG_OGConn *ogConn, int32_t idx, int32_t xIdx, int32_t yIdx)
 Find 8 neighboring grids. More...
 
int16_t getNeighbor24Idx (PTK_Alg_StereoOG_CreateOGParams *ogParams, PTK_Alg_StereoOG_OGConn *ogConn, int32_t idx, int32_t xIdx, int32_t yIdx)
 Find 24 neighboring grids. More...
 
void PTK_Alg_StereoOG_mergeObjects (PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Merge neighboring objects. More...
 
bool PTK_Alg_StereoOG_mergeTwoObjects (PTK_Alg_StereoOG_Object *curObj, PTK_Alg_StereoOG_Object *newObj, int32_t gridSize, int16_t index)
 Merge neighboring objects. More...
 
void PTK_Alg_StereoOG_applyTemporalFilter (PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Apply temporal filtering of objects. More...
 
void PTK_Alg_StereoOG_findCorrespondence (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_Alg_StereoOG_Object *srcObj, PTK_Alg_StereoOG_Object *refObj, uint8_t direction)
 Find corresponding objects in two frames. More...
 
void PTK_Alg_StereoOG_associateCorrespondence (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_Alg_StereoOG_Object *curObj, PTK_Alg_StereoOG_Object *prevObj)
 Associate the objects in the current frame to the previous frame's object. The assocaited objects shuold have the matched forward serach and backward search. More...
 
void PTK_Alg_StereoOG_mergeObjectsTemporal (PTK_Alg_StereoOG_CreateOGObj *cntxt, int8_t direction)
 Merge the current (or previous) frame's object, which does not have
correspondences in the prvious (or current ) frame, with a close object in the same frame. More...
 
float PTK_Alg_StereoOG_computeDistanceObjects (uint8_t mode, PTK_Alg_StereoOG_Object *obj1, PTK_Alg_StereoOG_Object *obj2, int16_t idx1, int16_t idx2)
 Merge neighboring objects. More...
 
void PTK_Alg_StereoOG_createBB (PTK_Alg_StereoOG_CreateOGObj *cntxt, PTK_Alg_StereoOG_Object *object, PTK_Alg_StereoOG_obs3DBox *obsBB)
 Create 3D bounding boxes for detected objects. More...
 
void PTK_Alg_StereoOG_copyObjectInfo (PTK_Alg_StereoOG_Object *srcObj, PTK_Alg_StereoOG_Object *dstObj, int16_t srcIdx, int16_t dstIdx)
 Merge neighboring objects. More...
 
void PTK_Alg_StereoOG_resetOG (PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Reset OG. More...
 
void PTK_Alg_StereoOG_resetTemporalReference (PTK_Alg_StereoOG_CreateOGObj *cntxt)
 Reset temporal object reference. More...
 

Function Documentation

◆ PTK_Alg_StereOG_get3DBB()

PTK_Alg_StereoOG_BoxProp* PTK_Alg_StereOG_get3DBB ( PTK_Alg_StereoOG_obs3DBox obsBB)

Get bounding box pointer.

Parameters
[in,out]obsBBobject bounding box
Returns
pointer to bounding boxes

◆ PTK_Alg_StereoOG_CreateOGSetParams()

void PTK_Alg_StereoOG_CreateOGSetParams ( PTK_Alg_StereoOG_CreateOGAllParams params,
PTK_Alg_StereoOG_CreateOGObj cntxt 
)

Initialize OG Map creation parameters.

Parameters
[in]paramsAll algorithm configuration parameters for OG Map creation
[in]cntxtOG Map creation algorithm context

◆ PTK_Alg_StereoOG_CreateOGConfig()

int32_t PTK_Alg_StereoOG_CreateOGConfig ( PTK_Alg_StereoOG_CreateOGAllParams params,
PTK_Api_MemoryReq memReq 
)

Computes the memory requirements based on the given algorithm configuration parameters.

Parameters
[in]cntxtAlgorithm configuration parameters.
[in]memReqMemory requirements as specified below
  • entry [0]: Memory for internal context. Best allocated from the fastest memory.
  • entry [1]: Memory for internal point cloud. Best allocated from the fastest memory.
  • entry [2]: Memory for the output buffer. The output buffer is allocated by the Application so this entry is just to communicate the output buffer size. No need to pass the memory to the library in the init call PTK_Alg_SfmOgmapInit().
Returns
  • PTK_ALG_RET_SUCCESS, if successful
  • < error code, otherwise

◆ PTK_Alg_StereoOG_CreateOGInit()

PTK_AlgHandle PTK_Alg_StereoOG_CreateOGInit ( PTK_Alg_StereoOG_CreateOGAllParams params,
const PTK_Api_MemoryRsp memRsp 
)

Initializes the library based on the given algorithm configuration parameters and allocated memory blocks.

Parameters
[in]paramsAll algorithm configuration parameters.
[in]memRspMemory blocks as specified below
Returns
  • valid handle, if successful
  • NULL, otherwise

◆ PTK_Alg_StereoOG_createOG()

void PTK_Alg_StereoOG_createOG ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_PointCloud pc,
PTK_Alg_StereoOG_obs3DBox obsBB 
)

Root function to create OG map from point clouds.

Parameters
[in]cntxtalgorithm handle
[in]pcpoint cloud
[in]obsBBdetected object's bounding box info

◆ PTK_Alg_StereoOG_CreateOGGetMem()

int32_t PTK_Alg_StereoOG_CreateOGGetMem ( PTK_Alg_StereoOG_CreateOGObj cntxt,
uint8_t *  memPtr 
)

Get memory size.

Parameters
[in,out]cntxtAlgorithm handle.
[in]memPtrblock pointer
Returns
  • required memory size

◆ PTK_Alg_StereoOG_getGridPropMem()

int32_t PTK_Alg_StereoOG_getGridPropMem ( PTK_Alg_StereoOG_CreateOGObj cntxt,
uint8_t *  memPtr 
)

Get memory size for GridProp mem.

Parameters
[in,out]cntxtAlgorithm handle.
[in]memPtrblock pointer
Returns
  • required memory size for OG map

◆ PTK_Alg_StereoOG_getOGMem()

int32_t PTK_Alg_StereoOG_getOGMem ( PTK_Alg_StereoOG_CreateOGObj cntxt,
uint8_t *  memPtr 
)

Get memory size for OG map.

Parameters
[in,out]cntxtAlgorithm handle.
[in]memPtrblock pointer
Returns
  • required memory size for OG map

◆ PTK_Alg_StereoOG_getObjMem()

int32_t PTK_Alg_StereoOG_getObjMem ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_Alg_StereoOG_Object obj,
uint8_t *  memPtr 
)

Get memory size for OG objects.

Parameters
[in,out]cntxtAlgorithm handle.
[in,out]objObject structure
[in]memPtrblock pointer
Returns
  • required memory size for OG map

◆ PTK_Alg_StereoOG_getOGConnMem()

int32_t PTK_Alg_StereoOG_getOGConnMem ( PTK_Alg_StereoOG_CreateOGObj cntxt,
uint8_t *  memPtr 
)

Get memory size for connected component analysis.

Parameters
[in,out]cntxtAlgorithm handle.
[in]memPtrblock pointer
Returns
  • required memory size for OG map

◆ PTK_Alg_StereoOG_getObsBBSize()

uint32_t PTK_Alg_StereoOG_getObsBBSize ( const PTK_Alg_StereoOG_CreateOGParams ogParams)

Get memory size for object 3D bounding box on image without allocating memory.

Parameters
[in]ogParamsOG params.
Returns
  • required memory size for OG map

◆ PTK_Alg_StereoOG_initObsBB()

PTK_Alg_StereoOG_obs3DBox* PTK_Alg_StereoOG_initObsBB ( uint8_t *  memPtr)

Initialize bouning box structure using the given chunk of memory.

Parameters
[in]memPtrchunk of memory
Returns
  • pointer to object bounding box structure

◆ PTK_Alg_StereoOG_addPoints()

void PTK_Alg_StereoOG_addPoints ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_Point points,
int32_t  numPoints 
)

Add point clouds to OG map.

Parameters
[in]cntxtalgorithm handle
[in]pointspoints
[in]numPointsnumber of points

◆ PTK_Alg_StereoOG_CCA()

void PTK_Alg_StereoOG_CCA ( PTK_Alg_StereoOG_CreateOGObj cntxt)

Connected component analysis.

Parameters
[in]cntxtalgorithm handle

◆ getNeighbor8Idx()

int16_t getNeighbor8Idx ( PTK_Alg_StereoOG_CreateOGParams ogParams,
PTK_Alg_StereoOG_OGConn ogConn,
int32_t  idx,
int32_t  xIdx,
int32_t  yIdx 
)

Find 8 neighboring grids.

Parameters
[in]ogParamsOG params
[in]ogConnOGConn struct
[in]idx2D grid index
[in]xIdxX grid index
[in]yIdxY grid index
Returns
number of neighboring grids

◆ getNeighbor24Idx()

int16_t getNeighbor24Idx ( PTK_Alg_StereoOG_CreateOGParams ogParams,
PTK_Alg_StereoOG_OGConn ogConn,
int32_t  idx,
int32_t  xIdx,
int32_t  yIdx 
)

Find 24 neighboring grids.

Parameters
[in]ogParamsOG params
[in]ogConnOGConn struct
[in]idx2D grid index
[in]xIdxX grid index
[in]yIdxY grid index
Returns
number of neighboring grids

◆ PTK_Alg_StereoOG_mergeObjects()

void PTK_Alg_StereoOG_mergeObjects ( PTK_Alg_StereoOG_CreateOGObj cntxt)

Merge neighboring objects.

Parameters
[in,out]cntxtAlgorithm handle.

◆ PTK_Alg_StereoOG_mergeTwoObjects()

bool PTK_Alg_StereoOG_mergeTwoObjects ( PTK_Alg_StereoOG_Object curObj,
PTK_Alg_StereoOG_Object newObj,
int32_t  gridSize,
int16_t  index 
)

Merge neighboring objects.

Parameters
[in]curObjinput object [out] newObj output merged object [in] gridSize grid size [in] index input index to merge
Returns
true if any objects are merged, false otherwise

◆ PTK_Alg_StereoOG_applyTemporalFilter()

void PTK_Alg_StereoOG_applyTemporalFilter ( PTK_Alg_StereoOG_CreateOGObj cntxt)

Apply temporal filtering of objects.

Parameters
[in,out]cntxtAlgorithm handle.

◆ PTK_Alg_StereoOG_findCorrespondence()

void PTK_Alg_StereoOG_findCorrespondence ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_Alg_StereoOG_Object srcObj,
PTK_Alg_StereoOG_Object refObj,
uint8_t  direction 
)

Find corresponding objects in two frames.

Parameters
[in]cntxtAlgorithm handle [in] srcObj source objects for which correspondences need to be found [in] refObj reference objects to be searched [in] direction search direction

◆ PTK_Alg_StereoOG_associateCorrespondence()

void PTK_Alg_StereoOG_associateCorrespondence ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_Alg_StereoOG_Object curObj,
PTK_Alg_StereoOG_Object prevObj 
)

Associate the objects in the current frame to the previous frame's object. The assocaited objects shuold have the matched forward serach and backward search.

Parameters
[in]cntxtAlgorithm handle [inout] curObj current frame objects [in] prevObj previous frame objects

◆ PTK_Alg_StereoOG_mergeObjectsTemporal()

void PTK_Alg_StereoOG_mergeObjectsTemporal ( PTK_Alg_StereoOG_CreateOGObj cntxt,
int8_t  direction 
)

Merge the current (or previous) frame's object, which does not have
correspondences in the prvious (or current ) frame, with a close object in the same frame.

Parameters
[in,out]cntxtAlgorithm handle [in] direction 0: backward, 1: forward

◆ PTK_Alg_StereoOG_computeDistanceObjects()

float PTK_Alg_StereoOG_computeDistanceObjects ( uint8_t  mode,
PTK_Alg_StereoOG_Object obj1,
PTK_Alg_StereoOG_Object obj2,
int16_t  idx1,
int16_t  idx2 
)

Merge neighboring objects.

Parameters
[in]modedistance compute mode [in] obj1 input object struct 1 [in] obj2 input object struct 2 [in] idx1 object index in obj1, with which distance is computed [in] idx2 object index in obj2, with which distance is computed
Returns
distance between two objects

◆ PTK_Alg_StereoOG_createBB()

void PTK_Alg_StereoOG_createBB ( PTK_Alg_StereoOG_CreateOGObj cntxt,
PTK_Alg_StereoOG_Object object,
PTK_Alg_StereoOG_obs3DBox obsBB 
)

Create 3D bounding boxes for detected objects.

Parameters
[in,out]cntxtAlgorithm handle. [in] object pointer to the detected objects. [out] obsBB pointer to objects' bounding boxes on image

◆ PTK_Alg_StereoOG_copyObjectInfo()

void PTK_Alg_StereoOG_copyObjectInfo ( PTK_Alg_StereoOG_Object srcObj,
PTK_Alg_StereoOG_Object dstObj,
int16_t  srcIdx,
int16_t  dstIdx 
)

Merge neighboring objects.

Parameters
[in]srcObjsrc object struct, from which an object is copied [in] dstObj dst object struct, to which an object is copied [in] srcIdx object index in srcObj that will be copied to dstObj [in] dstIdx object index in dstObj that an object will be copied to
Returns
distance between two objects

◆ PTK_Alg_StereoOG_resetOG()

void PTK_Alg_StereoOG_resetOG ( PTK_Alg_StereoOG_CreateOGObj cntxt)

Reset OG.

Parameters
[in]cntxtAlgorithm handle

◆ PTK_Alg_StereoOG_resetTemporalReference()

void PTK_Alg_StereoOG_resetTemporalReference ( PTK_Alg_StereoOG_CreateOGObj cntxt)

Reset temporal object reference.

Parameters
[in]cntxtAlgorithm handle