DGtalTools  0.9.4
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:

-h [ --help ] display this message
-i [ --input ] arg the input FreemanChain file name
-o [ --output ] arg (=result.pgm) the output filename
-b [ --border ] arg (=0) add a border in the resulting image (used
only in the automatic mode i.e when --space
is not used.
-s [ --space ] arg Define the space from its bounding box
(lower and upper coordinates) else the
space is automatically defined from the
freemanchain bounding boxes.

Example:

$freeman2img -i ${DGtal}/tests/samples/contourS.fc -o 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 -i $DGtal/examples/samples/contourS2.fc -o sample2.pgm

You will obtain such image:

resFreeman2img2.png
Resulting image
See also
img2freeman freeman2img.cpp