3gTeg "generation of graphical ground Truth engine" is an engine to generate random graphical documents (exported into SVG) of low level primitives (vectors, circles, ...) with their corresponding ground truth.
M. Delalandre
Contact: mathieu.delalandre@free.fr
3gTeg "generation of graphical ground Truth engine" is a system to generate random graphical documents (exported into SVG) of low level primitives (vectors, circles, ...) with their corresponding ground truth. 3gTeg is based on the use of XML setting files describing the wished ground truth by a user. These XML setting files are linked with model files describing the graphical models used to generate graphical documents. 3gTeg performs then different random processes on these graphical models like selection, rotation, scale, positionning ... The following figure gives the general architecture of 3gTeg :

The following list gives some examples of generated documents into SVG format. You need to install a SVG viewer before like SVG Viewer or Inkscape.
3gTeg is a jar application. To use 3gTeg open a shell frame on your systen and then execute a command like this :or a command to coerce in the command line he ground and model paths
java -jar 3gTeg.jar setting -o- setting is the name of xml setting file
- "o" is a parametter to control 3gTeg
example:
- "px" parse and print the xml setting file
- "gt" produce the groundthruth (default mode)
java -jar 3gTeg.jar helloworld.xml -gtPlease see the use directory to find some examples of settings ready to use.
java -jar 3gTeg.jar setting grounds models -o- setting is the name of xml setting file
- gounds is the directory name of the gound files
- models is the directory name of the model files
- "o" is a parametter to control 3gTeg
example:
- "px" parse and print the xml setting file
- "gt" produce the groundthruth (default mode)
java -jar 3gTeg.jar constraints.xml grounds/grid.png models/symbols25 -gt
Following its execution 3gTeg generates the graphical documents and the corresponding ground truth. All these data are grouped in a same database directory for each execution. This database directory contains different document types :This database directory is located at the same place than the used setting file. Following the execution 3gTeg print the path of this database directory. 3gTeg computes in an automatic way a name for this directory database based on the setting file name. For example "setting.xml" for the XML setting file will give a "setting_0" for the database directory. 3gTeg computes this name according to the existing directories, and increases in an automatic way the number of the database directory (1 to n). Like this, your new database directories are added in your work directory without erasing of your last database directories.
- graphics (SVG files)
- ground truth (XML files)
where tags and attributes mean
- "OSymbol" is the main symbol tag
- "label" the file model name used to generate the symbol
- "x0,y0" the top left point of the symbol bounding box
- "x1,y1" the bottom right point of symbol the bounding box
- "resize" specify how the size of symbol has been changed in regard to the original model.
- "morph" specifiy how the thickness of symbol has been changed in regard to the original model.
- "direction" the rotation of symbol (in degree) in regard to the original model.
See the setting.xml file, this one describes the different setting tags and their attributes. You will find here some example of setting file
You can use any svg graphics user interface (like Inkscape) to edit SVG documents as model ones.
3gTeg supports different types of SVG primitive (line, polyline, arc, circle, rectangle ...).
3gTeg produces only svg files as output document. However you can use ImageMagik to convert these files into image ones. You will find below an example of shell command of ImageMagik to convert all the svg files of a current directory into gray-level (bicolor) tiff files.mogrify -format tiff -separate -channel Gray -compress RLE *.svg mogrify -black-threshold 200 -white-threshold 200 -compress RLE *.tiffBe carefull to not convert your images in the same format of your background image, it will change your background image at each process call and then introduce mistakes in your final results.