hamming_distance_normhamming_distance_normHammingDistanceNormHammingDistanceNormhamming_distance_norm (Operator)

Name

hamming_distance_normhamming_distance_normHammingDistanceNormHammingDistanceNormhamming_distance_norm — Hamming distance between two regions using normalization.

Signature

hamming_distance_norm(Regions1, Regions2 : : Norm : Distance, Similarity)

Herror hamming_distance_norm(const Hobject Regions1, const Hobject Regions2, const char* Norm, Hlong* Distance, double* Similarity)

Herror T_hamming_distance_norm(const Hobject Regions1, const Hobject Regions2, const Htuple Norm, Htuple* Distance, Htuple* Similarity)

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)

static void HOperatorSet.HammingDistanceNorm(HObject regions1, HObject regions2, HTuple norm, out HTuple distance, out HTuple similarity)

HTuple HRegion.HammingDistanceNorm(HRegion regions2, HTuple norm, out HTuple similarity)

int HRegion.HammingDistanceNorm(HRegion regions2, string norm, out double similarity)

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]

Description

The operator 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.

Attention

In both input parameters the same number of regions must be passed.

Execution Information

Parameters

Regions1Regions1Regions1Regions1regions1regions_1 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regions to be examined.

Regions2Regions2Regions2Regions2regions2regions_2 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Comparative regions.

NormNormNormNormnormnorm (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Type of normalization.

Default value: 'center' "center" "center" "center" "center" "center"

List of values: 'center'"center""center""center""center""center"

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)).

Result

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>). 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.

Possible Predecessors

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

Alternatives

intersectionintersectionIntersectionIntersectionIntersectionintersection, complementcomplementComplementComplementComplementcomplement, area_centerarea_centerAreaCenterAreaCenterAreaCenterarea_center

See also

hamming_change_regionhamming_change_regionHammingChangeRegionHammingChangeRegionHammingChangeRegionhamming_change_region

Module

Foundation