shape_trans — Transform the shape of a region.
shape_trans transforms the shape of the input regions
depending on the parameter
Ellipse with the same moments and area as the input region.
Smallest enclosing circle.
Largest circle fitting into the region.
Smallest enclosing rectangle parallel to the coordinate axes.
Smallest enclosing rectangle.
Largest axis-parallel rectangle fitting into the region.
The point on the skeleton of the input region having the smallest distance to the center of gravity of the input region.
Type = 'outer_circle' is selected it might
happen that the resulting circular region does not completely cover
the input region. This is because internally the operators
gen_circle are used to compute
the outer circle. As described in the documentation of
smallest_circle, the calculated radius can be too small by
up to pixels. Additionally, the
circle that is generated by
gen_circle is translated by up
to 0.5 pixels in both directions, i.e., by up to
pixels. Consequently, when adding up
both effects, the original region might protrude beyond the returned
circular region by at most 1 pixel.
Regions to be transformed.
Type of transformation.
Default value: 'convex'
List of values: 'convex', 'ellipse', 'inner_center', 'inner_circle', 'inner_rectangle1', 'outer_circle', 'rectangle1', 'rectangle2'
Let F be the area of the input region. Then the runtime complexity is O(F).
shape_trans returns TRUE if all parameters are correct.
The behavior in case of empty input (no regions given) can be set
If necessary, an exception is raised.