Changeset 798 for soft/giet_vm/applications/rosenfeld/src
- Timestamp:
- Mar 2, 2016, 3:08:27 PM (9 years ago)
- Location:
- soft/giet_vm/applications/rosenfeld/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/src/bmpNR.c
r772 r798 10 10 #include <stdlib.h> 11 11 #include <math.h> 12 13 12 14 13 /* -- image -- */ … … 20 19 #include "nralloc.h" 21 20 #endif 21 22 #if TARGET_OS == LINUX 23 #include <sys/types.h> 24 #include <sys/stat.h> 25 #include <fcntl.h> 26 #include <unistd.h> 27 #endif 28 22 29 23 30 #include "palette.h" … … 242 249 //DEBUG(printf("BMP : %d %d\n", sizeof( BitmapFileHeader), sizeof( BitmapInfoHeader))); 243 250 if (sizeof(BitmapFileHeader) != 14) { 244 printf("*** Error SaveMBP: sizeof(BitmapFileHeader) = %d should be 14...\n", sizeof(BitmapFileHeader));251 printf("*** Error SaveMBP: sizeof(BitmapFileHeader) = %d should be 14...\n", (int) sizeof(BitmapFileHeader)); 245 252 } 246 253 -
soft/giet_vm/applications/rosenfeld/src/dummy_func.c
r792 r798 10 10 11 11 12 13 IMAGE_EXPORT(uint8 **) LoadPGM_ui8matrix(char *filename, int *nrl, int *nrh, int *ncl, int *nch) { return NULL; }14 IMAGE_EXPORT(void) SavePGM_ui8matrix(uint8 **m, int nrl, int nrh, int ncl, int nch, char *filename) {}15 16 12 void write_ui8matrix_positive (uint8 **m,int i0, int i1, int j0, int j1, int iformat, char *filename) {} 17 13 -
soft/giet_vm/applications/rosenfeld/src/ecc_common.c
r777 r798 8 8 #include <math.h> 9 9 10 11 10 #ifdef CLI 12 11 #include "nrc_os_config.h" 13 12 #include "nrc.h" 14 13 #endif 14 15 #if TARGET_OS == LINUX 16 #include <sys/types.h> 17 #include <sys/stat.h> 18 #include <fcntl.h> 19 #endif 20 15 21 16 22 #include "ecc_common.h" -
soft/giet_vm/applications/rosenfeld/src/ecc_features.c
r772 r798 19 19 #include <malloc.h> 20 20 21 #ifdef OPENMP22 #include <omp.h>23 #endif24 21 25 22 #ifdef CLI 26 23 #include "nrc_os_config.h" 27 24 #include "nrc.h" 25 #endif 26 27 28 29 #if TARGET_OS == LINUX 30 #include <sys/types.h> 31 #include <sys/stat.h> 32 #include <fcntl.h> 33 #endif 34 35 36 #ifdef OPENMP 37 #include <omp.h> 28 38 #endif 29 39 … … 147 157 // --------------------------------- 148 158 { 149 int ne ;159 int ne = 0; 150 160 // @QM giet 151 161 fscanf(fd, "%d", &ne); … … 162 172 // -------------------------------------------------------------- 163 173 { 164 int i , t;174 int i; 165 175 166 176 for (i = 1; i <= ne; i++) { -
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.