Changeset 100 for liacs/MIR2010/SourceCode/main.cpp
- Timestamp:
- Apr 6, 2010, 12:11:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
liacs/MIR2010/SourceCode/main.cpp
r98 r100 20 20 bool ShowAverages(const char *basedir); 21 21 22 #define TRAINING_DIR_DEBUG "C:\\Documents and Settings\\rvdzwet\\Desktop\\liacs\\MIR2010\\trainingSet"23 #define TESTSET_DIR_DEBUG "C:\\Documents and Settings\\rvdzwet\\Desktop\\liacs\\MIR2010\\testSet"22 //#define TRAINING_DIR_DEBUG "C:\\Documents and Settings\\rvdzwet\\Desktop\\liacs\\MIR2010\\trainingSet" 23 //#define TESTSET_DIR_DEBUG "C:\\Documents and Settings\\rvdzwet\\Desktop\\liacs\\MIR2010\\testSet" 24 24 #define DEBUG 0 25 25 … … 49 49 50 50 51 // Find common coloured shapes as characteristics51 // Find common coloured block shapes as characteristics 52 52 // Walk over image with opt_spread steps, if pixel -within opt_tolerance- matches previous pixel 53 // make the size of the specific block bigger. 53 // make the size of the specific block bigger. Blocks can be horizontally and vertically attached 54 54 // Block '0' is used an non-matcher. Not taken into account for the time beeing. 55 55 int opt_tolerance = 10; … … 57 57 #define MAX_BLOCKSIZE 500 58 58 float average_block[CATEGORY_SIZE][MAX_BLOCKSIZE]; 59 60 // ===========Block Interesting Results =========================== 61 // opt_spread | opt_tolerance | total | (almost correct) 62 // ------------|---------------|-------|--------------------------- 63 // 10 | 10 | 20/41 | crowd, downhill, icehockey 64 // 10 | 20 | 15/41 | crowd, downhill 65 // 10 | 50 | 13/41 | crowd, downhill 66 // 20 | 10 | 17/41 | crowd, icehockey, downhill 67 // 20 | 20 | 17/41 | crowd, downhill, icehockey 68 // 50 | 10 | 13/41 | 69 // 50 | 20 | 14/41 | crowd, downhill 70 // 50 | 50 | 12/41 | crowd, downhill 71 // 100 | 100 | 10/41 | icehockey 72 73 59 74 60 75 … … 431 446 goto failure; 432 447 448 if (opt_verbose) { 449 for (int u = 0; u < MAX_BLOCKSIZE; u++) { 450 if (block[u]) 451 cout << "Blocksize " << u << " : " << block[u] << endl; 452 } 453 } 454 455 433 456 // save the descriptor,block to disk 434 457 SAFE_SPRINTF(path, sizeof(path), "%s%i.dat", catdir, i); … … 476 499 sprintf(catdir,"%s\\%s\\", basedir, catname); 477 500 501 // Make sure initial values are 0 502 memset(average, 0, BIN_COUNT*BIN_COUNT*BIN_COUNT * sizeof(float)); 503 memset(average_block, 0, MAX_BLOCKSIZE * sizeof(float)); 504 478 505 // average all descriptors 479 memset(average, 0, BIN_COUNT*BIN_COUNT*BIN_COUNT * sizeof(float));480 506 for (int i = 1; i <= 50; i++) 481 507 { … … 514 540 average[b] /= c_size; 515 541 516 for (int b = 0; b < MAX_BLOCKSIZE; b++) 542 for (int b = 0; b < MAX_BLOCKSIZE; b++) { 517 543 average_block[b] /= c_size; 544 } 518 545 519 546 // save the average to disk
Note:
See TracChangeset
for help on using the changeset viewer.