hamming_distancehamming_distanceHammingDistanceHammingDistancehamming_distance (算子名称)
名称
hamming_distancehamming_distanceHammingDistanceHammingDistancehamming_distance
— Hamming distance between two regions.
参数签名
def hamming_distance(regions_1: HObject, regions_2: HObject) -> Tuple[Sequence[int], Sequence[float]]
def hamming_distance_s(regions_1: HObject, regions_2: HObject) -> Tuple[int, float]
描述
The operator hamming_distancehamming_distanceHammingDistanceHammingDistanceHammingDistancehamming_distance
returns the hamming distance
between two regions,
i.e., the number of pixels of the regions which are different
(DistanceDistanceDistanceDistancedistancedistance
), i.e., the number of pixels contained in one region
but not in the other:
The parameter SimilaritySimilaritySimilaritySimilaritysimilaritysimilarity
describes the similarity between the
two regions based on the hamming distance DistanceDistanceDistanceDistancedistancedistance
:
If both regions are empty SimilaritySimilaritySimilaritySimilaritysimilaritysimilarity
is set to 0.
The regions with the same index from both input parameters are
always compared.
注意
In both input parameters the same number of
regions must be passed.
运行信息
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
参数表
Regions1Regions1Regions1Regions1regions1regions_1
(input_object) region(-array) →
objectHRegionHObjectHRegionHobject
Regions to be examined.
Regions2Regions2Regions2Regions2regions2regions_2
(input_object) region(-array) →
objectHRegionHObjectHRegionHobject
Comparative regions.
DistanceDistanceDistanceDistancedistancedistance
(output_control) integer(-array) →
HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Hamming distance of two regions.
Assertion:
Distance >= 0
SimilaritySimilaritySimilaritySimilaritysimilaritysimilarity
(output_control) real(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Similarity of two regions.
Assertion:
0 <= Similarity && Similarity <= 1
Complexity
If F is the area of a region the mean runtime
complexity is O(sqrt(F)).
结果
hamming_distance returns the value 2 (
H_MSG_TRUE)
if the number of objects in
both parameters is the same and is not 0.
The behavior in case of empty input (no input objects 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>)
.
The behavior in case of empty region (the region is the empty set) is set via
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>)
.
If necessary an exception is raised.
可能的前置算子
thresholdthresholdThresholdThresholdThresholdthreshold
,
regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing
,
connectionconnectionConnectionConnectionConnectionconnection
可替代算子
intersectionintersectionIntersectionIntersectionIntersectionintersection
,
complementcomplementComplementComplementComplementcomplement
,
area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center
参考其它
hamming_change_regionhamming_change_regionHammingChangeRegionHammingChangeRegionHammingChangeRegionhamming_change_region
模块
Foundation