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.

3gTeg "generation of graphical ground Truth engine".

M. Delalandre

Contact: mathieu.delalandre@free.fr

Introduction

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.

Install 3gTeg

  1. 3gTeg is a Java application, so you must first install a j2sdk application on your system (Sun).
  2. Then, copy "lib/GOMLib.jar" and "jar/3gTeg.jar" of the 3gTeg distribution to your work directory where you plan to generate the SVG databases. Here is an example of work directory.

Getting started

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 Please see the use directory to find some examples of settings ready to use.

Database generated by 3gTeg

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.

To define the setting files

See the setting.xml file, this one describes the different setting tags and their attributes. You will find here some example of setting file

To define the model files

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 ...).

To convert svg files

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 *.tiff
		
Be 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.