Skip to content

test_xld_pointTestXldPointTestXldPointtest_xld_pointtest_xld_point🔗

Short description🔗

test_xld_pointTestXldPointTestXldPointtest_xld_pointtest_xld_point — Test whether one or more contours or polygons enclose the given point(s).

Signature🔗

test_xld_point( xld XLD, point.y Row, point.x Column, out integer IsInside )void TestXldPoint( const HObject& XLD, const HTuple& Row, const HTuple& Column, HTuple* IsInside )static void HOperatorSet.TestXldPoint( HObject XLD, HTuple row, HTuple column, out HTuple isInside )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] ) -> intHerror 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 )

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

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

HTuple HXLD.TestXldPoint( HTuple row, HTuple column )

int HXLD.TestXldPoint( double row, double column )

Description🔗

test_xld_pointTestXldPoint tests whether a test point (Rowrowrow, Columncolumncolumn) is enclosed by a contour or polygon XLDXLDxld and returns the result in IsInsideisInsideis_inside. If the input point is enclosed by the contour or polygon, the return value is 11, otherwise 00. In the case of a single test point and multiple contours or polygons, the (i-1)-th element of the resulting tuple IsInsideisInsideis_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 IsInsideisInsideis_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 IsInsideisInsideis_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. It is assumed that the contours or polygons are closed. If this is not the case test_xld_pointTestXldPoint will artificially close the contour. Nevertheless it is strongly recommended to pass only meaningful and closed contours or polygons in XLDXLDxld.

Attention🔗

If a test point is on the border of the contour or polygon, test_xld_pointTestXldPoint will deliver unpredictable results, i.e. the result may be 00 or 11 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.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

XLDXLDxld (input_object) xld(-array) → objectHObjectHXLDHObjectHobject

Contours or polygons to be tested.

Rowrowrow (input_control) point.y(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)

Row coordinates of the points to be tested.

Columncolumncolumn (input_control) point.x(-array) → (real)HTuple (double)HTuple (double)MaybeSequence[float]Htuple (double)

Column coordinates of the points to be tested.

Number of elements: Column==Row

IsInsideisInsideis_inside (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Tuple with Boolean numbers.

Result🔗

test_xld_pointTestXldPoint returns 2 (H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

select_contours_xldSelectContoursXld, close_contours_xldCloseContoursXld, threshold_sub_pixThresholdSubPix

Module🔗

Foundation