gen_rectangle1 ( : Rectangle : Row1, Column1, Row2, Column2 : )

Create a rectangle parallel to the coordinate axes.

The operator gen_rectangle1 generates one or more rectangles parallel to the coordinate axes which are described by the upper left corner (Row1, Column1) and the lower right corner (Row2, Column2). More than one region can be created by passing a tuple of corner points. 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.


Parameters

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

Row1 (input_control)
rectangle.origin.y(-array) -> real / integer
Line of upper left corner point.
Default value: 30.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 200.0
Typical range of values: -oo <= Row1 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Column1 (input_control)
rectangle.origin.x(-array) -> real / integer
Column of upper left corner point.
Default value: 20.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 200.0
Typical range of values: -oo <= Column1 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Row2 (input_control)
rectangle.corner.y(-array) -> real / integer
Line of lower right corner point.
Default value: 100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.0
Typical range of values: -oo <= Row2 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Row2 >= Row1

Column2 (input_control)
rectangle.corner.x(-array) -> real / integer
Column of lower right corner point.
Default value: 200.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.0
Typical range of values: -oo <= Column2 <= -oo (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Column2 >= Column1


Example
/* Contrast improvement in a rectangular region of interest */

read_image(Image,'fabrik') 
open_window(0,0,-1,-1,'root','visible','',WindowHandle) 
disp_image(Image,WindowHandle) 
draw_rectangle1(WindowHandle,Row1,Column1,Row2,Column2) 
gen_rectangle1(Rectangle,Row1,Column1,Row2,Column2) 
reduce_domain(Image,Rectangle,Mask) 
emphasize(Mask,Emphasize,9,9,1.0) 
disp_image(Emphasize,WindowHandle).

Result

If the parameter values are correct, the operator gen_rectangle1 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_rectangle1 is reentrant and processed without parallelization.


Possible Successors

paint_region, reduce_domain


Alternatives

gen_rectangle2, gen_region_polygon, fill_up, gen_region_runs, gen_region_points, gen_region_line


See also

draw_rectangle1, reduce_domain, smallest_rectangle1


Module

Region processing



Copyright © 1996-2005 MVTec Software GmbH