DGtalTools  1.3.beta
freeman2img

Transforms one or several freeman chains into a pgm file by filling their interior areas.

The transformation can fill shapes with hole by using the freemanchain orientation. The interior is considered on the left according to a freeman chain move, i.e. a clockwise oriented contour represents a hole in the shape.

Usage: freeman2img [input] [output]

Allowed options are:

Positionals:
1 TEXT:FILE REQUIRED Input freeman chain file name.
2 TEXT:FILE the output file name.
Options:
-h,--help Print this help message and exit
-i,--input TEXT:FILE REQUIRED Input freeman chain file name.
-b,--border UINT add a border in the resulting image (used only in the automatic mode i.e when --space is not used.
-o,--output TEXT=result.pgm the output file name
-s,--space INT x 4 Define the space from its bounding box (lower and upper coordinates) else the space is automatically defined from the freemanchain bounding boxes.

Example:

$freeman2img ${DGtal}/tests/samples/contourS.fc sample.pgm

You will obtain such image:

resFreeman2img.png
Resulting image

Example with several contours:

The file located in $DGtal/examples/samples/contourS2.fc contains different contours with some ones corresponds to hole. We can apply the same conversion as the previous example:

$ freeman2img $DGtal/examples/samples/contourS2.fc sample2.pgm

You will obtain such image:

resFreeman2img2.png
Resulting image
See also
img2freeman freeman2img.cpp