Computes the mean of image pixel values.
Case 1: Operation on one-channel integer data
IppStatus ippiMean_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize roiSize, Ipp64f* pMean);
Supported values for mod:
8u_C1R |
16u_C1R |
16s_C1R |
Case 2: Operation on one-channel floating-point data
IppStatus ippiMean_32f_C1R(const Ipp32f* pSrc, int srcStep, IppiSize roiSize, Ipp64f* pMean, IppHintAlgorithm hint);
Case 3: Masked operation on one-channel data
IppStatus ippiMean_<mod>(const Ipp<datatype>* pSrc, int srcStep, const Ipp8u* pMask, int maskStep, IppiSize roiSize, Ipp64f* pMean);
Supported values for mod:
8u_C1MR |
8s_C1MR |
16u_C1MR |
32f_C1MR |
Case 4: Operation on multi-channel integer data
IppStatus ippiMean_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize roiSize, Ipp64f mean[3]);
Supported values for mod:
8u_C3R |
16u_C3R |
16s_C3R |
8u_AC4R |
16u_AC4R |
16s_AC4R |
IppStatus ippiMean_<mod>(const Ipp<datatype>* pSrc, int srcStep, IppiSize roiSize, Ipp64f mean[4]);
Supported values for mod:
8u_C4R |
16u_C4R |
16s_C4R |
Case 5: Operation on multi-channel floating-point data
IppStatus ippiMean_<mod>(const Ipp32f* pSrc, int srcStep, IppiSize roiSize, Ipp64f mean[3], IppHintAlgorithm hint);
Supported values for mod:
32f_C3R |
32f_AC4R |
IppStatus ippiMean_32f_C4R(const Ipp32f* pSrc, int srcStep, IppiSize roiSize, Ipp64f mean[4], IppHintAlgorithm hint);
Case 6: Masked operation on multi-channel data
IppStatus ippiMean_<mod>(const Ipp<datatype>* pSrc, int srcStep, const Ipp8u* pMask, int maskStep, IppiSize roiSize, int coi, Ipp64f* pMean);
Supported values for mod:
8u_C3CMR |
8s_C3CMR |
16u_C3CMR |
32f_C3CMR |
pSrc |
Pointer to the source image ROI. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
pMask |
Pointer to the mask image. |
maskStep |
Distance in bytes between starts of consecutive lines in the mask image. |
roiSize |
Size of the source ROI in pixels. |
coi |
Channel of interest (for color images only); can be 1, 2, or 3. |
pMean |
Pointer to the computed mean of pixel values. |
mean |
Array containing computed mean values for each channel of a multi-channel image. |
hint |
Option to select the algorithmic implementation of the function. |
The flavors of the function ippiMean that perform masked operations are declared in the ippcv.h file. All other function flavors are declared in the ippi.h file. This function operates with ROI (see Regions of Interest in Intel IPP). It computes the mean (average) of pixel values pMean for the source image pSrc. Computation algorithm is specified by the hint argument (see Table “Hint Arguments for Image Moment Functions”). For non-masked operations on a multi-channel image (Case 4, 5), the mean is computed over each channel and stored in the array mean. In the mask multi-channel mode (Case 6), the mean is computed for a single channel of interest specified by coi. The following code example shows how to use the ippiMean function:
ippStsNoErr |
Indicates no error. Any other value indicates an error or a warning. |
ippStsNullPtrErr |
Indicates an error when any of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error condition if roiSize has a field with zero or negative value. |
ippStsStepErr |
Indicates an error condition in mask mode, if srcStep or maskStep is less than roiSize.width * <pixelSize >. |
ippStsNotEvenStepErr |
Indicates an error condition in mask mode if steps for floating-point images cannot be divided by 4. |
ippStsCOIErr |
Indicates an error when coi is not 1, 2, or 3. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.