Vision Apps User Guide
tivx_stereo_kernels.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 
63 #ifndef TIVX_STEREO_KERNELS_H_
64 #define TIVX_STEREO_KERNELS_H_
65 
66 #include <VX/vx.h>
67 #include <VX/vx_kernels.h>
68 #if defined(PC)
69 #include <perception/perception.h>
70 #endif
71 
72 #include <perception/algos.h>
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
96 #define TIVX_MODULE_NAME_STEREO "stereo"
97 
98 
102 #define TIVX_KERNEL_POINT_CLOUD_CREATION_NAME "com.ti.stereo.point_cloud_creation"
103 
107 #define TIVX_KERNEL_OCCUPANCY_GRID_DETECTION_NAME "com.ti.stereo.occupancy_grid_detection"
108 
112 #define TIVX_KERNEL_SDE_HISTOGRAM_VISUALIZE_NAME "com.ti.stereo.sde_histogram_visualize"
113 
117 #define TIVX_KERNEL_SDE_TRIANGULATION_NAME "com.ti.stereo.sde_triangulation"
118 
122 #define TIVX_KERNEL_DISPARITY_MERGE_NAME "com.ti.stereo.disparity_merge"
123 
127 #define TIVX_KERNEL_MEDIAN_FILTER_NAME "com.ti.stereo.median_filter"
128 
132 #define TIVX_KERNEL_HOLE_FILLING_NAME "com.ti.stereo.hole_filling"
133 
137 #define TIVX_KERNEL_EXTRACT_DISPARITY_CONFIDENCE_NAME "com.ti.stereo.extract_disparity_confidence"
138 
142 #define TIVX_KERNEL_GROUND_ESTIMATION_NAME "com.ti.stereo.ground_estimation"
143 
147 #define TIVX_KERNEL_OBSTACLE_DETECTION_NAME "com.ti.stereo.obstacle_detection"
148 
152 #define TIVX_KERNEL_SDE_DISPARITY_VISUALIZE_NAME "com.ti.stereo.sde_disparity_visualize"
153 
154 
158 #define TIVX_KERNEL_GROUND_ESTIMATION_RESET (0U)
159 
163 #define TIVX_KERNEL_OCCUPANCY_GRID_DETECTION_RESET (1U)
164 
165 
173 typedef struct {
174  vx_float32 baseline;
175  vx_float32 scale_x;
176  vx_float32 scale_y;
177  vx_float32 focal_length;
178  vx_uint16 dist_center_x;
179  vx_uint16 dist_center_y;
181 
182 
190 typedef struct {
191  vx_uint8 usePCConfig;
192  vx_uint8 subSampleRatio;
193  vx_uint8 thConfidence;
194  vx_float32 lowLimitX;
195  vx_float32 highLimitX;
196  vx_float32 lowLimitY;
197  vx_float32 highLimitY;
198  vx_float32 lowLimitZ;
199  vx_float32 highLimitZ;
201 
209 typedef struct {
210  vx_int16 disparity_min;
211  vx_int16 disparity_max;
212  vx_int8 disparity_only;
213  vx_uint8 vis_confidence;
215 
223 typedef PTK_Alg_StereoAlgo_ObjectDetect_allParams tivx_obstacle_detection_params_t;
224 
225 
233 typedef PTK_Alg_StereoAlgo_GroundEstimation_allParams tivx_ground_estimation_params_t;
234 
242 typedef PTK_Alg_StereoPP_HoleFilling_configParams tivx_hole_filling_params_t;
243 
251 typedef PTK_Alg_StereoPP_MedianFilter_configParams tivx_median_filter_params_t;
252 
260 typedef PTK_Alg_StereoPP_DisparityMerge_configParams tivx_disparity_merge_params_t;
261 
262 
270 typedef PTK_Alg_StereoAlgo_groundModelParams_Array tivx_ground_model_params_t;
271 
272 
280 typedef PTK_Alg_StereoAlgo_obsBox tivx_obstacle_pos_t;
281 
289 typedef PTK_Alg_StereoAlgo_driveSpace tivx_drivable_space_t;
290 
291 
299 typedef PTK_Alg_StereoOG_CreatePCAllParams tivx_ss_sde_point_cloud_params_t;
300 
308 typedef PTK_Alg_StereoOG_CreateOGAllParams tivx_ss_sde_og_detection_params_t;
309 
317 typedef PTK_Alg_StereoOG_obs3DBox tivx_ss_sde_obs_3d_bound_box_t;
318 
319 
320 /*********************************
321  * Function Prototypes
322  *********************************/
323 
328 void tivxStereoLoadKernels(vx_context context);
329 
334 void tivxStereoUnLoadKernels(vx_context context);
335 
336 
342 
348 
349 
355 
361 
366 //void tivxRegisterStereoTargetC6XKernels(void);
367 
372 //void tivxUnRegisterStereoTargetC6XKernels(void);
373 
374 
375 
381 
387 
388 
393 void tivxStereoPrintPerformance(vx_perf_t performance, uint32_t numPixels, const char* testName);
394 
395 #ifdef __cplusplus
396 }
397 #endif
398 
399 #endif /* TIVX_STEREO_KERNELS_H_ */
400 
401 
PTK_Alg_StereoOG_CreatePCAllParams tivx_ss_sde_point_cloud_params_t
Point cloud creation parameters for OG based obstacle detection.
Definition: tivx_stereo_kernels.h:299
vx_int8 disparity_only
Definition: tivx_stereo_kernels.h:212
vx_uint8 vis_confidence
Definition: tivx_stereo_kernels.h:213
vx_int16 disparity_max
Definition: tivx_stereo_kernels.h:211
vx_int16 disparity_min
Definition: tivx_stereo_kernels.h:210
void tivxRegisterStereoTargetKernels(void)
Function to register STEREO Kernels on the c6x Target.
vx_float32 lowLimitX
Definition: tivx_stereo_kernels.h:194
vx_uint16 dist_center_x
Definition: tivx_stereo_kernels.h:178
vx_uint8 subSampleRatio
Definition: tivx_stereo_kernels.h:192
PTK_Alg_StereoPP_HoleFilling_configParams tivx_hole_filling_params_t
Disparity hole filling algorithm parameters.
Definition: tivx_stereo_kernels.h:242
vx_uint8 thConfidence
Definition: tivx_stereo_kernels.h:193
vx_float32 lowLimitZ
Definition: tivx_stereo_kernels.h:198
vx_uint8 usePCConfig
Definition: tivx_stereo_kernels.h:191
void tivxStereoLoadKernels(vx_context context)
Used for the application to load the stereo kernels into the context.
PTK_Alg_StereoAlgo_obsBox tivx_obstacle_pos_t
2D bounding box structure
Definition: tivx_stereo_kernels.h:280
void tivxUnRegisterStereoTargetKernels(void)
Function to un-register STEREO Kernels on the Target.
void tivxUnRegisterStereoTargetArmKernels(void)
Function to un-register Stereo Kernels on the ARM Target.
PTK_Alg_StereoOG_CreateOGAllParams tivx_ss_sde_og_detection_params_t
Occupancy Grid based detection configuration parameters.
Definition: tivx_stereo_kernels.h:308
Stereo 3D point cloud parameters.
Definition: tivx_stereo_kernels.h:190
vx_float32 lowLimitY
Definition: tivx_stereo_kernels.h:196
Stereo camera parameters.
Definition: tivx_stereo_kernels.h:173
void tivxRegisterStereoTargetC7XKernels(void)
Function to register Stereo Kernels on the c7x Target.
vx_uint16 dist_center_y
Definition: tivx_stereo_kernels.h:179
vx_float32 highLimitY
Definition: tivx_stereo_kernels.h:197
void tivxStereoUnLoadKernels(vx_context context)
Used for the application to unload the stereo kernels from the context.
void tivxRegisterStereoTargetArmKernels(void)
Function to register Stereo Kernels on the ARM Target.
void tivxUnRegisterStereoTargetC7XKernels(void)
Function to un-register Stereo Kernels on the c7x Target.
vx_float32 baseline
Definition: tivx_stereo_kernels.h:174
PTK_Alg_StereoAlgo_GroundEstimation_allParams tivx_ground_estimation_params_t
Stereo based grond plane estimation parameters.
Definition: tivx_stereo_kernels.h:233
vx_float32 focal_length
Definition: tivx_stereo_kernels.h:177
void tivxStereoPrintPerformance(vx_perf_t performance, uint32_t numPixels, const char *testName)
Used to print the performance of the kernels.
PTK_Alg_StereoAlgo_groundModelParams_Array tivx_ground_model_params_t
Ground plane model structure.
Definition: tivx_stereo_kernels.h:270
vx_float32 scale_x
Definition: tivx_stereo_kernels.h:175
PTK_Alg_StereoAlgo_driveSpace tivx_drivable_space_t
Drivable free space structure.
Definition: tivx_stereo_kernels.h:289
PTK_Alg_StereoAlgo_ObjectDetect_allParams tivx_obstacle_detection_params_t
Stereo based obstacle detection parameters.
Definition: tivx_stereo_kernels.h:223
vx_float32 highLimitX
Definition: tivx_stereo_kernels.h:195
PTK_Alg_StereoPP_DisparityMerge_configParams tivx_disparity_merge_params_t
Disparity merge algorithm parameters.
Definition: tivx_stereo_kernels.h:260
PTK_Alg_StereoPP_MedianFilter_configParams tivx_median_filter_params_t
Disparity median filtering algorithm parameters.
Definition: tivx_stereo_kernels.h:251
PTK_Alg_StereoOG_obs3DBox tivx_ss_sde_obs_3d_bound_box_t
3D obstacle bounding box structure
Definition: tivx_stereo_kernels.h:317
vx_float32 highLimitZ
Definition: tivx_stereo_kernels.h:199
vx_float32 scale_y
Definition: tivx_stereo_kernels.h:176
Stereo disparity visualization parameters.
Definition: tivx_stereo_kernels.h:209