Skip to content

mean_nMeanNMeanNmean_nmean_n🔗

Short description🔗

mean_nMeanNMeanNmean_nmean_n — Average gray values over several channels.

Signature🔗

mean_n( image Image, out image ImageMean )void MeanN( const HObject& Image, HObject* ImageMean )static void HOperatorSet.MeanN( HObject image, out HObject imageMean )def mean_n( image: HObject ) -> HObject

Herror mean_n( const Hobject Image, Hobject* ImageMean )

Herror T_mean_n( const Hobject Image, Hobject* ImageMean )

HImage HImage::MeanN( ) const

HImage HImage.MeanN( )

Description🔗

The operator mean_nMeanN 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🔗

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🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / int2 / uint2 / int4 / real)HObject (byte / int2 / uint2 / int4 / real)HImage (byte / int2 / uint2 / int4 / real)HObject (byte / int2 / uint2 / int4 / real)Hobject (byte / int2 / uint2 / int4 / real)

Multichannel gray image.

ImageMeanimageMeanimage_mean (output_object) singlechannelimage(-array) → object (byte / int2 / uint2 / int4 / real)HObject (byte / int2 / uint2 / int4 / real)HImage (byte / int2 / uint2 / int4 / real)HObject (byte / int2 / uint2 / int4 / real)Hobject * (byte / int2 / uint2 / int4 / real)

Result of averaging.

Example🔗

(C)

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

Combinations with other operators🔗

Combinations

Possible predecessors

compose2Compose2, compose3Compose3, compose4Compose4, compose5Compose5, add_channelsAddChannels

Alternatives

rank_nRankN

See also

count_channelsCountChannels, mean_imageMeanImage

Module🔗

Foundation