Herror ::smallest_rectangle1 (
    Hobject Regions,
    long *Row1,
    long *Column1,
    long *Row2,
    long *Column2
)
Herror ::smallest_rectangle1 (
    Hobject Regions,
    HTuple *Row1,
    HTuple *Column1,
    HTuple *Row2,
    HTuple *Column2
)
long HRegion::SmallestRectangle1 (
    long *Column1,
    long *Row2,
    long *Column2
) const
HTuple HRegionArray::SmallestRectangle1 (
    HTuple *Column1,
    HTuple *Row2,
    HTuple *Column2
) const

Surrounding rectangle parallel to the coordinate axes.

The operator ::smallest_rectangle1 calculates the surrounding rectangle of all input regions (parallel to the coordinate axes). The surrounding rectangle is described by the coordinates of the corner pixels (Row1,Column1,Row2,Column2)

If more than one region is passed in Regions, the results are stored in tuples, the index of a value in the tuple corresponding to the index of a region in the input. In case of empty region all parameters have the value 0 if no other behavior was set (see ::set_system).


Attention

In case of empty region the result of Row1,Column1, Row2 and Column2 (all are 0) can lead to confusion.


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions to be examined.

Row1 (output_control)
rectangle.origin.y(-array) -> (HTuple.) long *
Line index of upper left corner point.

Column1 (output_control)
rectangle.origin.x(-array) -> (HTuple.) long *
Column index of upper left corner point.

Row2 (output_control)
rectangle.corner.y(-array) -> (HTuple.) long *
Line index of lower right corner point.

Column2 (output_control)
rectangle.corner.x(-array) -> (HTuple.) long *
Column index of lower right corner point.


Complexity

If F is the area of the region the mean runtime complexity is O(sqrt(F)).


Result

The operator ::smallest_rectangle1 returns the value H_MSG_TRUE if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator ::set_system('no_object_result',<Result>). The behavior in case of empty region (the region is the empty set) is set via ::set_system('empty_region_result',<Result>). If necessary an exception handling is raised.


Possible Predecessors

::threshold, ::regiongrowing, ::connection, ::runlength_features


Possible Successors

::disp_rectangle1, ::gen_rectangle1


Alternatives

::smallest_rectangle2, ::area_center


See also

::select_shape


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH