TI Autonomous Driving Algorithms (TIADALG) Library User Guide
tiadalg_image_preprocessing_test.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) {2015 - 2018} 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 #include <../common/tiadalg_test_interface.h>
64 
65 uint8_t test_img_1[6*3*3] =
66 {
67 40, 80, 120, 160, 200, 240, 255, 0, 254,
68 40, 80, 120, 160, 200, 240, 255, 0, 254,
69 40, 80, 120, 160, 200, 240, 255, 0, 254,
70 40, 80, 120, 160, 200, 240, 255, 0, 254,
71 40, 80, 120, 160, 200, 240, 255, 0, 254,
72 40, 80, 120, 160, 200, 240, 255, 0, 254
73 };
74 
75 uint8_t test_img_2[6*3*3] =
76 {
77  40, 160,255,
78  40, 160,255,
79  40, 160,255,
80  40, 160,255,
81  40, 160,255,
82  40, 160,255,
83  80, 200,0,
84  80, 200,0,
85  80, 200,0,
86  80, 200,0,
87  80, 200,0,
88  80, 200,0,
89  120,240,254,
90  120,240,254,
91  120,240,254,
92  120,240,254,
93  120,240,254,
94  120,240,254
95 };
96 
97 uint8_t test_img_3[6*3*3] =
98 {
99  120,240,254,120,240,254,120,240,254,
100  120,240,254,120,240,254,120,240,254,
101  80, 200,0,80, 200,0,80, 200,0,
102  80, 200,0,80, 200,0,80, 200,0,
103 
104  40, 160,255,40, 160,255,40, 160,255,
105  40, 160,255,40, 160,255,40, 160,255
106 };
107 uint8_t test_img_4[10*4 + 10*2] =
108 {
109 40, 80, 120, 160, 200, 240, 255, 0, 254, 128,
110 40, 80, 120, 160, 200, 240, 255, 0, 254, 128,
111 40, 80, 120, 160, 200, 240, 255, 0, 254, 128,
112 40, 80, 120, 160, 200, 240, 255, 0, 254, 128,
113 
114 40, 80, 120, 160, 200, 240, 255, 0, 254, 128,
115 40, 80, 120, 160, 200, 240, 255, 0, 254, 128
116 };
117 
118 uint8_t test_img_5[10*4*3] =
119 {
120  0,0,172,218,255,255,73,0,255,130,
121  0,0,172,218,255,255,73,0,255,130,
122  0,0,172,218,255,255,73,0,255,130,
123  0,0,172,218,255,255,73,0,255,130,
124 
125  101,147,98,144,95,141,255,35,227,81,
126  101,147,98,144,95,141,255,35,227,81,
127  101,147,98,144,95,141,255,35,227,81,
128  101,147,98,144,95,141,255,35,227,81,
129 
130  0,0,104,151,255,255,255,237,255,255,
131  0,0,104,151,255,255,255,237,255,255,
132  0,0,104,151,255,255,255,237,255,255,
133  0,0,104,151,255,255,255,237,255,255,
134 
135 };
136 
137 uint8_t test_img_6[10*4*3] =
138 {
139 
140  0,0,104,151,255,255,255,237,255,255,
141  0,0,104,151,255,255,255,237,255,255,
142  0,0,104,151,255,255,255,237,255,255,
143  0,0,104,151,255,255,255,237,255,255,
144 
145  101,147,98,144,95,141,255,35,227,81,
146  101,147,98,144,95,141,255,35,227,81,
147  101,147,98,144,95,141,255,35,227,81,
148  101,147,98,144,95,141,255,35,227,81,
149 
150  0,0,172,218,255,255,73,0,255,130,
151  0,0,172,218,255,255,73,0,255,130,
152  0,0,172,218,255,255,73,0,255,130,
153  0,0,172,218,255,255,73,0,255,130
154 };
155 
156 static int32_t num_planes = 3;
157 static float mean_pixel1[3] = {103.94f,116.78f,123.68f};
158 static float scale_val1[3] = {1.2f, 1.5f, 2.6f};
159 
160 static float mean_pixel2[3] = {0.0f, 0.0f, 0.0f};
161 static float scale_val2[3] = {1.0f, 1.0f, 1.0f};
162 
163 typedef struct {
164  int32_t in_data_type; /*0 -> static, 1 -> random, 2 -> file*/
165  int32_t out_data_type;
166  uint8_t *in_img;
167  uint8_t *ref_out_img;
168  int32_t img_width;
169  int32_t img_height;
170  int32_t num_planes;
171  float * mean_pixel;
172  float * scale_val;
175 
177 {
178  {
179  1,
181  0x0,
182  0x0,
183  768,
184  16,
185  num_planes,
186  mean_pixel2,
187  scale_val2,
189  },
190  {
191  1,
193  0x0,
194  0x0,
195  768,
196  16,
197  num_planes,
198  mean_pixel2,
199  scale_val2,
201  },
202  {
203  1,
205  0x0,
206  0x0,
207  768,
208  16,
209  num_planes,
210  mean_pixel2,
211  scale_val2,
213  },
214  {
215  0,
217  test_img_4,
218  0x0,
219  10,
220  4,
221  num_planes,
222  mean_pixel2,
223  scale_val2,
225  },
226  {
227  0,
229  test_img_4,
230  0x0,
231  10,
232  4,
233  num_planes,
234  mean_pixel2,
235  scale_val2,
237  },
238  {
239  0,
241  test_img_1,
242  0x0,
243  3,
244  6,
245  num_planes,
246  mean_pixel2,
247  scale_val2,
249  },
250  {
251  0,
253  test_img_1,
254  0x0,
255  3,
256  6,
257  num_planes,
258  mean_pixel2,
259  scale_val2,
261  },
262  {
263  0,
265  test_img_1,
266  0x0,
267  18,
268  1,
269  num_planes,
270  mean_pixel2,
271  scale_val2,
273  }
274 };
275 
static float mean_pixel2[3]
Definition: tiadalg_image_preprocessing_test.h:160
static float scale_val2[3]
Definition: tiadalg_image_preprocessing_test.h:161
Definition: tiadalg_common_data_struct.h:103
uint8_t test_img_6[10 *4 *3]
Definition: tiadalg_image_preprocessing_test.h:137
uint8_t test_img_5[10 *4 *3]
Definition: tiadalg_image_preprocessing_test.h:118
int32_t out_data_type
Definition: tiadalg_image_preprocessing_test.h:165
Definition: tiadalg_common_data_struct.h:105
Definition: tiadalg_common_data_struct.h:104
uint8_t test_img_4[10 *4+10 *2]
Definition: tiadalg_image_preprocessing_test.h:107
static float scale_val1[3]
Definition: tiadalg_image_preprocessing_test.h:158
Definition: tiadalg_common_data_struct.h:106
Definition: tiadalg_common_data_struct.h:89
float * scale_val
Definition: tiadalg_image_preprocessing_test.h:172
uint8_t test_img_3[6 *3 *3]
Definition: tiadalg_image_preprocessing_test.h:97
uint8_t * ref_out_img
Definition: tiadalg_image_preprocessing_test.h:167
Definition: tiadalg_image_color_blending_test.h:68
int32_t color_conv_type
Definition: tiadalg_image_preprocessing_test.h:173
uint8_t test_img_2[6 *3 *3]
Definition: tiadalg_image_preprocessing_test.h:75
uint8_t test_img_1[6 *3 *3]
Definition: tiadalg_image_preprocessing_test.h:65
static int32_t num_planes
Definition: tiadalg_image_preprocessing_test.h:156
Definition: tiadalg_common_data_struct.h:87
static tiadalg_image_preprocessing_testParams_t test_cases[]
Definition: tiadalg_image_preprocessing_test.h:176
static float mean_pixel1[3]
Definition: tiadalg_image_preprocessing_test.h:157
float * mean_pixel
Definition: tiadalg_image_preprocessing_test.h:171

© Copyright 2018 Texas Instruments Incorporated. All rights reserved.
Document generated by doxygen 1.8.6