random_region ( : RegionRandom : Width, Height : )

Create a random region.

The operator random_region returns a random region. During this process every pixel in the image area [0...Width-1][0...Height-1] is adapted into the region with the probability 0.5. The created region can be imagined as the threshold formation in an image with noise. This procedure is particularly important for the creation of uncorrelated binary patterns. The random pattern is created by the C function "nrand48".


Attention

If Width and Height are chosen large (> 100) the created region may require much storage space due to the internally used runlength coding. The gray values of the output region are undefined.


Parameters

RegionRandom (output_object)
region -> object
Created random region with expansion Width x Height.

Width (input_control)
extent.x -> integer
Maximum horizontal expansion of random region.
Default value: 128
Suggested values: 16, 32, 50, 64, 100, 128, 256, 300, 400, 512
Range of values: 1 <= Width <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Width > 0

Height (input_control)
extent.y -> integer
Maximum vertical expansion of random region.
Default value: 128
Suggested values: 16, 32, 50, 64, 100, 128, 256, 300, 400, 512
Range of values: 1 <= Height <= 512 (lin)
Minimum increment: 1
Recommended increment: 10
Restriction: Height > 0


Complexity

The worst case for the storage complexity for the created region (in byte) is: O(Width * Height * 2)


Result

If the parameter values are correct, the operator random_region returns the value TRUE. Otherwise an exception is raised. The clipping of the current image format is set via the operator set_system(::'clip_region',<true/false>:).


Possible Successors

paint_region__, reduce_domain


See also

checker_region, hamming_change_region, add_noise1, add_noise2, reduce_domain



Copyright © 1996-1997 MVTec Software GmbH