hamming_distance_normhamming_distance_normHammingDistanceNormHammingDistanceNormhamming_distance_norm (算子)
名称
hamming_distance_normhamming_distance_normHammingDistanceNormHammingDistanceNormhamming_distance_norm — 使用归一化的两个区域之间的汉明距离。
签名
void HammingDistanceNorm(const HObject& Regions1, const HObject& Regions2, const HTuple& Norm, HTuple* Distance, HTuple* Similarity)
HTuple HRegion::HammingDistanceNorm(const HRegion& Regions2, const HTuple& Norm, HTuple* Similarity) const
Hlong HRegion::HammingDistanceNorm(const HRegion& Regions2, const HString& Norm, double* Similarity) const
Hlong HRegion::HammingDistanceNorm(const HRegion& Regions2, const char* Norm, double* Similarity) const
Hlong HRegion::HammingDistanceNorm(const HRegion& Regions2, const wchar_t* Norm, double* Similarity) const
(
Windows only)
def hamming_distance_norm(regions_1: HObject, regions_2: HObject, norm: MaybeSequence[str]) -> Tuple[Sequence[int], Sequence[float]]
def hamming_distance_norm_s(regions_1: HObject, regions_2: HObject, norm: MaybeSequence[str]) -> Tuple[int, float]
描述
算子 hamming_distance_normhamming_distance_normHammingDistanceNormHammingDistanceNormHammingDistanceNormhamming_distance_norm returns the hamming distance
between two regions,
i.e., the number of pixels of the regions which are different
(DistanceDistanceDistanceDistancedistancedistance).
Before calculating the difference the region in
Regions1Regions1Regions1Regions1regions1regions_1 is normalized onto
the regions in Regions2Regions2Regions2Regions2regions2regions_2.
The result is 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:
The following types of normalization are available:
- 'center'"center""center""center""center""center":
The region is moved so that both regions have the save center
of gravity.
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.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在元组级别上自动并行化。
参数
Regions1Regions1Regions1Regions1regions1regions_1 (输入对象) region(-array) → objectHRegionHObjectHRegionHobject
Regions to be examined.
Regions2Regions2Regions2Regions2regions2regions_2 (输入对象) region(-array) → objectHRegionHObjectHRegionHobject
Comparative regions.
NormNormNormNormnormnorm (输入控制) string(-array) → HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Type of normalization.
默认值:
'center'
"center"
"center"
"center"
"center"
"center"
值列表:
'center'"center""center""center""center""center"
DistanceDistanceDistanceDistancedistancedistance (输出控制) integer(-array) → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Hamming distance of two regions.
Assertion:
Distance >= 0
SimilaritySimilaritySimilaritySimilaritysimilaritysimilarity (输出控制) real(-array) → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Similarity of two regions.
Assertion:
0 <= Similarity && Similarity <= 1
复杂度
If F is the area of a region the mean runtime
complexity is O(sqrt(F)).
结果
hamming_distance_norm 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>)。空区域(区域是空集)的情况下的可设置行为通过
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
替代
intersectionintersectionIntersectionIntersectionIntersectionintersection,
complementcomplementComplementComplementComplementcomplement,
area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center
另见
hamming_change_regionhamming_change_regionHammingChangeRegionHammingChangeRegionHammingChangeRegionhamming_change_region
模块
基础