Perception Tool Kit (PTK) API Guide
stereo_object_detect.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2019 Texas Instruments Incorporated
4  *
5  * All rights reserved not granted herein.
6  *
7  * Limited License.
8  *
9  * Texas Instruments Incorporated grants a world-wide, royalty-free, non-exclusive
10  * license under copyrights and patents it now or hereafter owns or controls to make,
11  * have made, use, import, offer to sell and sell ("Utilize") this software subject to the
12  * terms herein. With respect to the foregoing patent license, such license is granted
13  * solely to the extent that any such patent is necessary to Utilize the software alone.
14  * The patent license shall not apply to any combinations which include this software,
15  * other than combinations with devices manufactured by or for TI ("TI Devices").
16  * No hardware patent is licensed hereunder.
17  *
18  * Redistributions must preserve existing copyright notices and reproduce this license
19  * (including the above copyright notice and the disclaimer and (if applicable) source
20  * code license limitations below) in the documentation and/or other materials provided
21  * with the distribution
22  *
23  * Redistribution and use in binary form, without modification, are permitted provided
24  * that the following conditions are met:
25  *
26  * * No reverse engineering, decompilation, or disassembly of this software is
27  * permitted with respect to any software provided in binary form.
28  *
29  * * any redistribution and use are licensed by TI for use only with TI Devices.
30  *
31  * * Nothing shall obligate TI to provide you with source code for the software
32  * licensed and provided to you in object code.
33  *
34  * If software source code is provided to you, modification and redistribution of the
35  * source code are permitted provided that the following conditions are met:
36  *
37  * * any redistribution and use of the source code, including any resulting derivative
38  * works, are licensed by TI for use only with TI Devices.
39  *
40  * * any redistribution and use of any object code compiled from the source code
41  * and any resulting derivative works, are licensed by TI for use only with TI Devices.
42  *
43  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers
44  *
45  * may be used to endorse or promote products derived from this software without
46  * specific prior written permission.
47  *
48  * DISCLAIMER.
49  *
50  * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
51  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
52  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
53  * IN NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
54  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
55  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
56  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
57  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
58  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
59  * OF THE POSSIBILITY OF SUCH DAMAGE.
60  *
61  */
62 #ifndef _STEREO_OBJECT_DETECT_H_
63 #define _STEREO_OBJECT_DETECT_H_
64 
65 #ifdef __cplusplus
66 extern "C" {
67 #endif
68 
69 #include <perception/perception.h>
73 #include <perception/base/matrix.h>
74 
76 #define MAX_DETECTIONS 40
77 
82 typedef struct {
84  float depth;
85 
87  int32_t p1x;
88 
90  int32_t p1y;
91 
93  int32_t p2x;
94 
96  int32_t p2y;
97 
99  int32_t p3x;
100 
102  int32_t p3y;
103 
105  int32_t p4x;
106 
108  int32_t p4y;
110 
111 
116 typedef struct {
119 
121  int32_t p1x;
122 
124  int32_t p1y;
125 
127  int32_t p2x;
128 
130  int32_t p2y;
131 
133  int32_t p3x;
134 
136  int32_t p3y;
137 
139  int32_t p4x;
140 
142  int32_t p4y;
144 
145 
150 typedef struct{
152  float offset;
153 
155  float dx;
157 
158 
163 typedef struct
164 {
166  float disparities[2];
167 
169  float depths[2];
170 
172  int32_t windowHeights[2];
173 
175  int32_t bottomYs[2];
176 
178  int32_t xLocations[2];
179 
182 
184  int8_t isValid;
185 
189 
190 
195 typedef struct
196 {
199 
201  int32_t numDetections;
202 
204 
205 
210 typedef struct
211 {
214 
217 
220 
222 
223 
228 typedef struct
229 {
232 
235 
237  float windowHeightRatioRange[2];
238 
241 
246 
249 
251 
252 
257 typedef struct
258 {
260  int32_t depthThreshold;
261 
264 
267 
270 
272 
277 typedef struct
278 {
281 
284 
287 
289 
290 
295 typedef struct
296 {
299 
302 
305 
308 
311 
314 
317 
320 
323 
326 
327 
329 
330 
331 
336 typedef struct
337 {
340 
343 
346 
349 
352 
354  uint8_t * inputImage;
355 
357  uint8_t * dispConfidence;
358 
360  int16_t * disparity;
361 
364 
367 
370 
373 
375  float * dataBuffer[2];
376 
378  float * A;
379 
381  float * At;
382 
384  float * b;
385 
387  int16_t * inlierIdx;
388 
390  int16_t * bestInlierIdx;
391 
393  int16_t * freeDriveSpace;
394 
396 
397 
411 
412 
437  PTK_Api_MemoryReq * memReq);
438 
439 
454  const PTK_Api_MemoryRsp * memRsp);
455 
456 
457 
467 
468 
469 
470 /* PRIVATE APIS (not visible to OVX node) */
471 
472 #ifdef __cplusplus
473 }
474 #endif
475 
476 #endif
PTK_Alg_StereoAlgo_closestObsParams fcdParams
Definition: stereo_object_detect.h:316
float maxDisparityDifference
Definition: stereo_object_detect.h:245
int32_t * closestHeightPrior
Definition: stereo_object_detect.h:366
PTK_Alg_StereoAlgo_mergeObsParams moParams
Definition: stereo_object_detect.h:322
PTK_Alg_StereoAlgo_detectObsParams doParams
Definition: stereo_object_detect.h:319
Stereo algorithm - drivable space structure.
Definition: stereo_object_detect.h:116
Stereo algorithm - detected obstacle parameters.
Definition: stereo_object_detect.h:228
int32_t p3y
Definition: stereo_object_detect.h:136
int32_t PTK_Alg_StereoAlgo_ObjectDetectGetMem(PTK_Alg_StereoAlgo_ObjectDetectObj *cntxt, uint8_t *memPtr)
Get memory size.
int16_t * freeDriveSpace
Definition: stereo_object_detect.h:393
PTK_Alg_StereoAlgo_dispParams dispParams
Definition: stereo_object_detect.h:307
uint8_t maxHorizontalSkip
Definition: stereo_object_detect.h:263
PTK_Alg_StereoAlgo_ObjectDetect_allParams allParams
Definition: stereo_object_detect.h:339
int32_t p1y
Definition: stereo_object_detect.h:124
int32_t p3x
Definition: stereo_object_detect.h:99
Stereo algorithm - obstacle detection algorithm context.
Definition: stereo_object_detect.h:336
float drivableDepth
Definition: stereo_object_detect.h:118
uint8_t * inputImage
Definition: stereo_object_detect.h:354
uint8_t minSplitComponentWidth
Definition: stereo_object_detect.h:280
int32_t p2x
Definition: stereo_object_detect.h:93
PTK_Alg_StereoAlgo_obstacleDetetionMems algoMemData
Definition: stereo_object_detect.h:342
int32_t p4x
Definition: stereo_object_detect.h:139
int32_t p2y
Definition: stereo_object_detect.h:130
float * At
Definition: stereo_object_detect.h:381
Stereo algorithm - array of detected obstacels in a frame.
Definition: stereo_object_detect.h:195
Stereo algorithm - obstacle split parameters.
Definition: stereo_object_detect.h:277
void * PTK_AlgHandle
Algorithm Handle.
Definition: alg_common.h:79
PTK_Alg_StereoAlgo_roadParams roadParams
Definition: stereo_object_detect.h:304
int32_t p1x
Definition: stereo_object_detect.h:121
int32_t minSearchBoxSize
Definition: stereo_object_detect.h:216
PTK_Alg_StereoAlgo_obsDetection * detections
Definition: stereo_object_detect.h:198
uint8_t maxHorizontalToSkip
Definition: stereo_object_detect.h:231
float splitInlierThreshold
Definition: stereo_object_detect.h:283
int32_t p4x
Definition: stereo_object_detect.h:105
int32_t p2y
Definition: stereo_object_detect.h:96
Stereo algorithm - road Parameters.
Definition: stereo_algo.h:175
PTK_Alg_StereoAlgo_lineModel detectionLineModel
Definition: stereo_object_detect.h:187
Stereo algorithm - four corners of a detected obstacle bounding box.
Definition: stereo_object_detect.h:82
Stereo algorithm - V-disparity ground plane model array for multiple models.
Definition: stereo_algo.h:448
Stereo algorithm - road Parameters.
Definition: stereo_algo.h:148
int32_t p1x
Definition: stereo_object_detect.h:87
float depth
Definition: stereo_object_detect.h:84
uint8_t minHorizontalLength
Definition: stereo_object_detect.h:234
float * sortedDisparity
Definition: stereo_object_detect.h:372
PTK_Alg_StereoAlgo_obsDetectionArray * oda2
Definition: stereo_object_detect.h:351
int32_t PTK_Alg_StereoAlgo_ObjectDetectConfig(PTK_Alg_StereoAlgo_ObjectDetect_allParams *cntxt, PTK_Api_MemoryReq *memReq)
Computes the memory requirements based on the given algorithm configuration parameters.
float dx
Definition: stereo_object_detect.h:155
int32_t p3y
Definition: stereo_object_detect.h:102
PTK_Alg_StereoAlgo_bottomObsParams fbooParams
Definition: stereo_object_detect.h:313
Stereo algorithm - all required parameters structure for obstacle detection.
Definition: stereo_object_detect.h:295
Stereo algorithm - disparity parameters.
Definition: stereo_algo.h:226
PTK_Alg_StereoAlgo_groundModelParams_Array * gmParamsArr
Definition: stereo_object_detect.h:345
uint8_t * dispConfidence
Definition: stereo_object_detect.h:357
Stereo algorithm - obstacle merge parameters.
Definition: stereo_object_detect.h:257
Stereo algorithm - Data mems needed for algorithms.
Definition: stereo_algo.h:462
PTK_Alg_StereoAlgo_splitObsParams soParams
Definition: stereo_object_detect.h:325
float obsProbabilityMinDisparityToAccept
Definition: stereo_object_detect.h:248
Declarations for PTK_Matrix struct+functions.
int32_t p2x
Definition: stereo_object_detect.h:127
int32_t numDetections
Definition: stereo_object_detect.h:201
int32_t p4y
Definition: stereo_object_detect.h:108
float * b
Definition: stereo_object_detect.h:384
Stereo algorithm - closest obstacle parameters.
Definition: stereo_object_detect.h:210
PTK_Alg_StereoAlgo_obsProbParams copppParams
Definition: stereo_object_detect.h:310
PTK_Alg_StereoAlgo_configParams odConfig
Definition: stereo_object_detect.h:298
API memory allocation response.
Definition: api_memory_if.h:158
int32_t p1y
Definition: stereo_object_detect.h:90
Stereo algorithm - config Parameters.
Definition: stereo_algo.h:110
int16_t * disparity
Definition: stereo_object_detect.h:360
int32_t depthThreshold
Definition: stereo_object_detect.h:260
int32_t originalDetectedArea
Definition: stereo_object_detect.h:181
float adaptiveTerminationPercentage
Definition: stereo_object_detect.h:240
float * closestDisparity
Definition: stereo_object_detect.h:363
float statisticsNearestPercent
Definition: stereo_object_detect.h:219
int16_t * bestInlierIdx
Definition: stereo_object_detect.h:390
API memory allocation request.
Definition: api_memory_if.h:125
float tiltThreshold
Definition: stereo_object_detect.h:266
int16_t * inlierIdx
Definition: stereo_object_detect.h:387
int32_t p3x
Definition: stereo_object_detect.h:133
void PTK_Alg_StereoAlgo_ObjectDetectSetParams(PTK_Alg_StereoAlgo_ObjectDetect_allParams *allPararms, PTK_Alg_StereoAlgo_ObjectDetectObj *cntxt)
Initialize obstacle detection parameters.
Stereo algorithm - line model for detected obstacle bounding box.
Definition: stereo_object_detect.h:150
PTK_Alg_StereoAlgo_camParams camParams
Definition: stereo_object_detect.h:301
int8_t isValid
Definition: stereo_object_detect.h:184
int32_t * closestHeightComputed
Definition: stereo_object_detect.h:369
PTK_Alg_StereoAlgo_obsDetectionArray * oda1
Definition: stereo_object_detect.h:348
Stereo algorithm - bottom of obstacle parameter.
Definition: stereo_algo.h:347
int32_t p4y
Definition: stereo_object_detect.h:142
Stereo algorithm - properties of a detected obstacles.
Definition: stereo_object_detect.h:163
float adaptiveTerminationPercentage
Definition: stereo_object_detect.h:286
PTK_AlgHandle PTK_Alg_StereoAlgo_ObjectDetectInit(PTK_Alg_StereoAlgo_ObjectDetect_allParams *allParams, const PTK_Api_MemoryRsp *memRsp)
Initializes the library based on the given algorithm configuration parameters and allocated memory bl...
Stereo algorithm - obstacle probability (per pixel) parameters.
Definition: stereo_algo.h:313
float offset
Definition: stereo_object_detect.h:152
float adaptiveTerminationPercentage
Definition: stereo_object_detect.h:269
int32_t statisticsBoxHeight
Definition: stereo_object_detect.h:213
float * A
Definition: stereo_object_detect.h:378