ClassesClasses | | Operators

hamming_distancehamming_distanceHammingDistanceHammingDistance (Operator)

Name

hamming_distancehamming_distanceHammingDistanceHammingDistance — Hamming distance between two regions.

Signature

hamming_distance(Regions1, Regions2 : : : Distance, Similarity)

Herror hamming_distance(const Hobject Regions1, const Hobject Regions2, Hlong* Distance, double* Similarity)

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

void HammingDistance(const HObject& Regions1, const HObject& Regions2, HTuple* Distance, HTuple* Similarity)

HTuple HRegion::HammingDistance(const HRegion& Regions2, HTuple* Similarity) const

Hlong HRegion::HammingDistance(const HRegion& Regions2, double* Similarity) const

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

HTuple HRegion.HammingDistance(HRegion regions2, out HTuple similarity)

int HRegion.HammingDistance(HRegion regions2, out double similarity)

Description

The operator hamming_distancehamming_distanceHammingDistanceHammingDistanceHammingDistance returns the hamming distance between two regions, i.e., the number of pixels of the regions which are different (DistanceDistanceDistanceDistancedistance), i.e., the number of pixels contained in one region but not in the other:

The parameter SimilaritySimilaritySimilaritySimilaritysimilarity describes the similarity between the two regions based on the hamming distance DistanceDistanceDistanceDistancedistance:
If both regions are empty SimilaritySimilaritySimilaritySimilaritysimilarity 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

Regions1Regions1Regions1Regions1regions1 (input_object)  region(-array) objectHRegionHRegionHobject

Regions to be examined.

Regions2Regions2Regions2Regions2regions2 (input_object)  region(-array) objectHRegionHRegionHobject

Comparative regions.

DistanceDistanceDistanceDistancedistance (output_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Hamming distance of two regions.

Assertion: Distance >= 0

SimilaritySimilaritySimilaritySimilaritysimilarity (output_control)  real(-array) HTupleHTupleHtuple (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 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>). 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>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection

Alternatives

intersectionintersectionIntersectionIntersectionIntersection, complementcomplementComplementComplementComplement, area_centerarea_centerAreaCenterAreaCenterAreaCenter

See also

hamming_change_regionhamming_change_regionHammingChangeRegionHammingChangeRegionHammingChangeRegion

Module

Foundation


ClassesClasses | | Operators