Skip to content

find_neighborsFindNeighborsFindNeighborsfind_neighborsT_find_neighbors🔗

Short description🔗

find_neighborsFindNeighborsFindNeighborsfind_neighborsT_find_neighbors — Search direct neighbors.

Signature🔗

find_neighbors( region Regions1, region Regions2, integer MaxDistance, out integer RegionIndex1, out integer RegionIndex2 )void FindNeighbors( const HObject& Regions1, const HObject& Regions2, const HTuple& MaxDistance, HTuple* RegionIndex1, HTuple* RegionIndex2 )static void HOperatorSet.FindNeighbors( HObject regions1, HObject regions2, HTuple maxDistance, out HTuple regionIndex1, out HTuple regionIndex2 )def find_neighbors( regions_1: HObject, regions_2: HObject, max_distance: int ) -> Tuple[Sequence[int], Sequence[int]]

Herror T_find_neighbors( const Hobject Regions1, const Hobject Regions2, const Htuple MaxDistance, Htuple* RegionIndex1, Htuple* RegionIndex2 )

HTuple HRegion::FindNeighbors( const HRegion& Regions2, Hlong MaxDistance, HTuple* RegionIndex2 ) const

HTuple HRegion.FindNeighbors( HRegion regions2, int maxDistance, out HTuple regionIndex2 )

Description🔗

The operator find_neighborsFindNeighbors determines neighboring regions with Regions1regions1regions_1 and Regions2regions2regions_2 containing the regions to be examined. Regions1regions1regions_1 can have three different states:

The operator find_neighborsFindNeighbors uses the chessboard distance between neighboring regions. It can be specified by the parameter MaxDistancemaxDistancemax_distance. Neighboring regions are located at the n-th position in RegionIndex1regionIndex1region_index_1 and RegionIndex2regionIndex2region_index_2, i.e., the region with index RegionIndex1regionIndex1region_index_1[n] from Regions1regions1regions_1 is the neighbor of the region with index RegionIndex2regionIndex2region_index_2[n] from Regions2regions2regions_2.

Attention🔗

Covered regions are not found!

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🔗

Regions1regions1regions_1 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Starting regions.

Regions2regions2regions_2 (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Comparative regions.

MaxDistancemaxDistancemax_distance (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximal distance of regions.

Default: 11
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 10, 15, 20, 501, 2, 3, 4, 5, 6, 7, 8, 10, 15, 20, 50
Value range: 1 ≤ MaxDistance ≤ 255
Minimum increment: 1
Recommended increment: 1

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

Indices of the found regions from Regions1regions1regions_1.

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

Indices of the found regions from Regions2regions2regions_2.

Result🔗

The operator find_neighborsFindNeighbors returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection

See also

spatial_relationSpatialRelation, select_region_spatialSelectRegionSpatial, expand_regionExpandRegion, distance_transformDistanceTransform, interjacentInterjacent, boundaryBoundary

Module🔗

Foundation