Herror ::diameter_region (
    Hobject Regions,
    long *Row1,
    long *Column1,
    long *Row2,
    long *Column2,
    double *Diameter
)
Herror ::diameter_region (
    Hobject Regions,
    HTuple *Row1,
    HTuple *Column1,
    HTuple *Row2,
    HTuple *Column2,
    HTuple *Diameter
)
long HRegion::DiameterRegion (
    long *Column1,
    long *Row2,
    long *Column2,
    double *Diameter
) const
HTuple HRegionArray::DiameterRegion (
    HTuple *Column1,
    HTuple *Row2,
    HTuple *Column2,
    HTuple *Diameter
) const

Maximal distance between two boundary points of a region.

The operator ::diameter_region calculates the maximal distance between two boundary points of a region. The coordinates of these two extremes and the distance between them will be returned.


Attention

If the region is empty, the results of Row1, Column1, Row2 and Column2 (all of them = 0) may lead to confusion.


Parameters

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

Row1 (output_control)
line.begin.y(-array) -> (HTuple.) long *
Row index of the first extreme point.

Column1 (output_control)
line.begin.x(-array) -> (HTuple.) long *
Column index of the first extreme point.

Row2 (output_control)
line.end.y(-array) -> (HTuple.) long *
Row index of the second extreme point.

Column2 (output_control)
line.end.x(-array) -> (HTuple.) long *
Column index of the second extreme point.

Diameter (output_control)
number(-array) -> (HTuple.) double *
Distance of the two extreme points.


Complexity

If F is the area of a region, the runtime complexity amounts to O(F) on average.


Result

The operator ::diameter_region returns the value H_MSG_TRUE, if the input is not empty. The reaction to empty input (no input regions are available) may be determined with the help of the operator ::set_system('no_object_result',<Result>). The reaction concerning an empty region (region is the empty set) will be determined by the operator ::set_system('empty_region_result',<Result>). If necessary an exception handling is raised.


Possible Predecessors

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


Possible Successors

::disp_line


Alternatives

::smallest_rectangle2


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH