DGtalTools  0.9.4
All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
contourGenerator

Generates multigrid contours of 2d digital shapes using DGtal library.

The associated geometric information like contour, curvature can also be displayed.

Usage: contourGenerator –shape <shapeName> [requiredParam] [otherOptions]

Allowed options are:

-h [ --help ] display this message
-l [ --list ] List all available shapes
-s [ --shape ] arg Shape name
-R [ --radius ] arg Radius of the shape
-A [ --axis1 ] arg Half big axis of the shape (ellipse)
-a [ --axis2 ] arg Half small axis of the shape (ellipse)
-r [ --smallradius ] arg (=5) Small radius of the shape
-v [ --varsmallradius ] arg (=5) Variable small radius of the shape
-k [ --k ] arg (=3) Number of branches or corners the shape
--phi arg (=0) Phase of the shape (in radian)
-w [ --width ] arg (=10) Width of the shape
-p [ --power ] arg (=2) Power of the metric (double)
-x [ --center_x ] arg (=0) x-coordinate of the shape center (double)
-y [ --center_y ] arg (=0) y-coordinate of the shape center (double)
-g [ --gridstep ] arg (=1) Gridstep for the digitization
-f [ --format ] arg (=pts) Output format:
List of pointel coordinates {pts}
Freman chaincode Vector {fc}
-o [ --outputGeometry ] arg Base name of the file containing the shape
geometry (points, tangents, curvature)

You can also list all possible shapes:

contourGenerator --list
2D Shapes:
ball Ball for the Euclidean metric.
Required parameter(s): --radius [-R]
square square (no signature).
Required parameter(s): --width [-w]
lpball Ball for the l_power metric (no signature).
Required parameter(s): --radius [-R], --power [-p]
flower Flower with k petals with radius ranging from R+/-v.
Required parameter(s): --radius [-R], --varsmallradius [-v], --k [-k], --phi
ngon Regular k-gon.
Required parameter(s): --radius [-R], --k [-k], --phi
accflower Accelerated Flower with k petals.
Required parameter(s): --radius [-R], --varsmallradius [-v], --k [-k], --phi
ellipse Ellipse.
Required parameter(s): --axis1 [-A], --axis2 [-a], --phi

Example:

# generate a flower contour with 5 petals of maximal radius 5 and small radius 3 with grid size = 0.1:
./shapeGenerator/contourGenerator -s flower -R 5 -v 3 -k 5 --outputGeometry result -g 0.1
# Display the results using gnuplot:
$gnuplot
[gnuplot> plot [][-5:2]'res.geom' using 1:6 w l t "curvature"
[gnuplot> plot 'res.geom' using 2:3 w l t "contour flower"

You should obtain such a visualization:

resContourGenerator.png
resulting visualisation of generated contour (a) and curvature (b).
See also
contourGenerator.cpp shapeGenerator