Skip to content

gen_rectangle1GenRectangle1GenRectangle1gen_rectangle1gen_rectangle1🔗

Short description🔗

gen_rectangle1GenRectangle1GenRectangle1gen_rectangle1gen_rectangle1 — Create a rectangle parallel to the coordinate axes.

Signature🔗

gen_rectangle1( out region Rectangle, rectangle.origin.y Row1, rectangle.origin.x Column1, rectangle.corner.y Row2, rectangle.corner.x Column2 )void GenRectangle1( HObject* Rectangle, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 )static void HOperatorSet.GenRectangle1( out HObject rectangle, HTuple row1, HTuple column1, HTuple row2, HTuple column2 )def gen_rectangle1( row_1: MaybeSequence[Union[int, float]], column_1: MaybeSequence[Union[int, float]], row_2: MaybeSequence[Union[int, float]], column_2: MaybeSequence[Union[int, float]] ) -> HObject

Herror gen_rectangle1( Hobject* Rectangle, double Row1, double Column1, double Row2, double Column2 )

Herror T_gen_rectangle1( Hobject* Rectangle, const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2 )

void HRegion::HRegion( const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 )

void HRegion::HRegion( double Row1, double Column1, double Row2, double Column2 )

public HRegion( HTuple row1, HTuple column1, HTuple row2, HTuple column2 )

public HRegion( double row1, double column1, double row2, double column2 )

void HRegion::GenRectangle1( const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2 )

void HRegion::GenRectangle1( double Row1, double Column1, double Row2, double Column2 )

void HRegion.GenRectangle1( HTuple row1, HTuple column1, HTuple row2, HTuple column2 )

void HRegion.GenRectangle1( double row1, double column1, double row2, double column2 )

Description🔗

The operator gen_rectangle1GenRectangle1 generates one or more rectangles parallel to the coordinate axes which are described by the upper left corner (Row1row1row_1, Column1column1column_1) and the lower right corner (Row2row2row_2, Column2column2column_2). 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_systemGetSystem and reset_obj_dbResetObjDb in this context.

Parameter Broadcasting🔗

This operator supports parameter broadcasting. This means that each parameter can be given as a tuple of length 1 or N. Parameters with tuple length 1 will be repeated internally such that the number of created items is always N.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Rectanglerectanglerectangle (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Created rectangle.

Row1row1row_1 (input_control) rectangle.origin.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Line of upper left corner point.

Default: 30.030.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 200.00.0, 10.0, 20.0, 50.0, 100.0, 200.0
Value range: Row1 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Column1column1column_1 (input_control) rectangle.origin.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Column of upper left corner point.

Default: 20.020.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 200.00.0, 10.0, 20.0, 50.0, 100.0, 200.0
Value range: Column1 (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Row2row2row_2 (input_control) rectangle.corner.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Line of lower right corner point.

Default: 100.0100.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.010.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.0
Value range: Row2 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Row2 >= Row1

Column2column2column_2 (input_control) rectangle.corner.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Column of lower right corner point.

Default: 200.0200.0
Suggested values: 10.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.010.0, 20.0, 50.0, 100.0, 200.0, 300.0, 400.0, 500.0, 511.0
Value range: Column2 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Column2 >= Column1

Example🔗

(HDevelop)

* Contrast improvement in a rectangular region of interest
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image(Image,'mreut')
dev_display (Image)
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)
dev_display (Emphasize)

Result🔗

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

Combinations with other operators🔗

Combinations

Possible successors

paint_regionPaintRegion, reduce_domainReduceDomain

Alternatives

gen_rectangle2GenRectangle2, gen_region_polygonGenRegionPolygon, fill_upFillUp, gen_region_runsGenRegionRuns, gen_region_pointsGenRegionPoints, gen_region_lineGenRegionLine

See also

draw_rectangle1DrawRectangle1, reduce_domainReduceDomain, smallest_rectangle1SmallestRectangle1

Module🔗

Foundation