#include <stdio.h>#include <stdlib.h>#include <opencv/cv.h>#include <opencv/highgui.h>#include <unistd.h>#include "masks_globals.h"
Defines | |
| #define | TABLE_LEN 256 |
| #define | N CL_NEUTRAL |
| #define | B 0 |
| #define | W 255 |
Functions | |
| void | initTable (void) |
| Fills the lookup table with default values (neutral color). | |
| int | replaceTableColors (const uchar cornColors[][CORNSCNT], int maskIndex) |
| Accommodate colors in lookup table to given configuration. | |
| int | generateMasks (const IplImage *src, int blur, char orientation, char teamColor, const uchar cornColors[][CORNSCNT], int masksCnt) |
| Generates outputs by replacing the colors of src in a loop. | |
| int | main (int argc, char *argv[]) |
Variables | |
| CvMat * | transformTable |
| const uchar | sideCornColors [SIDEMASKSCNT][CORNSCNT] |
| const uchar | centerCornColors [CENTERMASKSCNT][CORNSCNT] |
| #define B 0 |
| #define N CL_NEUTRAL |
| #define TABLE_LEN 256 |
| #define W 255 |
| int generateMasks | ( | const IplImage * | src, | |
| int | blur, | |||
| char | orientation, | |||
| char | teamColor, | |||
| const uchar | cornColors[][CORNSCNT], | |||
| int | masksCnt | |||
| ) |
Generates outputs by replacing the colors of src in a loop.
| src | Source mask image. | |
| blur | If >0, the outputs are also smoothed using this blur width. | |
| orientation | Side configuration 's', center 'c'. | |
| teamColor | Team color - yellow 'y' or blue 'b'. | |
| cornColors | Table of all configurations with given orientation. | |
| masksCnt | Size of first dimension of the table. |


| void initTable | ( | void | ) |
Fills the lookup table with default values (neutral color).
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |

| int replaceTableColors | ( | const uchar | cornColors[][CORNSCNT], | |
| int | maskIndex | |||
| ) |
Accommodate colors in lookup table to given configuration.
| cornColors | Table of all configurations. | |
| maskIndex | Index of current configuration. |

| const uchar centerCornColors[CENTERMASKSCNT][CORNSCNT] |
{
{N,N,N,N,N,B,N,W,B,W},
{N,N,N,N,N,B,N,B,W,W},
{N,N,N,N,N,W,N,W,B,B},
{N,N,N,N,N,W,N,B,W,B}
}
| const uchar sideCornColors[SIDEMASKSCNT][CORNSCNT] |
{
{W,W,B,W,B,N,W,N,N,N},
{B,W,W,W,B,N,W,N,N,N},
{W,W,W,W,B,N,B,N,N,N},
{W,B,W,W,W,N,B,N,N,N},
{B,B,W,W,W,N,W,N,N,N},
{W,B,B,W,W,N,W,N,N,N},
{W,W,B,B,W,N,W,N,N,N},
{B,W,W,B,W,N,W,N,N,N},
{W,W,W,B,W,N,B,N,N,N}
}
| CvMat* transformTable |
1.7.1