Ignore:
Timestamp:
Apr 6, 2010, 12:11:36 PM (15 years ago)
Author:
Rick van der Zwet
Message:

Special feature to be handed in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • liacs/MIR2010/SourceCode/main.cpp

    r98 r100  
    2020bool ShowAverages(const char *basedir);
    2121
    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"
    2424#define DEBUG 0
    2525
     
    4949
    5050
    51 // Find common coloured shapes as characteristics
     51// Find common coloured block shapes as characteristics
    5252// 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
    5454// Block '0' is used an non-matcher. Not taken into account for the time beeing.
    5555int opt_tolerance = 10;
     
    5757#define MAX_BLOCKSIZE 500
    5858float 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
    5974
    6075
     
    431446                                goto failure;
    432447
     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
    433456                        // save the descriptor,block to disk
    434457                        SAFE_SPRINTF(path, sizeof(path), "%s%i.dat", catdir, i);
     
    476499                sprintf(catdir,"%s\\%s\\", basedir, catname);
    477500
     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
    478505                // average all descriptors
    479                 memset(average, 0, BIN_COUNT*BIN_COUNT*BIN_COUNT * sizeof(float));
    480506                for (int i = 1; i <= 50; i++)
    481507                {
     
    514540                        average[b] /= c_size;
    515541
    516                 for (int b = 0; b < MAX_BLOCKSIZE; b++)
     542                for (int b = 0; b < MAX_BLOCKSIZE; b++) {
    517543                        average_block[b] /= c_size;
     544                }
    518545
    519546                // save the average to disk
Note: See TracChangeset for help on using the changeset viewer.