gen_rectangle2 ( : Rectangle : Row, Column, Phi, Length1, Length2 : )

Create a rectangle of any orientation.

The operator gen_rectangle2 generates one or more rectangles with the center (Row, Column) , the orientation Phi and the half edge lengths Length1 and Length2. The orientation is given in arc measure and indicates the angle between the horizontal axis and Length1 (mathematically positive). The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See get_system and reset_obj_db in this context. More than one region can be created by passing one tuple of corner points.


Attention

The gray values of the output objects are undefined.


Parameters

Rectangle (output_object)
region(-array) -> object
Created rectangle.

Row (input_control)
rectangle2.center.y(-array) -> real / integer
Line index of the center.
Default value: 50.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: -oo <= Row <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Column (input_control)
rectangle2.center.x(-array) -> real / integer
Column index of the center.
Default value: 100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0
Typical range of values: -oo <= Column <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Phi (input_control)
rectangle2.angle.rad(-array) -> real / integer
Angle of longitudinal axis to the horizontal (in radians).
Default value: 0.0
Suggested values: -1.178097, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.178097
Typical range of values: -1.178097 <= Phi <= 1.178097 (lin)
Minimum increment: 0.001
Recommended increment: 0.1
Restriction: ((- pi / 2) < Phi) && (Phi <= (pi / 2))

Length1 (input_control)
rectangle2.hwidth(-array) -> real / integer
Half width.
Default value: 200.0
Suggested values: 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0, 300.0, 500.0
Typical range of values: -oo <= Length1 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Length2 (input_control)
rectangle2.hheight(-array) -> real / integer
Half height.
Default value: 100.0
Suggested values: 1.0, 2.0, 3.0, 5.0, 10.0, 15.0, 20.0, 50.0, 100.0, 200.0
Typical range of values: -oo <= Length2 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Length2 <= Length1


Result

If the parameter values are correct the operator gen_rectangle2 returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised. The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>).


Parallelization Information

gen_rectangle2 is reentrant and processed without parallelization.


Possible Successors

paint_region, reduce_domain


Alternatives

gen_rectangle1, gen_region_polygon_filled, gen_region_polygon, gen_region_points, fill_up


See also

draw_rectangle2, reduce_domain, smallest_rectangle2, gen_ellipse


Module

Region processing



Copyright © 1996-2005 MVTec Software GmbH