Herror ::hamming_change_region (
    Hobject InputRegion,
    Hobject *OutputRegion,
    const HTuple &Width,
    const HTuple &Height,
    const HTuple &Distance
)
HRegion HRegion::HammingChangeRegion (
    const HTuple &Width,
    const HTuple &Height,
    const HTuple &Distance
) const
HRegionArray HRegionArray::HammingChangeRegion (
    const HTuple &Width,
    const HTuple &Height,
    const HTuple &Distance
) const

Generate a region having a given Hamming distance.

::hamming_change_region changes the region in the left upper part of the image given by Width and Height such that the resulting regions have a Hamming distance of Distance to the input regions. This is done by adding or removing Distance points from the input region.


Attention

If Width and Height are chosen too large the resulting region requires a lot of memory.


Parameters

InputRegion (input_object)
region(-array) -> Hobject: HRegion(Array)
Region to be modified.

OutputRegion (output_object)
region(-array) -> Hobject * : HRegion(Array)
Regions having the required Hamming distance.

Width (input_control)
extent.x -> HTuple.long
Width of the region to be changed.
Default value: 100
Suggested values: 64, 128, 256, 512
Typical range of values: 1 <= Width <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width > 0

Height (input_control)
extent.y -> HTuple.long
Height of the region to be changed.
Default value: 100
Suggested values: 64, 128, 256, 512
Typical range of values: 1 <= Height <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height > 0

Distance (input_control)
integer -> HTuple.long
Hamming distance between the old and new regions.
Default value: 1000
Suggested values: 100, 500, 1000, 5000, 10000
Typical range of values: 0 <= Distance <= 10000 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: (Distance >= 0) && (Distance < (Width * Height))


Complexity

Memory requirement of the generated region (worst case): O(2 * Width * Height).


Result

::hamming_change_region returns H_MSG_TRUE if all parameters are correct. The behavior in case of empty input (no regions given) can be set via ::set_system('no_object_result',<Result>). If necessary, an exception handling is raised.


Possible Predecessors

::connection, ::regiongrowing, ::pouring, ::class_ndim_norm


Possible Successors

::select_shape


See also

::hamming_distance


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH