Changeset 100
- Timestamp:
- Apr 6, 2010, 12:11:36 PM (15 years ago)
- Location:
- liacs/MIR2010
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
liacs/MIR2010/README.txt
r94 r100 1 Rick van der Zwet <info@rickvanderzwet.nl> 2 3 = Properties = 1 4 [crowd] - face colour 2 5 [skijump] - green olympics logo, straight line of leaves … … 11 14 - Licenses for pictures is restricted by owner (not me). 12 15 - License for cximage is by http://www.xdp.it/cximage.htm 16 - Other code: BSDLike - http://rickvanderzwet.nl/LICENSE 17 18 = Usage = 19 1. Make sure your folders are organised in the following way 20 - trainingSet/<category>/1.jpg 21 ... 22 - trainingSet/<category>/50.jpg 23 - testSet/<category>/1.jpg 24 ... 25 - testSet/<category>/XX.jpg 26 27 2. Start aplication and select the folders 28 29 3. To-do a regular run 30 - Select 1 31 - Select 2 32 - Select 4 -
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.