Operator Reference

mean_nmean_nMeanNMeanNmean_n (Operator)

mean_nmean_nMeanNMeanNmean_n — Average gray values over several channels.

Signature

mean_n(Image : ImageMean : : )

Herror mean_n(const Hobject Image, Hobject* ImageMean)

Herror T_mean_n(const Hobject Image, Hobject* ImageMean)

void MeanN(const HObject& Image, HObject* ImageMean)

HImage HImage::MeanN() const

static void HOperatorSet.MeanN(HObject image, out HObject imageMean)

HImage HImage.MeanN()

def mean_n(image: HObject) -> HObject

Description

The operator mean_nmean_nMeanNMeanNmean_n generates the pixel-by-pixel mean value of all channels . For each coordinate point the sum of all gray values at this coordinate is calculated. The result is the mean of the gray values (sum divided by the number of channels). The output image has one channel.

For an explanation of the concept of smoothing filters see the introduction of chapter Filters / Smoothing.

Attention

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Automatically parallelized on tuple level.
  • Automatically parallelized on domain level.

Parameters

ImageImageImageimageimage (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / int2 / uint2 / int4 / real)

Multichannel gray image.

ImageMeanImageMeanImageMeanimageMeanimage_mean (output_object)  singlechannelimage(-array) objectHImageHObjectHObjectHobject * (byte / int2 / uint2 / int4 / real)

Result of averaging.

Example (C)

compose3(Channel1,Channel2,Channel3,&MultiChannel);
mean_n(MultiChannel,&Mean);

Possible Predecessors

compose2compose2Compose2Compose2compose2, compose3compose3Compose3Compose3compose3, compose4compose4Compose4Compose4compose4, compose5compose5Compose5Compose5compose5, add_channelsadd_channelsAddChannelsAddChannelsadd_channels

Alternatives

rank_nrank_nRankNRankNrank_n

See also

count_channelscount_channelsCountChannelsCountChannelscount_channels, mean_imagemean_imageMeanImageMeanImagemean_image

Module

Foundation