test_region_pointtest_region_pointTestRegionPointTestRegionPointtest_region_point (算子)

名称

test_region_pointtest_region_pointTestRegionPointTestRegionPointtest_region_point — 测试该区域是否包含给定点。

签名

test_region_point(Regions : : Row, Column : IsInside)

Herror test_region_point(const Hobject Regions, const Hlong Row, const Hlong Column, Hlong* IsInside)

Herror T_test_region_point(const Hobject Regions, const Htuple Row, const Htuple Column, Htuple* IsInside)

void TestRegionPoint(const HObject& Regions, const HTuple& Row, const HTuple& Column, HTuple* IsInside)

Hlong HRegion::TestRegionPoint(const HTuple& Row, const HTuple& Column) const

Hlong HRegion::TestRegionPoint(Hlong Row, Hlong Column) const

static void HOperatorSet.TestRegionPoint(HObject regions, HTuple row, HTuple column, out HTuple isInside)

int HRegion.TestRegionPoint(HTuple row, HTuple column)

int HRegion.TestRegionPoint(int row, int column)

def test_region_point(regions: HObject, row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]]) -> int

描述

If an array of regions and one test point is provided, test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPointtest_region_point tests if at least one input region of RegionsRegionsRegionsRegionsregionsregions contains the single test point given in (RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn). If this is the case, IsInsideIsInsideIsInsideIsInsideisInsideis_inside is set to TRUE, else to FALSE. Alternatively, if a single region and several test points are provided, test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPointtest_region_point tests if at least one of the test points (given in RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn) is contained in the input region given in RegionsRegionsRegionsRegionsregionsregions. If this is the case, IsInsideIsInsideIsInsideIsInsideisInsideis_inside is set to TRUE, otherwise it is set to FALSE. If (RowRowRowRowrowrow,ColumnColumnColumnColumncolumncolumn) are real-valued, rounding is performed internally since regions are pixel precise.

注意

The test pixel is not contained in an empty region (no pixel of the region corresponds to the pixel). If all regions are empty IsInsideIsInsideIsInsideIsInsideisInsideis_inside is set to FALSE.

In case of an empty input object (empty tuple) RegionsRegionsRegionsRegionsregionsregions and set_system('no_object_result','true')set_system("no_object_result","true")SetSystem("no_object_result","true")SetSystem("no_object_result","true")SetSystem("no_object_result","true")set_system("no_object_result","true"), an empty tuple is returned in IsInsideIsInsideIsInsideIsInsideisInsideis_inside. If set_system('no_object_result','false')set_system("no_object_result","false")SetSystem("no_object_result","false")SetSystem("no_object_result","false")SetSystem("no_object_result","false")set_system("no_object_result","false") was set, an exception is raised.

执行信息

参数

RegionsRegionsRegionsRegionsregionsregions (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

待检查的区域。

RowRowRowRowrowrow (输入控制)  point.y(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Row index of the test pixel(s).

默认值: 100

ColumnColumnColumnColumncolumncolumn (输入控制)  point.x(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Column index of the test pixel(s).

元素数量: Row == Column

默认值: 100

IsInsideIsInsideIsInsideIsInsideisInsideis_inside (输出控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Boolean result value.

复杂度

If F is the area of one region, N is the number of regions, and M is the number of test points, the runtime complexity is O(ln(sqrt(F)) * N) in the case of one test point and several regions and O(ln(sqrt(F)) * M) in the case of one region and several test points.

结果

算子 test_region_pointtest_region_pointTestRegionPointTestRegionPointTestRegionPointtest_region_point 在参数正确时返回值 2 ( H_MSG_TRUE )。 The behavior in case of an empty object is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

替代

union1union1Union1Union1Union1union1, intersectionintersectionIntersectionIntersectionIntersectionintersection, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center

另见

select_region_pointselect_region_pointSelectRegionPointSelectRegionPointSelectRegionPointselect_region_point

模块

基础