inside_region1 ( Regions : DestRegions : Row, Column : )

Choose all regions containing a given pixel.

The operator inside_region1 selects alle regions from Regions containing the text pixel (Row,Column), i.e.:

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


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 -> object
Regions to be examined.

DestRegions (output_object)
region-array -> object
All regions containing the test pixel.

Row (input_control)
point.y -> integer
Line index of the test pixel.
Default value: 100
Range of values: 0 <= Row <= 512 (lin)
Minimum increment: 1
Recommended increment: 1

Column (input_control)
point.x -> integer
Column index of the test pixel.
Default value: 100
Range of values: 0 <= Column <= 512 (lin)
Minimum increment: 1
Recommended increment: 1


Example
read_image(:Image:'fabrik':) >
open_window(::0,0,-1,-1,'root','visible','':) >
disp_image(Image:::) >
regiongrowing__(Image:Seg:3,3,5,0:) >
set_color(::'red':) >
set_draw(::'margin':) >
repeat(:::) >
fwrite_string(::'Select the region with the mouse (End right button)':) >
fnew_line(:::) >
get_mbutton(:::Row,Column,Button) >
inside_region1(Seg:Single:Row,Column:) >
disp_region(Single:::) >
clear(Single:::) >
until(::Button = 4:).

Complexity

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


Result

The operator inside_region1 returns the value 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 is raised.


Possible Predecessors

threshold__, regiongrowing__, connection


Alternatives

inside_region2


See also

get_mbutton, get_mposition



Copyright © 1996-1997 MVTec Software GmbH