- Timestamp:
- Mar 2, 2016, 3:08:27 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/src/ecc_main_rosenfeld_sa.c
r791 r798 159 159 // --------------------------------------------------------------------- 160 160 { 161 printf("[---------------------------]"); 162 printf("[--- main_rosenfeld_file ---]"); 163 printf("[---------------------------]"); 164 165 char *pathSrc = src_path; 166 char *pathDst = dst_path; 167 168 uint8 **X0, **X; 169 uint8 **E8; 170 171 uint32 **E32; 172 uint32 *S; // Stack for Bailey algorithm 173 174 uint32 *T; 175 uint32 *A; 176 uint32 *N; 177 //uint32 *SNE; // memorisation de la somme des ne: sne 161 printf("[---------------------------]\n"); 162 printf("[--- main_rosenfeld_file ---]\n"); 163 printf("[---------------------------]\n"); 164 165 char * pathSrc = src_path; 166 char * pathDst = dst_path; 167 168 uint8 ** X0; 169 uint8 ** X; 170 uint8 ** E8; 171 172 uint32 ** E32; 173 uint32 * S; // Stack for Bailey algorithm 174 175 uint32 * T; 176 uint32 * A; 177 uint32 * N; 178 //uint32 * SNE; // memorisation de la somme des ne: sne 178 179 179 180 int i0, i1, j0, j1; 180 int height, width, border =1;181 int height, width, border = 1; 181 182 uint32 nemax, nermax; 182 183 int na; … … 191 192 192 193 // chargement d'une image depuis le disque 193 //X0 = LoadPGM_ui8matrix(complete_filename, &i0, &i1, &j0, &j1); 194 init_forme_boulon1(&X0, &i0, &i1, &j0, &j1); 195 194 printf("Loading file %s... ", filename); 195 X0 = LoadPGM_ui8matrix(complete_filename, &i0, &i1, &j0, &j1); 196 //init_forme_boulon1(&X0, &i0, &i1, &j0, &j1); 197 printf("done.\n"); 198 199 printf("Allocating memory... "); 196 200 // allocation memoire 197 201 X = ui8matrix (i0 - border, i1 + border, j0 - border, j1 + border); … … 206 210 // pre-traitements 207 211 binarisation_ui8matrix(X0, i0, i1, j0, j1, 20, 1, X); // pour le traitement 208 //binarisation_ui8matrix(X0, i0, i1, j0, j1, 20, 255, X0); // pour la verif visuelle 209 //generate_path_filename(pathDst, "verif.pgm", complete_filename, 1024); 210 //SavePGM_ui8matrix(X0, i0, i1, j0, j1, complete_filename); 212 binarisation_ui8matrix(X0, i0, i1, j0, j1, 20, 255, X0); // pour la verif visuelle 213 printf("done.\n"); 214 215 printf("Saving file %s for verification... ", complete_filename); 216 generate_path_filename(pathDst, "verif.pgm", complete_filename, 1024); 217 SavePGM_ui8matrix(X0, i0, i1, j0, j1, complete_filename); 218 printf("done.\n"); 211 219 212 220 height = i1 - i0 + 1; … … 246 254 /*na = Rosenfeld_UF_Org2_4C (X, height, width, E32, T, A, nemax, Stats); ECC_VERBOSE(printf("na = %d\n", na)); filename = "Rosenfeld_UF_Org2_4C.bmp"; mod_ui32matrix_ui8matrix(E32, i0, i1, j0, j1, E8); generate_path_filename(pathDst, filename, complete_filename); SaveBMP2_ui8matrix(E8, width, height, palette, complete_filename); zero_ui32matrix(E32, i0-border, i1+border, j0-border, j1+border); display_RegionStatsVector(Stats, 1, na, "Stats"); zero_RegionStatsVector(Stats, 0, nemax);*/ 247 255 248 free_ui8matrix (X0, i0, i1, j0,j1);249 free_ui8matrix (X, i0 -border, i1+border, j0-border, j1+border);250 free_ui8matrix (E8, i0 -border, i1+border, j0-border, j1+border);251 free_ui32matrix(E32, i0 -border, i1+border, j0-border, j1+border);256 free_ui8matrix (X0, i0, i1, j0, j1); 257 free_ui8matrix (X, i0 - border, i1 + border, j0 - border, j1 + border); 258 free_ui8matrix (E8, i0 - border, i1 + border, j0 - border, j1 + border); 259 free_ui32matrix(E32, i0 - border, i1 + border, j0 - border, j1 + border); 252 260 253 261 free_ui32vector(T, 0, nemax); … … 255 263 free_ui32vector(N, 0, nemax); 256 264 257 free_ui32vector(S, 0, 2 *nermax);265 free_ui32vector(S, 0, 2 * nermax); 258 266 259 267 return; … … 267 275 char *dst_path; 268 276 269 printf("[======================] ");270 printf("[=== main_rosenfeld ===] ");271 printf("[======================] ");272 273 src_path = " ./"; // ne pas oublier le / a la fin277 printf("[======================]\n"); 278 printf("[=== main_rosenfeld ===]\n"); 279 printf("[======================]\n"); 280 281 src_path = "/misc/"; // ne pas oublier le / a la fin 274 282 dst_path = ""; 275 283 … … 287 295 int i; 288 296 289 printf("================= ");290 printf("== display_arg == ");291 printf("================= ");292 printf(" ");297 printf("=================\n"); 298 printf("== display_arg ==\n"); 299 printf("=================\n"); 300 printf("\n"); 293 301 294 302 printf("argc = %d\n", argc); … … 297 305 printf("%s ", argv[i]); 298 306 } 299 printf(" ");307 printf("\n"); 300 308 } 301 309 // ----------------------- … … 303 311 // ----------------------- 304 312 { 305 printf("===================== ");306 printf("== ecc_info_define == ");307 printf("===================== ");308 printf(" ");313 printf("=====================\n"); 314 printf("== ecc_info_define ==\n"); 315 printf("=====================\n"); 316 printf("\n"); 309 317 ecc_info_omp(); 310 318 //Label_Display_Info(); 311 printf(" ");319 printf("\n"); 312 320 } 313 321 // ----------------------------- 314 intmain(int argc, char* argv[])322 __attribute__((constructor)) void main(int argc, char* argv[]) 315 323 // ----------------------------- 316 324 { 317 #if TARGET_OS ==GIET_VM325 #if TARGET_OS == GIETVM 318 326 giet_tty_alloc(1); 327 heap_init(0, 0); 319 328 #endif 320 329 display_arg(argc, argv); … … 322 331 main_rosenfeld(argc, argv); 323 332 printf("[main]: bye"); 324 return 0;325 } 333 exit(0); 334 }
Note: See TracChangeset
for help on using the changeset viewer.