spatial_relationT_spatial_relationSpatialRelationSpatialRelationspatial_relation (算子)

名称

spatial_relationT_spatial_relationSpatialRelationSpatialRelationspatial_relation — 区域相对于坐标轴的姿态关系。

签名

spatial_relation(Regions1, Regions2 : : Percent : RegionIndex1, RegionIndex2, Relation1, Relation2)

Herror T_spatial_relation(const Hobject Regions1, const Hobject Regions2, const Htuple Percent, Htuple* RegionIndex1, Htuple* RegionIndex2, Htuple* Relation1, Htuple* Relation2)

void SpatialRelation(const HObject& Regions1, const HObject& Regions2, const HTuple& Percent, HTuple* RegionIndex1, HTuple* RegionIndex2, HTuple* Relation1, HTuple* Relation2)

HTuple HRegion::SpatialRelation(const HRegion& Regions2, Hlong Percent, HTuple* RegionIndex2, HTuple* Relation1, HTuple* Relation2) const

static void HOperatorSet.SpatialRelation(HObject regions1, HObject regions2, HTuple percent, out HTuple regionIndex1, out HTuple regionIndex2, out HTuple relation1, out HTuple relation2)

HTuple HRegion.SpatialRelation(HRegion regions2, int percent, out HTuple regionIndex2, out HTuple relation1, out HTuple relation2)

def spatial_relation(regions_1: HObject, regions_2: HObject, percent: int) -> Tuple[Sequence[int], Sequence[int], Sequence[str], Sequence[str]]

描述

算子 spatial_relationspatial_relationSpatialRelationSpatialRelationSpatialRelationspatial_relation selects regions located by PercentPercentPercentPercentpercentpercent percent “left”, “right”, “above” or “below” other regions. Regions1Regions1Regions1Regions1regions1regions_1 and Regions2Regions2Regions2Regions2regions2regions_2 contain the regions to be compared. Regions1Regions1Regions1Regions1regions1regions_1 can have three states:

The percentage PercentPercentPercentPercentpercentpercent is interpreted in such a way that the area of the second region has to be located really left/right or above/below the region margins of the first region by at least PercentPercentPercentPercentpercentpercent percent. The indices of the regions that fulfill at least one of these conditions are then located at the n-th position in the output parameters RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 and RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2. Additionally the output parameters Relation1Relation1Relation1Relation1relation1relation_1 and Relation2Relation2Relation2Relation2relation2relation_2 contain at the n-th position the type of relation of the region pair (RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n], RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n]), i.e., region with index RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n] has the relation Relation1Relation1Relation1Relation1relation1relation_1[n] and Relation2Relation2Relation2Relation2relation2relation_2[n] with region with index RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n].

Possible values for Relation1Relation1Relation1Relation1relation1relation_1 and Relation2Relation2Relation2Relation2relation2relation_2 are:

In RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 and RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2 the indices of the regions in the tuples of the input regions (Regions1Regions1Regions1Regions1regions1regions_1 or Regions2Regions2Regions2Regions2regions2regions_2), respectively, are entered as image identifiers. Access to chosen regions via the index can be obtained by the operator copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj

执行信息

参数

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

Starting regions.

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

Comparative regions.

PercentPercentPercentPercentpercentpercent (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Percentage of the area of the comparative region which must be located left/right or above/below the region margins of the starting region.

默认值: 50

建议值: 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100

值范围: 0 ≤ Percent Percent Percent Percent percent percent ≤ 100 (lin)

最小增量: 1

建议增量: 10

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

Indices of the regions in the tuple of the input regions which fulfill the pose relation.

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

Indices of the regions in the tuple of the input regions which fulfill the pose relation.

Relation1Relation1Relation1Relation1relation1relation_1 (输出控制)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Horizontal pose relation in which RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n] stands with RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n].

Relation2Relation2Relation2Relation2relation2relation_2 (输出控制)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Vertical pose relation in which RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n] stands with RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n].

结果

算子 spatial_relationspatial_relationSpatialRelationSpatialRelationSpatialRelationspatial_relation 返回值 2 ( H_MSG_TRUE) if Regions2Regions2Regions2Regions2regions2regions_2 is not empty and PercentPercentPercentPercentpercentpercent is correctly chosen. The behavior in case of empty parameter Regions2Regions2Regions2Regions2regions2regions_2 (no input regions available) 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>)。空区域(区域是空集)的情况下的可设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

替代

area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center, intersectionintersectionIntersectionIntersectionIntersectionintersection

另见

select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial, find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighborsfind_neighbors, copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj, obj_to_integerobj_to_integerObjToIntegerObjToIntegerObjToIntegerobj_to_integer

模块

基础