select_region_point ( Regions : DestRegions : Row, Column : )

Choose all regions containing a given pixel.

The operator select_region_point selects all regions from Regions containing the test 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

Column (input_control)
point.x -> integer
Column index of the test pixel.
Default value: 100


Example
read_image(Image,'fabrik')
open_window(0,0,-1,-1,'root','visible','',WindowHandle)
disp_image(Image)
regiongrowing(Image,Seg,3,3,5,0)
set_color(WindowHandle,'red')
set_draw(WindowHandle,'margin')
Button := 1
while (Button = 1)
  fwrite_string(FileId,'Select the region with the mouse (End right button)')
  fnew_line(FileId)
  get_mbutton(WindowHandle,Row,Column,Button)
  select_region_point(Seg,Single,Row,Column)
  disp_region(Single,WindowHandle)
endwhile

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 select_region_point returns the value 2 (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.


Parallelization Information

select_region_point is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

threshold, regiongrowing, connection


Alternatives

test_region_point


See also

get_mbutton, get_mposition


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH