How to install the mezzanine video server.

mezzanine is one of the video servers being used by the eleague. It was developed by a bunch of really smart people.
Documentation is available in PDF format here.

Download the mezzanine video server from: http://sourceforge.net/project/showfiles.php?group_id=42445&package_id=47082.

You can either install the server by following the mezzanine manual, or by attempting to decipher the following:

Navigate to the directory where you downloaded mezzanine:

bash#  cd /eleague/src/mezzanine
Optionally:
You can modify the file in this directory called Makefile.opt.
Find the line that contains:
INSTALL_BASE = ($HOME)/mezzanine
and change it so that it points to the directory where you want mezzanine installed.
Directly below you can specify where the configuration file mezzanine.opt will go.
INSTALL_ETC=$(INSTALL_DIR)/etc
Note:
INSTALL_DIR is defined as $(INSTALL_BASE)-$(VERSION), VERSION is set to 0.00
If you set INSTALL_BASE to /eleague/mezzanine then INSTALL_DIR will be /eleague/mezzanine-0.00 and the configuration files will appear in /eleague/mezzanine-0.00/etc

You can now run:
bash# make
After mezzanine builds, run:
bash# make install
Tada mezzanine is now installed!
Two binaries were created in the INSTALL_BIN folder: mezzanine and mezzcal.
The first is the actual vision server, the second is the interactive calibration utility.

Configuring the mezzanine daemon -- assuming that mezzanine was installed in /eleague/mezzanine-0.00/

The configuration file contains two main things you need to configure: colors and robots.
Colors are setup through a 3-panel window that breaks down the planes of the YUV colorspace.
But before you can calibrate the colors using /eleague/mezzanine-0.00/mezzcal/mezzcal, you must create dummy color entries in the config file.

Open up the file: /eleague/mezzanine-0.00/etc/mezzanine.opt
Scroll down until you see this:
# Color classifier options
# -- start of the green color definition block --
classify.class[0].name = green
classify.class[0].color = (0, 255, 0)
classify.class[0].vupoly[0] = (121, 93)
classify.class[0].vupoly[1] = (114, 137)
classify.class[0].vupoly[2] = (80, 125)
classify.class[0].vupoly[3] = (99, 90)
classify.class[0].yupoly[0] = (148, 118)
classify.class[0].yupoly[1] = (210, 119)
classify.class[0].yupoly[2] = (214, 82)
classify.class[0].yupoly[3] = (132, 86)
classify.class[0].vypoly[0] = (83, 111)
classify.class[0].vypoly[1] = (131, 107)
classify.class[0].vypoly[2] = (121, 228)
classify.class[0].vypoly[3] = (74, 219)
# -- end of the green color definition block --

classify.class[1].name = pink
classify.class[1].color = (255, 105, 180)
classify.class[1].vupoly[0] = (211, 81)
classify.class[1].vupoly[1] = (198, 161)
...
All you need to do is copy the first definition block and edit it.
example:
classify.class[2].name = red
classify.class[2].color = (255, 0, 0)
classify.class[2].vupoly[0] = (121, 93)
classify.class[2].vupoly[1] = (114, 137)
classify.class[2].vupoly[2] = (80, 125)
classify.class[2].vupoly[3] = (99, 90)
classify.class[2].yupoly[0] = (148, 118)
classify.class[2].yupoly[1] = (210, 119)
classify.class[2].yupoly[2] = (214, 82)
classify.class[2].yupoly[3] = (132, 86)
classify.class[2].vypoly[0] = (83, 111)
classify.class[2].vypoly[1] = (131, 107)
classify.class[2].vypoly[2] = (121, 228)
classify.class[2].vypoly[3] = (74, 219)
The index within the brackets specifies the color id (that you will use later to color-code robots.)
The color property is a simple rgb value. The 2d coordinate pairs for the VU/YU/VY polygons can be left alone in the config file.

If you create many such color entries all at once without manually setting vertex coordinates, mezzcal will have overlapping polygons drawn in its calibration window. This is not a problem at all! You can easily click on the polygons in that window and move their vertices around!

Almost done.. just need to color-code the robots!

Scroll down in the configuration file until you see something like the example below.
Set the object_count property to the number of objects mezzanine is to track.
This count should include the soccer ball.
# Object identification
ident.object_count = 3
ident.max_disp = 0.3
ident.max_sep = 0.1

# pink and red robot
ident[0].class[0] = 1
ident[0].class[1] = 2

# green and red robot
ident[1].class[0] = 0
ident[1].class[1] = 2

# a pink ball
ident[0].class[0] = 1
As you can see the ball is uniquely identifiable because it has only one color set.
Meanwhile the robots all have two color fiducials, which allow Mezzanine to determine the direction the robots are looking in.

You can now start mezzanine:
bash# cd /eleague/mezzanine-0.00/bin
bash# ./mezzanine
If the configuration file had any errors in it, mezzanine will complain and quit. If not:
bash# cd /eleague/mezzanine-0.00/bin
bash# ./mezzcal
Mezzcal would need to be started from a different console, as the mezzanine daemon steals the console it is started on.
To quit mezzcal or mezzanine: send a ctrl-c to the consoles they are running on.
Mezzcal does not need to be running, and the changes you make in it are applied in real-time.


good luck, have fun.

back to eleague howto page