paint_region__ ( Region, Image : ImageResult : Greyval, Type : )

Paint a region in an image with a constant gray value.

paint_region__ paints the regions given in Region with a constant gray value into the image given in Image. The parameter Type determines whether the region should be painted filled ('fill') or whether only its boundary should be painted ('margin'). The resulting image is returned in ImageResult.


Attention

paint_region__ should only be used to paint into newly created images (new_image__), because otherwise the gray values of other existing images may be overwritten.


Parameters

Region (input_object)
region(-array) -> object
Regions to be painted into the input image.

Image (input_object)
image -> object
Image in which the regions are to be painted.

ImageResult (output_object)
image -> object
Image containing the result.

Greyval (input_control)
number -> real / integer
Desired gray value of the region.
Default value: 255.0
Suggested values: 0.0, 1.0, 2.0, 5.0, 10.0, 16.0, 32.0, 64.0, 128.0, 253.0, 254.0, 255.0
Range of values: 0.0 <= Greyval <= 255.0

Type (input_control)
string -> string
Paint regions filled or as boundaries.
Default value: 'fill'
List of values: 'fill', 'margin'


Example
/* Copy of a rectangle in a new image (New) */

read_image(:Image:'affe':) >
rectangle1(:Rectangle:100.0,100.0,300.0,300.0:) >
reduce_domain(Image,Rectangle:Mask::) >
/* generate a black image */
clear_image(Image:New1:0.0:) >
/* copy a white rectangle */
paint_region__(Mask,New1:New:255.0,'fill':).

Result

paint_region__ returns TRUE if all parameters are correct. If the input is empty the behaviour can be set via set_system(::'no_object_result',<Result>:). If necessary, an exception is raised.


Possible Predecessors

read_image, new_image__, clear_image, reduce_domain


Alternatives

set_greyval__, paint_grey__


See also

reduce_domain, set_draw, new_image__



Copyright © 1996-1997 MVTec Software GmbH