mf_db_generation ( : : DatabaseDescriptionName, DatabaseName : )

Creating a Markov field database.

The operator mf_db_generation calculates an MF database from a set of MF-feature files and stores the database in a file.

For the automatic generating of an MF-database, a learning-by-example approach is used. Herefore a set of image examples is necessary which are characteristic for a certain interpretation domain (e.g. sequence of driving scenes). For each example there must also be an MF-feature file and correct MF-interpretation files. The following real-valued features are available in the MF-feature files, for 1-clique, 2-cliques and 3-cliques respectively (each feature being assigned to an index):

          1. Color value features
          -----------------------

   0:     mean gray value
   1:     standard deviation of the gray values 
   2:     entropy
   3:     anisotropy
   4:     mean red
   5:     standard deviation red
   6:     entropy red
   7:     anisotropy red
   8:     mean green
   9:     standard deviation green
  10:     entropy green
  11:     anisotropy green
  12:     mean blue
  13:     standard deviation blue
  14:     entropy blue
  15:     anisotropy blue

          2. Region features (<HORUS-function>, <corresponding parameter>)
          ----------------------------------------------------------------
  16:     circularity (circularity, Circularity)
  17:     Kanai's compactness (compactness, Compactness)
  18:     contour length (contlength, ContLength)
  19:     convexity (convexity, Convexity)
  20:     elliptic principal axis (elliptic_axis, Ra)
  21:     elliptic secondary axis (elliptic_axis, Rb)
  22:     orientation angle of the principal axis (elliptic_axis, Phi)
  23:     anisometry (eccentricity, anisometry)
  24:     mass distribution (eccentricity, bulkiness)
  25:     structure-factor (eccentricity, structurFactor)
  26:     product of inertia (moments, M11)
  27,28:  central moments (moments, M20), (moments, M02)
  29,30:  principal axes of inertia (moments, Ia), (moments, Ib)
  31:     area (position, Area)
  32:     centre of gravity line (position, Line)
  33:     centre of gravity column (position, Column)
  34:     first Hu-invariant (-, (M20 + M02) / Area^2)
  35:     second Hu-invariant (-, (M20 - M02)^2 + 4 * M11^2) / Area^4)
  36:     normed product of inertia (-, M11 / Area^2)
  37,38:  normed central moments (-, M20 / Area^2), (-, M02 / Area^2)
Further, an interpretation description file having the extension .ide is necessary. In this file the available interpretations (e.g. car, street, sky) must be included in the following format:
  <interpretation description 0>;<newline>
  <interpretation description 1>;<newline>
              .
              .
  <interpretation description m-1>;
This file must be created manually with the help of a text editor. The line number (starting with 0) will then be assigned implicitly as interpretation index to each interpretation. The correct MF-interpretation files (having the extension .int) of the image examples must also be written manually with the help of a text editor. The order of the interpretations must hereby be the same as the order of the image regions in the segmented image example and has to be of the following format:

  <Number of the regions = n> <number of the possible interpretations = m>
  <energy value = "0.0"> <unknown-flag = "1"> <Kind of interpretation =
    "manual interpretation">,
  <interpretation index of the region 1>
  <interpretation index of region 2> ... <interpretation index of region n>
The information concerning which example images, which interpretation description file and which features shall be used, and whether the topological relations for the 2-cliques and the 3-cliques shall be generated or not, will be combined in a single database description file (having the extension .dbd). This file has to be created manually with the help of a text editor and must be of the following format:

  <name of the interpretation description file>;<newline>
  <name of the image example 1>, <name of the image example 2>, ...,
  <name of the image example k>;<newline>
  <1-clique-feature index 1> <1-clique-factor 1>,
  <1-clique-feature index 2> <1-clique-factor 2>, ...,
  <1-clique-feature index numfea1> <1-clique-factor numfea1>;<newline>
  <2-cliques-feature index 1> <2-cliques-factor 1>,
  <2-cliques-feature index 2> <2-cliques-factor 2>, ...,
  <2-cliques-feature index numfea2> <2-cliques-factor numfea2>;<newline>
  <3-cliques-feature index 1> <3-cliques-factor 1>,
  <3-cliques-feature index 2> <3-cliques-factor 2>, ...,
  <3-cliques-feature index numfea3> <3-cliques-factor numfea3>;<newline>
  <topology-2-clique-flag>, <topology-3-cliques-flag>;

Hereby only the values 0 or 1 are available for the 2-cliques-flag and the 3-cliques-flag. It is recommendable to set them both to 1, as the topological relations support the interpretation process. The factors present in the database-description file must be floating point numbers. This allows an additional manual evaluation of the individual features. Nomally however this is not necessary (in this case all factors should be set to 1.0), as during the automatic generating of the database the individual features will be evaluated automatically with respect to the conflict which they create in the interpretation process. This implies also that all available features may be indicated by the user and that the interpretation system itself will determine those features which separate well the objects to be recognized and prefers them by an internal evaluation.

Example of an interpretation description file:

background;

screw;

nut;

hole of a nut;

hook;

dowel;

Example of an interpretation file:

21 6 0.0 1 manual interpretation, 0 2 3 2 3 1 2 3 1 1 1 2 2 3 2 2 2 3 3 3 1

Example of a database-description file:

sm;

s, m, h, d, smhd1, smhd2;

18 1.0, 19 1.0, 23 1.0, 31 1.0, 34 1.0;

0 1.0, 23 1.0, 31 1.0, 35 1.0;

17 1.0, 31 1.0;

1, 1;


Attention

In the files to be created manually, all values have to be written in one line until a <newline>. The interpretation files in particular only consist of one line. The extensions of the file names must not be indicated as they will always be added automatically.


Parameters

DatabaseDescriptionName (input_control)
string -> string
Name of the database description file to be used (the extension .dbd will be added automatically).

DatabaseName (input_control)
string -> string
Name of the database file to be created (the extension .db will be added automatically).


Result

If the parameter values and the database description file are correct, the operator mf_db_generation returns the value TRUE. Otherwise an exception will be raised.


Possible Predecessors

mf_features


Possible Successors

mf_read_db, mf_interprete_image


See also

mf_features, mf_read_db, mf_set_db, mf_get_db, mf_close_db



Copyright © 1996-1997 MVTec Software GmbH