Herror ::mean_n (
    Hobject Image,
    Hobject *ImageMean
)
HImage HImage::MeanN (
    void
) const
HImageArray HImageArray::MeanN (
    void
) const

Average gray values over several channels.

The operator ::mean_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.


Parameters

Image (input_object)
multichannel-image(-array) -> Hobject: HImage(Array) ( byte / real )
Multichannel gray image.

ImageMean (output_object)
singlechannelimage(-array) -> Hobject * : HImage(Array) ( byte / real )
Result of averaging.


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

Possible Predecessors

::compose2, ::compose3, ::compose4, ::add_channels


Possible Successors

::disp_image


See also

::count_channels


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH