@@ -199,7 +199,8 @@ void obtain_gradients_sobel()
199199
200200 int final_target = IMAG_ROWS * IMAG_COLS ;
201201 int current_progress = 0 ;
202- int step = final_target / 10 ;
202+ int step_percent = 2 ;
203+ int step = final_target / (100 / step_percent );
203204 int next_target = 1 ;
204205
205206 printf ("Starting IMG Sobel Step: \n" );
@@ -215,7 +216,7 @@ void obtain_gradients_sobel()
215216
216217 if (current_progress == next_target * step )
217218 {
218- printf ("\tCurrent progress is at %0d%%\n" , next_target * 10 );
219+ printf ("\tCurrent progress is at %0d%%\n" , next_target * step_percent );
219220 next_target ++ ;
220221 }
221222 current_progress ++ ;
@@ -239,7 +240,8 @@ void convert_to_grayscale()
239240
240241 int final_target = IMAG_ROWS * IMAG_COLS ;
241242 int current_progress = 0 ;
242- int step = final_target / 10 ;
243+ int step_percent = 2 ;
244+ int step = final_target / (100 / step_percent );
243245 int next_target = 1 ;
244246
245247 printf ("Starting IMG Grayscale Step: \n" );
@@ -262,7 +264,7 @@ void convert_to_grayscale()
262264
263265 if (current_progress == next_target * step )
264266 {
265- printf ("\tCurrent progress is at %0d%%\n" , next_target * 10 );
267+ printf ("\tCurrent progress is at %0d%%\n" , next_target * step_percent );
266268 next_target ++ ;
267269 }
268270 current_progress ++ ;
@@ -279,7 +281,8 @@ void filter_image()
279281
280282 int final_target = IMAG_ROWS * IMAG_COLS ;
281283 int current_progress = 0 ;
282- int step = final_target / 10 ;
284+ int step_percent = 2 ;
285+ int step = final_target / (100 / step_percent );
283286 int next_target = 1 ;
284287
285288 printf ("Starting IMG Filtering Step: \n" );
@@ -293,7 +296,7 @@ void filter_image()
293296
294297 if (current_progress == next_target * step )
295298 {
296- printf ("\tCurrent progress is at %0d%%\n" , next_target * 10 );
299+ printf ("\tCurrent progress is at %0d%%\n" , next_target * step_percent );
297300 next_target ++ ;
298301 }
299302 current_progress ++ ;
@@ -332,7 +335,8 @@ void unificate_img()
332335
333336 int final_target = IMAG_ROWS * IMAG_COLS ;
334337 int current_progress = 0 ;
335- int step = final_target / 10 ;
338+ int step_percent = 2 ;
339+ int step = final_target / (100 / step_percent );
336340 int next_target = 1 ;
337341
338342 printf ("Starting IMG Unification Step: \n" );
@@ -358,7 +362,7 @@ void unificate_img()
358362
359363 if (current_progress == next_target * step )
360364 {
361- printf ("\tCurrent progress is at %0d%%\n" , next_target * 10 );
365+ printf ("\tCurrent progress is at %0d%%\n" , next_target * step_percent );
362366 next_target ++ ;
363367 }
364368 current_progress ++ ;
@@ -412,11 +416,17 @@ void save_image_from_mem(int image_id)
412416}
413417
414418static void testbench (void * pParameter ) {
415- // convert_to_grayscale();
419+ convert_to_grayscale ();
416420
417- // filter_image( );
421+ save_image_from_mem ( 1 );
418422
419- // obtain_gradients_sobel();
423+ filter_image ();
424+
425+ save_image_from_mem (2 );
426+
427+ obtain_gradients_sobel ();
428+
429+ save_image_from_mem (3 );
420430
421431 unificate_img ();
422432
@@ -427,6 +437,8 @@ static void testbench(void *pParameter) {
427437 save_image_from_mem (5 );
428438
429439 transmit_data (IMAG_ROWS * IMAG_COLS );
440+
441+ save_image_from_mem (6 );
430442}
431443
432444int main ( void )
0 commit comments