region_to_meanregion_to_meanRegionToMeanRegionToMeanregion_to_mean (Operator)
region_to_meanregion_to_meanRegionToMeanRegionToMeanregion_to_mean — Paint regions with their average gray value.
Signature
def region_to_mean(regions: HObject, image: HObject) -> HObject
Description
region_to_meanregion_to_meanRegionToMeanRegionToMeanregion_to_mean returns an image in which the regions
RegionsRegionsRegionsregionsregions are painted with their average gray value based on
the image ImageImageImageimageimage. This operator is mainly
intended to visualize segmentation results.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on channel level.
Parameters
RegionsRegionsRegionsregionsregions (input_object) region(-array) → objectHRegionHObjectHObjectHobject
Input regions.
ImageImageImageimageimage (input_object) (multichannel-)image → objectHImageHObjectHObjectHobject (byte / uint2)
original gray-value image.
ImageMeanImageMeanImageMeanimageMeanimage_mean (output_object) image → objectHImageHObjectHObjectHobject * (byte / uint2)
Result image with painted regions.
Example (HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,3,3,6,100)
region_to_mean(Regions,Image,Disp)
dev_display(Disp)
dev_set_draw('margin')
dev_display(Regions)
Example (C)
read_image(&Image,"fabrik");
regiongrowing(Image,&Regions,3,3,6,100);
region_to_mean(Regions,Image,&Disp);
disp_image(Disp,WindowHandle);
set_draw(WindowHandle,"margin");
disp_region(Regions,WindowHandle);
Example (HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,3,3,6,100)
region_to_mean(Regions,Image,Disp)
dev_display(Disp)
dev_set_draw('margin')
dev_display(Regions)
Example (HDevelop)
read_image(Image,'fabrik')
regiongrowing(Image,Regions,3,3,6,100)
region_to_mean(Regions,Image,Disp)
dev_display(Disp)
dev_set_draw('margin')
dev_display(Regions)
Result
region_to_meanregion_to_meanRegionToMeanRegionToMeanregion_to_mean returns 2 (
H_MSG_TRUE)
if all parameters are
correct. If the input is empty the behavior can be set via
set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>).
If necessary, an exception is raised.
Possible Predecessors
regiongrowingregiongrowingRegiongrowingRegiongrowingregiongrowing,
connectionconnectionConnectionConnectionconnection
Possible Successors
disp_imagedisp_imageDispImageDispImagedisp_image
Alternatives
paint_regionpaint_regionPaintRegionPaintRegionpaint_region,
intensityintensityIntensityIntensityintensity
Module
Foundation