Herror ::get_region_index (
    Hobject Regions,
    const HTuple &Row,
    const HTuple &Column,
    long *Index
)
Herror ::get_region_index (
    Hobject Regions,
    const HTuple &Row,
    const HTuple &Column,
    HTuple *Index
)
HTuple HRegionArray::GetRegionIndex (
    const HTuple &Row,
    const HTuple &Column
) const

Index of all regions containing a given pixel.

The operator ::get_region_index returns the index of all regions in Regions (value range 0 to n-1) containing the test pixel (Row,Column), i.e.:

            |Region[n] intersection {(Row,Column)}| = {(Row,Column)}


Attention

If the regions overlap more than one region might contain the pixel. In this case all these regions are returned. If no region contains the indicated pixel the empty tuple (= no region) is returned.


Parameters

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

Row (input_control)
point.y -> HTuple.long
Line index of the test pixel.
Default value: 100
Typical range of values: -oo <= Row <= -oo (lin)

Column (input_control)
point.x -> HTuple.long
Column index of the test pixel.
Default value: 100
Typical range of values: -oo <= Column <= -oo (lin)

Index (output_control)
integer(-array) -> (HTuple.) long *
Index of the regions containing the test pixel.


Complexity

If F is the area of the region and N is the number of regions the mean runtime complexity is O(ln(F) * N).


Result

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


Possible Predecessors

::threshold, ::regiongrowing, ::connection


Alternatives

::select_region_point


See also

::get_mbutton, ::get_mposition, ::test_region_point


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH