Herror ::region_to_mean (
    Hobject Regions,
    Hobject Image,
    Hobject *ImageMean
)
HImage HRegion::RegionToMean (
    const HImage &Image
) const
HImage HRegionArray::RegionToMean (
    const HImage &Image
) const

Paint regions with their average gray value.

::region_to_mean returns an image in which the regions Regions are painted with their average gray value based on the image Image. This operator is mainly intended to visualize segmentation results.


Parameters

Regions (input_object)
region(-array) -> Hobject: HRegion(Array)
Input regions.

Image (input_object)
image -> Hobject: HImage ( byte )
original gray-value image.

ImageMean (output_object)
image -> Hobject * : HImage ( byte )
Result image with painted regions.


Example
read_image(&Image,"fabrik");
region_growing(Image,&Regions,3,3,6,100);
region_to_mean(Regions,Image,&Disp);
disp_image(Disp,WindowHandle);
set_draw(WindowHandle,"margin");
set_color(WindowHandle,"black");
disp_region(Regions,WindowHandle);

Result

::region_to_mean returns H_MSG_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

::regiongrowing, ::connection


Possible Successors

::disp_image


Alternatives

::paint_region, ::intensity


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH