test_xld_pointtest_xld_pointTestXldPointTestXldPointtest_xld_point (算子)

名称

test_xld_pointtest_xld_pointTestXldPointTestXldPointtest_xld_point — 测试一个或多个轮廓或多边形是否包围了给定点。

签名

test_xld_point(XLD : : Row, Column : IsInside)

Herror test_xld_point(const Hobject XLD, double Row, double Column, Hlong* IsInside)

Herror T_test_xld_point(const Hobject XLD, const Htuple Row, const Htuple Column, Htuple* IsInside)

void TestXldPoint(const HObject& XLD, const HTuple& Row, const HTuple& Column, HTuple* IsInside)

HTuple HXLD::TestXldPoint(const HTuple& Row, const HTuple& Column) const

Hlong HXLD::TestXldPoint(double Row, double Column) const

static void HOperatorSet.TestXldPoint(HObject XLD, HTuple row, HTuple column, out HTuple isInside)

HTuple HXLD.TestXldPoint(HTuple row, HTuple column)

int HXLD.TestXldPoint(double row, double column)

def test_xld_point(xld: HObject, row: MaybeSequence[float], column: MaybeSequence[float]) -> Sequence[int]

def test_xld_point_s(xld: HObject, row: MaybeSequence[float], column: MaybeSequence[float]) -> int

描述

test_xld_pointtest_xld_pointTestXldPointTestXldPointTestXldPointtest_xld_point tests whether a test point (RowRowRowRowrowrow, ColumnColumnColumnColumncolumncolumn) is enclosed by a contour or polygon XLDXLDXLDXLDXLDxld and returns the result in IsInsideIsInsideIsInsideIsInsideisInsideis_inside. If the input point is enclosed by the contour or polygon, the return value is 1, otherwise 0. In the case of a single test point and multiple contours or polygons, the (i-1)-th element of the resulting tuple IsInsideIsInsideIsInsideIsInsideisInsideis_inside indicates, whether the point is enclosed by the i-th contour or polygon. In the case of multiple test points and a single contour or polygon, the i-th element of the resulting tuple IsInsideIsInsideIsInsideIsInsideisInsideis_inside indicates, whether the i-th point is enclosed by the contour or polygon. In the case of multiple test points and multiple contours or polygons, the (i-1)-th element of the resulting tuple IsInsideIsInsideIsInsideIsInsideisInsideis_inside indicates, whether the (i-1)-th point is enclosed by the i-th contour or polygon (the subscription differs, because the indexing of the results tuple starts with 0 in contrast to the indexing of object tuples). In this case the number of input points must be equal to the number of contours or polygons.假设轮廓或多边形是闭合的。 If this is not the case test_xld_pointtest_xld_pointTestXldPointTestXldPointTestXldPointtest_xld_point will artificially close the contour. Nevertheless it is strongly recommended to pass only meaningful and closed contours or polygons in XLDXLDXLDXLDXLDxld

注意

If a test point is on the border of the contour or polygon, test_xld_pointtest_xld_pointTestXldPointTestXldPointTestXldPointtest_xld_point will deliver unpredictable results, i.e. the result may be 0 or 1 depending on arbitrary factors such as how the polygon is oriented with respect to the coordinate system. Note further that for points in the near proximity of the contour or polygon sides, a reliable classification is practically impossible because of numerical inaccuracies.

执行信息

参数

XLDXLDXLDXLDXLDxld (输入对象)  xld(-array) objectHXLDHObjectHXLDHobject

Contours or polygons to be tested.

RowRowRowRowrowrow (输入控制)  point.y(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinates of the points to be tested.

ColumnColumnColumnColumncolumncolumn (输入控制)  point.x(-array) HTupleMaybeSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinates of the points to be tested.

元素数量: Column == Row

IsInsideIsInsideIsInsideIsInsideisInsideis_inside (输出控制)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Tuple with Boolean numbers.

结果

test_xld_pointtest_xld_pointTestXldPointTestXldPointTestXldPointtest_xld_point 在输入不为空时返回 2 ( H_MSG_TRUE )。如果输入为空则可设置行为通过 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>)。如有必要,则抛出异常。

可能的前趋

select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldSelectContoursXldselect_contours_xld, close_contours_xldclose_contours_xldCloseContoursXldCloseContoursXldCloseContoursXldclose_contours_xld, threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix

模块

基础