Changeset 100


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

Special feature to be handed in.

Location:
liacs/MIR2010
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • liacs/MIR2010/README.txt

    r94 r100  
     1Rick van der Zwet <info@rickvanderzwet.nl>
     2
     3= Properties =
    14[crowd] - face colour
    25[skijump] - green olympics logo, straight line of leaves
     
    1114  - Licenses for pictures is restricted by owner (not me).
    1215  - 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  
    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.